/* Traffic Monitor Admin Styles */
.traffic-monitor-wrap {
    margin: 20px 0;
}

.tm-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tm-header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
}

.tm-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.tm-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.tm-period-selector {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.tm-refresh-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.tm-refresh-btn:hover {
    background: #005a87;
}

/* Stats Cards */
.tm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tm-stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0073aa;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tm-stat-card h3 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-stat-card .stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #0073aa;
    margin: 0;
}

.tm-stat-card .stat-change {
    font-size: 12px;
    color: #28a745;
    margin-top: 5px;
}

.tm-stat-card .stat-change.negative {
    color: #dc3545;
}

/* Charts Section */
.tm-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.tm-chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tm-chart-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.tm-chart-wrapper {
    position: relative;
    height: 300px;
}

.tm-charts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tm-chart-sidebar-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tm-chart-sidebar-item h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.tm-chart-sidebar-wrapper {
    position: relative;
    height: 200px;
}

/* Recent Visits Table */
.tm-recent-visits {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tm-recent-visits h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.tm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tm-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
}

.tm-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    color: #666;
}

.tm-table tr:hover {
    background: #f8f9fa;
}

.tm-table .country-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Settings Page */
.tm-settings-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.tm-settings-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
}

.tm-settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tm-settings-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.tm-form-group {
    margin-bottom: 20px;
}

.tm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tm-form-group input[type="text"],
.tm-form-group input[type="number"],
.tm-form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    max-width: 400px;
}

.tm-form-group input[type="checkbox"] {
    margin-right: 10px;
}

.tm-form-group .description {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.tm-button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background 0.3s ease;
}

.tm-button:hover {
    background: #005a87;
}

.tm-button.secondary {
    background: #6c757d;
}

.tm-button.secondary:hover {
    background: #545b62;
}

.tm-button.danger {
    background: #dc3545;
}

.tm-button.danger:hover {
    background: #c82333;
}

/* Dashboard Widget */
.traffic-monitor-widget {
    padding: 15px;
}

.traffic-monitor-widget .tm-stat {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.traffic-monitor-widget .tm-stat:last-child {
    border-bottom: none;
}

.traffic-monitor-widget a {
    color: #0073aa;
    text-decoration: none;
}

.traffic-monitor-widget a:hover {
    text-decoration: underline;
}

/* Table Styles */
.tm-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.tm-table-container table {
    width: 100%;
    border-collapse: collapse;
}

.tm-table-container th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-table-container td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
    font-size: 14px;
}

.tm-table-container tr:hover {
    background-color: #f8f9fa;
}

.tm-table-container tr:last-child td {
    border-bottom: none;
}

/* Source badges */
.tm-source-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.tm-source-google { background-color: #4285f4; }
.tm-source-facebook { background-color: #1877f2; }
.tm-source-twitter { background-color: #1da1f2; }
.tm-source-instagram { background-color: #e4405f; }
.tm-source-linkedin { background-color: #0077b5; }
.tm-source-youtube { background-color: #ff0000; }
.tm-source-direct { background-color: #28a745; }
.tm-source-referral { background-color: #6c757d; }
.tm-source-email { background-color: #dc3545; }

/* Device icons */
.tm-device-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.tm-device-desktop::before { content: "🖥️"; }
.tm-device-mobile::before { content: "📱"; }
.tm-device-tablet::before { content: "📱"; }

/* Page info styling */
.tm-page-info strong {
    color: #495057;
    font-size: 13px;
}

.tm-page-info small {
    color: #6c757d;
    font-size: 11px;
    word-break: break-all;
}

/* Pagination */
.tm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
}

.tm-page-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tm-page-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tm-page-btn.tm-active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.tm-page-btn.tm-active:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Export buttons */
.tm-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    margin-right: 10px;
}

.tm-button:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.tm-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

/* Recent visits section */
.tm-recent-visits {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.tm-recent-visits h3 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.3em;
    font-weight: 600;
}

.tm-recent-visits h4 {
    margin: 20px 0 10px 0;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
}

/* Loading states */
.tm-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6c757d;
}

.tm-loading::before {
    content: "⟳";
    display: inline-block;
    margin-right: 10px;
    animation: spin 1s linear infinite;
    font-size: 20px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .tm-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tm-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .tm-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .tm-table-container {
        overflow-x: auto;
    }
      .tm-table-container table {
        min-width: 800px;
    }
}

/* Debug Information Styles */
.tm-debug-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.tm-debug-panel h4 {
    color: #0073aa;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 5px;
}

.tm-debug-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tm-debug-table th,
.tm-debug-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.tm-debug-table th {
    background: #0073aa;
    color: white;
    font-weight: 600;
}

.tm-debug-table tr:hover {
    background: #f8f9fa;
}

.tm-debug-samples {
    background: white;
    border-radius: 5px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.tm-debug-sample {
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
}

.tm-debug-sample:last-child {
    margin-bottom: 0;
}

/* GDPR Cookie Banner Styles */
.tm-gdpr-banner {
    position: fixed;
    left: 0;
    right: 0;
    background: #1e1e1e;
    color: #fff;
    z-index: 999999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease-in-out;
}

.tm-gdpr-banner.tm-gdpr-show {
    opacity: 1;
    transform: translateY(0);
}

.tm-gdpr-banner.tm-gdpr-hide {
    opacity: 0;
    transform: translateY(100%);
}

.tm-gdpr-banner.tm-gdpr-bottom {
    bottom: 0;
}

.tm-gdpr-banner.tm-gdpr-top {
    top: 0;
    transform: translateY(-100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.tm-gdpr-banner.tm-gdpr-top.tm-gdpr-show {
    transform: translateY(0);
}

.tm-gdpr-banner.tm-gdpr-top.tm-gdpr-hide {
    transform: translateY(-100%);
}

.tm-gdpr-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.tm-gdpr-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.tm-gdpr-text {
    flex: 1;
}

.tm-gdpr-text p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.tm-gdpr-text p:last-child {
    margin-bottom: 0;
}

.tm-gdpr-links a {
    color: #4CAF50;
    text-decoration: underline;
}

.tm-gdpr-links a:hover {
    color: #45a049;
}

.tm-gdpr-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tm-gdpr-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tm-gdpr-accept {
    background: #4CAF50;
    color: white;
}

.tm-gdpr-accept:hover {
    background: #45a049;
}

.tm-gdpr-reject {
    background: #f44336;
    color: white;
}

.tm-gdpr-reject:hover {
    background: #da190b;
}

.tm-gdpr-settings {
    background: #2196F3;
    color: white;
}

.tm-gdpr-settings:hover {
    background: #0b7dda;
}

/* GDPR Modal Styles */
.tm-gdpr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
}

.tm-gdpr-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.tm-gdpr-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tm-gdpr-modal-header h3 {
    margin: 0;
    color: #333;
}

.tm-gdpr-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tm-gdpr-close:hover {
    color: #333;
}

.tm-gdpr-modal-body {
    padding: 20px;
}

.tm-gdpr-category {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.tm-gdpr-category-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.tm-gdpr-category-label input[type="checkbox"] {
    margin-right: 10px;
}

.tm-gdpr-category-desc {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-left: 24px;
}

.tm-gdpr-modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.tm-gdpr-save-settings {
    background: #4CAF50;
    color: white;
}

.tm-gdpr-save-settings:hover {
    background: #45a049;
}

.tm-gdpr-accept-all {
    background: #2196F3;
    color: white;
}

.tm-gdpr-accept-all:hover {
    background: #0b7dda;
}

/* Responsive Design for GDPR */
@media (max-width: 768px) {
    .tm-gdpr-content {
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }
    
    .tm-gdpr-actions {
        justify-content: center;
    }
    
    .tm-gdpr-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .tm-gdpr-modal-content {
        width: 95%;
        margin: 10px;
    }
      .tm-gdpr-modal-footer {
        flex-direction: column;
    }
}

/* GDPR Admin Settings Styles */
.tm-gdpr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.tm-stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tm-stat-item strong {
    font-size: 1.5em;
    color: #0073aa;
    display: block;
    margin-bottom: 5px;
}