/*
 * ─────────────────────────────────────────────────────────
 * NotulaAI — Sleek SaaS Enterprise Design System
 * ─────────────────────────────────────────────────────────
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Harmony Color System - Midnight Indigo & Neon Teal */
    --bg-dark: #090a0f;
    --bg-card: rgba(17, 19, 28, 0.75);
    --bg-card-hover: rgba(25, 28, 41, 0.85);
    
    --primary: #6366f1;         /* Indigo Glow */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --accent: #14b8a6;          /* Neon Teal */
    --accent-hover: #0d9488;
    --accent-light: rgba(20, 184, 166, 0.15);
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(20, 184, 166, 0.4) 100%);
    --gradient-dark: linear-gradient(180deg, #090a0f 0%, #11131c 100%);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    --text-primary: #f8fafc;    /* Soft White */
    --text-secondary: #94a3b8;  /* Slate Cool Gray */
    --text-muted: #64748b;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --font-sans: 'Plus Jakarta Sans', 'Outfit', system-ui, sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --sidebar-width: 280px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
    --shadow-accent: 0 0 25px rgba(20, 184, 166, 0.2);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(20, 184, 166, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Webkit Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Master Layout Grid */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(9, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    padding: 2rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.brand-icon svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 0 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 1.25rem 0.75rem 0.5rem;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    border: 1px solid transparent;
}

.menu-item a svg {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}

.menu-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active a {
    color: var(--text-primary);
    background: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.1);
}

.menu-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.menu-item.active a svg {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.user-info {
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    transition: var(--transition-smooth);
    border: none;
    background: transparent;
    cursor: pointer;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: calc(100% - var(--sidebar-width));
}

/* Top Header Bar */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.stat-card:hover .stat-icon {
    background: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Beautiful Inputs & Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: rgba(9, 10, 15, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(9, 10, 15, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ffffff;
}

/* Table Style */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

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

.table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-processing {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.25);
    position: relative;
}

.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Upload Interface (Drag-Drop) */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
    transform: scale(1.005);
}

.upload-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition-smooth);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* Split-Pane Notula Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 200px);
}

.editor-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.pane-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pane-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.raw-transcript-box {
    background: rgba(9, 10, 15, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    height: 100%;
}

.interactive-preview {
    background: #ffffff;
    color: #1e293b;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    height: 100%;
    overflow-y: auto;
    font-size: 0.95rem;
}

.preview-field {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
}

.preview-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.preview-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.preview-value {
    font-weight: 500;
    color: #1e293b;
}

/* Alerts System */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

/* Animations */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.pulse-glow {
    animation: pulseGlow 2s infinite ease-in-out;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
    .editor-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}
