/* PolicyDesk Glassmorphism Theme */
/* Light theme - default */

:root {
    --radius: 1rem;
    
    /* Light theme colors */
    --background: oklch(0.98 0.001 200);
    --foreground: oklch(0.18 0.01 250);
    --card: rgba(255, 255, 255, 0.65);
    --card-foreground: oklch(0.18 0.01 250);
    --popover: rgba(255, 255, 255, 0.75);
    --popover-foreground: oklch(0.18 0.01 250);
    --primary: oklch(0.52 0.14 250);
    --primary-foreground: oklch(0.98 0 0);
    --secondary: rgba(255, 255, 255, 0.5);
    --secondary-foreground: oklch(0.18 0.01 250);
    --muted: rgba(235, 242, 255, 0.6);
    --muted-foreground: oklch(0.42 0.01 250);
    --accent: rgba(195, 215, 255, 0.55);
    --accent-foreground: oklch(0.28 0.02 250);
    --destructive: oklch(0.52 0.18 28);
    --border: rgba(175, 195, 255, 0.28);
    --input: rgba(175, 195, 255, 0.18);
    --ring: oklch(0.52 0.14 250);
    --glass-highlight: rgba(255, 255, 255, 0.85);
    --glass-shadow: 0 8px 32px rgba(0, 20, 60, 0.06);
    
    /* Chart colors */
    --chart-1: oklch(0.52 0.14 250);
    --chart-2: oklch(0.48 0.11 160);
    --chart-3: oklch(0.68 0.09 180);
    --chart-4: oklch(0.58 0.16 25);
    --chart-5: oklch(0.42 0.11 310);
    
    /* Sidebar */
    --sidebar: rgba(255, 255, 255, 0.55);
    --sidebar-foreground: oklch(0.18 0.01 250);
    --sidebar-primary: oklch(0.52 0.14 250);
    --sidebar-primary-foreground: oklch(0.98 0 0);
    --sidebar-accent: rgba(195, 215, 255, 0.45);
    --sidebar-accent-foreground: oklch(0.28 0.02 250);
    --sidebar-border: rgba(175, 195, 255, 0.18);
    --sidebar-ring: oklch(0.52 0.14 250);
}

/* Dark theme */
:root.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: rgba(35, 45, 65, 0.65);
    --card-foreground: oklch(0.985 0 0);
    --popover: rgba(45, 55, 80, 0.75);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.65 0.18 260);
    --primary-foreground: oklch(0.145 0 0);
    --secondary: rgba(55, 65, 90, 0.5);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: rgba(90, 100, 130, 0.4);
    --muted-foreground: oklch(0.708 0 0);
    --accent: rgba(100, 120, 170, 0.4);
    --accent-foreground: oklch(0.85 0.01 260);
    --destructive: oklch(0.65 0.22 25);
    --border: rgba(100, 120, 170, 0.18);
    --input: rgba(100, 120, 170, 0.12);
    --ring: oklch(0.65 0.18 260);
    --glass-highlight: rgba(80, 100, 150, 0.25);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    --chart-1: oklch(0.65 0.18 260);
    --chart-2: oklch(0.55 0.16 170);
    --chart-3: oklch(0.6 0.12 200);
    --chart-4: oklch(0.62 0.18 330);
    --chart-5: oklch(0.52 0.14 310);
    
    --sidebar: rgba(35, 45, 65, 0.55);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.65 0.18 260);
    --sidebar-primary-foreground: oklch(0.145 0 0);
    --sidebar-accent: rgba(100, 120, 170, 0.3);
    --sidebar-accent-foreground: oklch(0.85 0.01 260);
    --sidebar-border: rgba(100, 120, 170, 0.12);
    --sidebar-ring: oklch(0.65 0.18 260);
}

/* Synthwave theme */
:root.synthwave {
    --background: oklch(0.12 0.02 320);
    --foreground: oklch(0.95 0.01 320);
    --card: rgba(35, 15, 50, 0.65);
    --card-foreground: oklch(0.95 0.01 10);
    --popover: rgba(45, 20, 60, 0.75);
    --popover-foreground: oklch(0.95 0.01 10);
    --primary: oklch(0.75 0.22 340);
    --primary-foreground: oklch(0.12 0.02 320);
    --secondary: rgba(20, 60, 80, 0.5);
    --secondary-foreground: oklch(0.85 0.12 210);
    --muted: rgba(40, 30, 60, 0.5);
    --muted-foreground: oklch(0.65 0.06 320);
    --accent: rgba(200, 100, 255, 0.35);
    --accent-foreground: oklch(0.95 0.08 320);
    --destructive: oklch(0.7 0.25 25);
    --border: rgba(200, 100, 255, 0.25);
    --input: rgba(200, 100, 255, 0.15);
    --ring: oklch(0.75 0.22 340);
    --glass-highlight: rgba(200, 150, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(200, 100, 255, 0.1);
    
    --chart-1: oklch(0.75 0.22 340);
    --chart-2: oklch(0.65 0.18 200);
    --chart-3: oklch(0.6 0.15 10);
    --chart-4: oklch(0.7 0.2 300);
    --chart-5: oklch(0.6 0.15 180);
    
    --sidebar: rgba(30, 12, 45, 0.55);
    --sidebar-foreground: oklch(0.95 0.01 10);
    --sidebar-primary: oklch(0.75 0.22 340);
    --sidebar-primary-foreground: oklch(0.12 0.02 320);
    --sidebar-accent: rgba(200, 100, 255, 0.3);
    --sidebar-accent-foreground: oklch(0.95 0.08 320);
    --sidebar-border: rgba(200, 100, 255, 0.15);
    --sidebar-ring: oklch(0.75 0.22 340);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

/* Glass utilities */
.glass {
    background: var(--card);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    border: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
}

.glass-strong {
    background: var(--popover);
    backdrop-filter: blur(24px) saturate(2);
    -webkit-backdrop-filter: blur(24px) saturate(2);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 20, 60, 0.1);
}

.glass-edge {
    border-top: 1px solid var(--glass-highlight);
}

/* Theme toggle hover effects */
.synthwave .hover-glass:hover {
    background: rgba(180, 60, 180, 0.35);
    border-color: rgba(200, 100, 255, 0.5);
    transform: translateY(-1px);
}

.dark .hover-glass:hover {
    background: rgba(65, 80, 115, 0.7);
    border-color: rgba(120, 140, 190, 0.35);
    transform: translateY(-1px);
}

.bright .hover-glass:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(175, 195, 255, 0.4);
    transform: translateY(-1px);
}

/* Transitions */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-glass {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Forms */
input, select, textarea {
    font-family: inherit;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    background: var(--input);
    color: var(--foreground);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.375rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--muted);
}

.btn-ghost {
    background: transparent;
    color: var(--foreground);
}

.btn-ghost:hover {
    background: var(--muted);
}

.btn-danger {
    background: var(--destructive);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Cards */
.card {
    background: var(--card);
    backdrop-filter: blur(16px) saturate(1.8);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: var(--glass-shadow);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 1.5rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.badge-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.badge-muted {
    background: var(--muted);
    color: var(--muted-foreground);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    color: var(--foreground);
}

.nav-logo svg {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--foreground);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.nav-link:hover {
    background: var(--muted);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background: var(--muted);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #eab308;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.25rem;
}

.stat-card-title {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--foreground);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--muted-foreground);
}

/* Modal / Dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.modal {
    background: var(--popover);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Theme switcher */
.theme-switcher {
    position: relative;
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 150px;
    background: var(--popover);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--glass-shadow);
    z-index: 50;
    overflow: hidden;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-option:hover {
    background: var(--muted);
}

.theme-option.active {
    background: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--foreground);
    text-decoration: none;
    transition: background 0.2s;
}

.page-link:hover {
    background: var(--muted);
}

.page-link.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.page-ellipsis {
    padding: 0 0.5rem;
    color: var(--muted-foreground);
}

/* Misc */
.text-muted {
    color: var(--muted-foreground);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.hidden { display: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
