/* 
 * Ads Tracking System - Main Stylesheet
 * Simple CSS without framework
 */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* === Layout === */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    width: 100%;
    padding: 0 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-layout .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

main.main-content > .container-fluid {
    padding: 20px;
}

/* === Header === */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* === Glassmorphism Floating Buttons === */
.glass-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgb(117 117 117 / 22%);
    border-radius: 20px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.glass-btn:active {
    transform: scale(0.95);
}

/* Fixed positioning for special floating buttons */
.glass-btn-fixed {
    position: fixed;
    z-index: 998;
    opacity: 1;
    transform: translateY(0);
}

.glass-btn-fixed.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.glass-btn-fixed:hover {
    transform: translateY(0) scale(1.05);
}

.glass-btn-fixed:active {
    transform: translateY(0) scale(0.95);
}

/* Specific glass button variants */
.glass-btn-primary {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.glass-btn-primary:hover {
    background: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.6);
}

.glass-btn-success {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
}

.glass-btn-success:hover {
    background: rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.6);
}

/* Floating Auth Buttons */
.floating-auth-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    display: flex;
    flex-direction: row;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 95vw;
    justify-content: center;
}

.floating-auth-buttons.hidden {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.floating-auth-buttons .glass-btn {
    white-space: nowrap;
    flex: 0 0 auto;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    top: 20px;
    left: 20px;
    padding: 10px 14px;
}

.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: #c0c0c0;
    margin: 5px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu-toggle.hidden {
    transform: translateY(-100px) !important;
}

/* Offcanvas Overlay */
.offcanvas-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.offcanvas-overlay.active {
    display: block;
    opacity: 1;
}

/* Offcanvas Menu */
.header-nav.offcanvas {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 1000;
    flex-direction: column;
    align-items: stretch;
    padding: 80px 20px 20px;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
}

.header-nav.offcanvas.active {
    right: 0;
}

.header-nav.offcanvas .nav-link {
    color: #1f2937;
    padding: 15px 20px;
    font-size: 1rem;
    opacity: 1;
    margin-bottom: 5px;
}

.header-nav.offcanvas .nav-link:hover {
    background: #f3f4f6;
    color: #667eea;
}

.header-nav.offcanvas .nav-link.active {
    background: #e5e7eb;
    color: #667eea;
}

/* User menu in offcanvas */
.header-nav.offcanvas .user-menu-dropdown {
    margin-left: 0 !important;
}

.header-nav.offcanvas .user-menu-toggle {
    width: 100%;
    justify-content: space-between;
    background: #f3f4f6 !important;
    color: #1f2937 !important;
}

.header-nav.offcanvas .dropdown-menu {
    position: static !important;
    display: block !important;
    box-shadow: none !important;
    margin-top: 10px !important;
    border: 1px solid #e5e7eb;
}

.nav-link {
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    opacity: 0.9;
}

.nav-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

/* === Logo Styles === */
.logo {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
    transition: all 0.3s;
}

.logo-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.logo-icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s;
}

.logo-link:hover .logo-icon {
    transform: scale(1.05) rotate(2deg);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.logo .company {
    font-size: 11px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.header-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 11px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.stat-item.blocked .stat-value {
    color: #ff6b6b;
}

.stat-item.risk .stat-value {
    color: #ffd93d;
}

.stat-item.leads .stat-value {
    color: #6bcf7f;
}

/* === Main Content === */
.main-content {
    flex: 1;
    padding: 0;
}

/* === Filters Panel === */
.filters-panel {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* === Buttons === */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-action {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-action:hover {
    background: #5568d3;
}

/* === Results Info === */
.results-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

/* === Table === */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    max-height: 75vh;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr.blocked-row {
    background: #fff5f5;
}

.data-table tbody tr.blocked-row:hover {
    background: #ffe8e8;
}

.text-center {
    text-align: center;
}

.ip-cell {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.fraud-score {
    font-weight: 600;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-source {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-paid_ads {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-organic {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-direct {
    background: #fff3e0;
    color: #f57c00;
}

.badge-referral {
    background: #e0f2f1;
    color: #00796b;
}

.badge-social {
    background: #fce4ec;
    color: #c2185b;
}

.badge-unknown {
    background: #f5f5f5;
    color: #757575;
}

.badge-risk-low {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-risk-medium {
    background: #fff3e0;
    color: #ef6c00;
}

.badge-risk-high {
    background: #ffebee;
    color: #c62828;
}

/* === Status Badges === */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.blocked {
    background: #ffebee;
    color: #c62828;
}

.status-badge.lead {
    background: #e3f2fd;
    color: #1565c0;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.page-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    /* Show mobile menu toggle, hide desktop nav */
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-nav:not(.offcanvas) {
        display: none;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: center;
        padding-left: 60px; /* Space for fixed menu button */
    }
    
    .header {
        position: relative;
    }
    
    /* Adjust floating auth buttons for mobile */
    .floating-auth-buttons {
        flex-direction: row;
        gap: 8px;
        bottom: 15px;
        max-width: 95vw;
    }
    
    .floating-auth-buttons .glass-btn {
        font-size: 0.95rem;
        padding: 10px 14px;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }
    
    
    .header-stats {
        justify-content: center;
        gap: 20px;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 900px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .logo .company {
        font-size: 10px;
    }
    
    .footer-logo-icon {
        width: 50px;
        height: 50px;
    }
}

/* === Detail View in Modal === */
.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    font-size: 16px;
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-label {
    flex: 0 0 200px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.detail-value {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.detail-value code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* === Footer === */
.footer {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    color: #ecf0f1;
    padding: 60px 0 0;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a .link-icon {
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    color: #fff;
    transform: translateX(5px);
}

.footer-links a:hover .link-icon {
    opacity: 1;
}

.footer-description {
    color: #bdc3c7;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Footer Brand Section */
.footer-brand-section {
    padding-right: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-logo-icon {
    width: 70px;
    height: 70px;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
    transition: all 0.3s ease;
}

.footer-logo:hover .footer-logo-icon {
    transform: scale(1.05) rotate(-3deg);
    filter: drop-shadow(0 6px 16px rgba(102, 126, 234, 0.6));
}

.footer-logo-text h4 {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 5px 0;
    border: none;
    padding: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    color: #95a5a6;
    font-size: 13px;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-brand-section .footer-description {
    text-align: left;
    max-width: 100%;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 18px;
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Company Info Section */
.footer-company-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.company-details h5 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.company-details p {
    color: #95a5a6;
    font-size: 13px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-details .info-icon {
    font-size: 16px;
}

.certification-badge {
    height: 69px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.certification-badge:hover {
    opacity: 1;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 25px 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-bottom p {
    margin: 0;
    color: #95a5a6;
    font-size: 13px;
}

.copyright {
    flex: 1;
}

.footer-credits {
    text-align: center;
    flex: 1;
}

.footer-version {
    text-align: right;
    flex: 1;
}

.footer-brand {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.footer-brand:hover {
    color: #764ba2;
}

.footer-separator {
    margin: 0 8px;
    color: #667eea;
    font-weight: 300;
}

.footer-bottom a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 600;
}

.footer-bottom a:hover {
    color: #764ba2;
}

.badge-version {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

i[class^="icon-"] {
  font-style: normal;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .footer-brand-section {
        grid-column: 1 / -1;
        text-align: center;
        padding-right: 0;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-brand-section .footer-description {
        text-align: center;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-company-info {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 40px 0 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h4 {
        font-size: 16px;
    }
    
    .footer-links a {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .copyright,
    .footer-credits,
    .footer-version {
        text-align: center;
    }
    
    .company-details p {
        justify-content: center;
    }
}

.footer-bottom a:hover {
    color: #2980b9;
}

/* Dashboard Stats (Page Specific) */
.dashboard-stats {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.dashboard-stats .stat-item {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    min-width: 150px;
}

.dashboard-stats .stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #667eea;
}

.dashboard-stats .stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.dashboard-stats .stat-item.blocked .stat-value {
    color: #ff6b6b;
}

.dashboard-stats .stat-item.risk .stat-value {
    color: #ffd93d;
}

.dashboard-stats .stat-item.leads .stat-value {
    color: #6bcf7f;
}

/* Gradient card for special stats (cost savings, etc.) */
.dashboard-stats .stat-item.gradient-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.dashboard-stats .stat-item.gradient-card .stat-value {
    color: white !important;
}

.dashboard-stats .stat-item.gradient-card .stat-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

.dashboard-stats .stat-item.gradient-card span:not(.stat-value):not(.stat-label) {
    color: rgba(255, 255, 255, 0.8) !important;
}

.column-selector .column-options {
    max-height: 60vh;
    overflow-y: scroll;
}

/* Filter Row 2 - Force single row layout */
.filter-row-2 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 10px !important;
    align-items: center !important;
}

.filter-row-2 select.filter-select {
    flex: 0 0 auto !important;
    min-width: 180px !important;
    max-width: 200px !important;
}

#customDateRange {
    display: flex;
    gap: 10px;
}

#customDateRange input {
    flex: 0 0 auto;
    width: 150px !important;
}

/* === Dashboard Layout with Sidebar === */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Sidebar Styles */
.analytics-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
    transition: transform 0.3s ease;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 997;
    background: linear-gradient(135deg, #c92f15 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.4),
        0 0 0 0 rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: sidebar-pulse 2s infinite;
}

/* Pulsing glow animation */
@keyframes sidebar-pulse {
    0% {
        box-shadow: 
            0 4px 12px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 
            0 4px 12px rgba(102, 126, 234, 0.4),
            0 0 0 8px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 
            0 4px 12px rgba(102, 126, 234, 0.4),
            0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Adjust position when floating auth buttons are visible */
body:not(.logged-in) .sidebar-toggle {
    bottom: 140px;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 16px rgba(102, 126, 234, 0.5),
        0 0 20px rgba(102, 126, 234, 0.6);
    animation: none;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-nav {
    padding: 0;
}

.nav-group {
    margin-bottom: 30px;
}

.nav-group-title {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: #754fa7;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #eee;
    border-radius: 20px;
}

.nav-group-title i {
    font-size: 14px;
}

.nav-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 2px 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.nav-item a:hover {
    background: #f3f4f6;
    color: #667eea;
}

.nav-item.active a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 500;
}

.nav-item a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Icon placeholders (using Unicode symbols) */
.icon-chart::before { content: "📊"; }
.icon-dashboard::before { content: "📈"; }
.icon-clicks::before { content: "👆"; }
.icon-block::before { content: "🚫"; }
.icon-time::before { content: "⏰"; }
.icon-trend::before { content: "📉"; }
.icon-device::before { content: "📱"; }
.icon-tools::before { content: "🛠️"; }
.icon-export::before { content: "📤"; }
.icon-help::before { content: "💰"; }
.icon-admin::before { content: "⚙️"; }
.icon-users::before { content: "👥"; }
.icon-payment::before { content: "💳"; }
.icon-email::before { content: "📧"; }

/* Main content area with sidebar */
.main-content.with-sidebar {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 400px;
    overflow-x: auto;
    max-width: 100%;
}

/* Scrollbar styling for sidebar */
.analytics-sidebar::-webkit-scrollbar {
    width: 6px;
}

.analytics-sidebar::-webkit-scrollbar-track {
    background: #f9fafb;
}

.analytics-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.analytics-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mobile responsive for dashboard layout */
@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 0;
    }
    
    /* Transform sidebar to offcanvas on mobile */
    .analytics-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 999;
        border-radius: 0;
        padding: 80px 20px 20px;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
        -webkit-overflow-scrolling: touch;
    }
    
    .analytics-sidebar.active {
        left: 0;
    }
    
    /* Show sidebar toggle button on mobile */
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Adjust main content padding on mobile */
    .main-content.with-sidebar {
        padding: 20px 10px;
        margin: 0;
    }
    
    /* Larger nav items for touch on mobile */
    .nav-item a {
        padding: 14px 15px;
        font-size: 15px;
        gap: 14px;
    }
    
    .nav-item a i {
        font-size: 20px;
    }
    
    .nav-group-title {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .nav-group {
        margin-bottom: 25px;
    }
    
    /* Better spacing for charts on mobile */
    .charts-section .content-card {
        margin-bottom: 20px;
    }
    
    /* Ensure stats cards stack nicely */
    .stats-grid {
        gap: 15px;
    }
}
/* === Charts Section - Universal Styles === */
.charts-section {
    margin-bottom: 30px;
    padding: 40px 20px;
}

.charts-grid {
    display: grid;
    gap: 30px;
}

/* Grid Layout Options */
.charts-grid-1col {
    grid-template-columns: 1fr;
}

.charts-grid-2col {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
}

.charts-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}

/* Full-width chart container */
.chart-full-width {
    grid-column: 1 / -1;
}

/* Chart Card Styles */
.chart-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.chart-card-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 5px 0 0 0;
}

.chart-card-body {
    position: relative;
    min-height: 300px;
}

.charts-section canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 500px;
}

/* Chart Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Chart Error State */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #ef4444;
    font-size: 0.9rem;
}

/* Mobile Responsive Charts */
@media (max-width: 768px) {
    .charts-section {
        padding: 20px 10px;
    }
    
    .charts-grid,
    .charts-grid-1col,
    .charts-grid-2col,
    .charts-grid-auto {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .chart-card {
        padding: 15px;
        overflow-x: auto;
        max-width: 100%;
    }
    
    .chart-card-body {
        min-height: 250px;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .charts-section canvas {
        min-height: 250px;
        max-width: 100%;
    }
    
    .chart-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Force full width on mobile */
    .chart-full-width {
        grid-column: 1 / -1 !important;
    }
}
        
/* Spinner for loading */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Icon styles for sidebar */
.icon-conversion::before {
    content: "🎯";
}
.icon-list::before {
    content: "📋";
}

/* === Conversions Overview Page Styles === */

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 36px;
    line-height: 1;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 500;
}

/* Conversion Type List */
.type-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
    cursor: default;
}

.type-item:hover {
    background: #f3f4f6;
    border-left-color: #764ba2;
}

.type-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-info .type-icon {
    font-size: 20px;
}

.type-info .type-name {
    font-weight: 600;
    color: #374151;
}

.type-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

/* Customer Info Display */
.customer-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
}

.info-item strong {
    color: #6b7280;
    font-weight: 600;
    min-width: 70px;
}

.contact-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.contact-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.message-preview {
    color: #4b5563;
    font-style: italic;
    max-width: 250px;
    word-break: break-word;
}

/* Date/Time Cell */
.datetime-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.datetime-cell .date {
    font-weight: 600;
    color: #1f2937;
}

.datetime-cell .time {
    font-size: 12px;
    color: #9ca3af;
}

/* Conversion Type Badges */
.badge-conversion {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Domain Badge */
.domain-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* Value Highlight */
.value-highlight {
    color: #10b981;
    font-weight: 700;
    font-size: 15px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state .empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
}

/* Detail Modal */
.detail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.detail-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #dc2626;
    transform: rotate(90deg);
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table td {
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

.detail-table td:first-child {
    width: 35%;
    vertical-align: top;
}

.detail-table a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.detail-table a:hover {
    text-decoration: underline;
}

.json-display {
    background: #1f2937;
    color: #10b981;
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    line-height: 1.6;
}

/* Responsive adjustments for conversions page */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 28px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .type-item {
        padding: 12px;
    }
    
    .customer-info {
        font-size: 12px;
    }
    
    .info-item strong {
        min-width: 60px;
    }
    
    .message-preview {
        max-width: 200px;
    }
    
    .detail-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .detail-table td {
        display: block;
        width: 100% !important;
        padding: 8px 0;
    }
    
    .detail-table td:first-child {
        font-weight: 600;
        padding-bottom: 4px;
    }
    
    .detail-table tr {
        padding: 10px 0;
        border-bottom: 1px solid #f3f4f6;
    }
}