/* ============================================
   COOKIE CONSENT MANAGER - ADMIN DASHBOARD
   Custom Styles
   ============================================ */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --light: #f8fafc;
    --dark: #1e293b;
    --sidebar-width: 260px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    overflow-x: hidden;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 15px;
    color: var(--dark);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    list-style: none;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    padding: 0 12px;
    margin-bottom: 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
    width: 24px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.user-info span {
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 100;
}

.main-header h4 {
    font-weight: 600;
}

.header-actions {
    margin-left: auto;
}

.content-area {
    padding: 24px;
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    border-radius: 12px;
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-card.bg-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

.stat-card.bg-success {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
}

.stat-card.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.stat-card.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info span {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
}

.badge-status {
    font-size: 0.8rem;
}

.badge-active {
    background-color: #dcfce7;
    color: #166534;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-trial {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-category {
    font-size: 0.75rem;
}

.badge-necessary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-functional {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.badge-analytics {
    background-color: #cffafe;
    color: #0e7490;
}

.badge-marketing {
    background-color: #fce7f3;
    color: #be185d;
}

.badge-unknown {
    background-color: #f1f5f9;
    color: #64748b;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-action {
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ============================================
   FORMS
   ============================================ */

.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.progress-bar {
    border-radius: 4px;
}

/* ============================================
   MODALS
   ============================================ */

.modal-content {
    border: none;
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
}

/* ============================================
   TOAST
   ============================================ */

.toast {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.gap-2 {
    gap: 0.5rem;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 4px 8px;
}

/* Consent decision badges */
.consent-accept {
    color: var(--success);
}

.consent-reject {
    color: var(--danger);
}

/* Chart container */
#consentChart {
    max-height: 300px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ============================================
   ACCESSIBILITY (WCAG 2.1 AA)
   ============================================ */

/* Skip Link - hidden by default, visible on focus */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 10000;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    color: white;
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* Focus-visible styles for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    box-shadow: none;
}

.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 0;
    border-color: var(--primary);
    box-shadow: none;
}

.nav-link:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: -2px;
    border-radius: 8px;
}

.btn-close:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    box-shadow: none;
}

.stat-card:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .progress-bar-animated {
        animation: none !important;
    }

    .sidebar {
        transition: none;
    }

    .skip-link {
        transition: none;
    }
}
