@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================
   PREMIUM DESIGN SYSTEM
   ========================================= */

:root {
    /* Color Palette */
    --bg-main: #FBFBFB; /* Extremely soft off-white */
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F9FAFB;
    --bg-sidebar: #FFFFFF; /* Light theme sidebar */
    
    --text-primary: #111827; /* Near black */
    --text-secondary: #4B5563; /* Medium gray */
    --text-tertiary: #9CA3AF; /* Light gray */
    
    --primary: #4F46E5; /* Premium Electric Blue/Indigo */
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    
    --secondary: #7C3AED; /* Subtle Violet */
    --secondary-hover: #6D28D9;
    
    --danger: #EF4444;
    --danger-hover: #DC2626;
    --danger-light: #FEF2F2;
    
    --success: #10B981;
    --success-hover: #059669;
    --success-light: #ECFDF5;
    
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    
    --border: #E5E7EB;
    --border-hover: #D1D5DB;
    
    /* Premium Shadows (Multi-layered) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    /* Typography & Spacing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
}

/* Typography Hierarchy */
h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; }
h4 { font-size: 16px; font-weight: 600; }
.caption { font-size: 12px; color: var(--text-secondary); }

/* =========================================
   COMPONENTS
   ========================================= */

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.card-header {
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background-color: var(--danger-hover);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: var(--space-4);
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.form-control::placeholder {
    color: var(--text-tertiary);
}
.form-control:hover {
    border-color: var(--border-hover);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.badge-success { background: var(--success-light); color: var(--success-hover); }
.badge-danger { background: var(--danger-light); color: var(--danger-hover); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-neutral { background: #F3F4F6; color: var(--text-secondary); }

/* Tables (ATS Style) */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.premium-table th {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.premium-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}
.premium-table tbody tr {
    transition: background-color 0.2s ease;
}
.premium-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}
.premium-table tbody tr:last-child td {
    border-bottom: none;
}

/* User Avatar Micro-Component */
.avatar-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
.avatar-info {
    display: flex;
    flex-direction: column;
}
.avatar-name {
    font-weight: 500;
    color: var(--text-primary);
}
.avatar-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Layout Structural Classes */
.public-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.public-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-icon {
    color: var(--primary);
}
.public-main {
    flex: 1;
    padding: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Admin Structural Classes */
.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.admin-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    height: 64px;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.sidebar-nav {
    padding: var(--space-4) var(--space-3);
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}
.nav-icon {
    width: 18px;
    height: 18px;
}
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    overflow: hidden;
}
.admin-topbar {
    height: 64px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 var(--space-8);
}
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}
.empty-icon {
    font-size: 32px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}
.empty-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}
.empty-desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mr-2 { margin-right: var(--space-2); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.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); }

.w-full { width: 100%; }

/* AI Indicators (Retained but polished) */
.bar {
    display: inline-block;
    width: 4px;
    border-radius: 3px;
    background: var(--primary);
    transition: height 0.1s ease;
}
.bar.idle   { height: 4px; background: var(--text-tertiary); }
.bar.speak  { background: var(--primary); animation: bar-bounce 0.6s ease-in-out infinite alternate; }
.bar.speak:nth-child(1) { animation-delay: 0s;    height: 16px; }
.bar.speak:nth-child(2) { animation-delay: 0.15s; height: 10px; }
.bar.speak:nth-child(3) { animation-delay: 0.3s;  height: 16px; }
@keyframes bar-bounce {
    0%   { transform: scaleY(0.4); }
    100% { transform: scaleY(1); }
}

.bar.listen {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: dot-pulse 1.2s ease-in-out infinite;
}
.bar.listen:nth-child(1) { animation-delay: 0s; }
.bar.listen:nth-child(2) { animation-delay: 0.2s; }
.bar.listen:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
    0%, 100% { opacity: 0.25; transform: scale(0.7); }
    50%       { opacity: 1;    transform: scale(1.2); }
}

/* Tabs */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-6);
    gap: var(--space-6);
}
.tab-item {
    padding: var(--space-3) 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab-item:hover {
    color: var(--text-primary);
}
.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* File Upload Premium Component */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    background: var(--bg-surface);
    transition: all 0.2s ease;
    cursor: pointer;
}
.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-upload-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}
.file-upload-icon {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}
