/* Ops Guru AI - Global Styles */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06d6a0;
    --accent-dark: #05b88a;
    --warm: #f59e0b;
    --cyan: #22d3ee;
    --dark-bg: #0f172a;
    --darker-bg: #080c14;
    --card-bg: #1e293b;
    --card-bg-hover: #263348;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.1);
    --glow-primary: rgba(99,102,241,0.25);
    --glow-accent: rgba(6,214,160,0.2);
    --page-bg-alt: #1a1a2e;
    --text-content: #cbd5e1;
    --text-heading: #e2e8f0;
    --link-color: #a5b4fc;
    --surface-subtle: rgba(255,255,255,0.03);
    --surface-hover: rgba(255,255,255,0.04);
    --surface-active: rgba(255,255,255,0.06);
    --scrollbar-thumb: rgba(255,255,255,0.1);
    --navbar-scrolled-bg: rgba(8, 12, 20, 0.85);
    --navbar-scrolled-border: rgba(255,255,255,0.05);
    --input-bg: rgba(255,255,255,0.06);
    --input-border: rgba(255,255,255,0.12);
    --input-focus-bg: rgba(255,255,255,0.08);
}

[data-theme="light"] {
    --dark-bg: #f8fafc;
    --darker-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-bg-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-subtle: rgba(0,0,0,0.06);
    --border-light: rgba(0,0,0,0.1);
    --glow-primary: rgba(79,70,229,0.15);
    --glow-accent: rgba(5,150,105,0.12);
    --page-bg-alt: #eef2f7;
    --text-content: #334155;
    --text-heading: #1e293b;
    --link-color: #4f46e5;
    --surface-subtle: rgba(0,0,0,0.02);
    --surface-hover: rgba(0,0,0,0.03);
    --surface-active: rgba(0,0,0,0.05);
    --scrollbar-thumb: rgba(0,0,0,0.15);
    --navbar-scrolled-bg: rgba(255, 255, 255, 0.85);
    --navbar-scrolled-border: rgba(0,0,0,0.08);
    --input-bg: rgba(0,0,0,0.03);
    --input-border: rgba(0,0,0,0.12);
    --input-focus-bg: rgba(0,0,0,0.05);
}

/* Global */
body {
    background: var(--dark-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* Navbar */
.navbar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 16px 0;
    z-index: 1000;
    background: var(--navbar-scrolled-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--navbar-scrolled-border);
}
.navbar.scrolled {
    padding: 10px 0;
    background: var(--navbar-scrolled-bg) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--navbar-scrolled-border);
}
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}
.navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    transition: color 0.2s;
    padding: 8px 16px !important;
}
.navbar .nav-link:hover {
    color: var(--text-primary) !important;
}
.navbar .btn-outline-light {
    border-color: rgba(255,255,255,0.15);
    font-size: 0.85rem;
    padding: 6px 14px;
}
.navbar .btn-outline-light:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.25);
}
.navbar .btn-nav-signup {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 20px;
    border-radius: 8px;
    transition: all 0.2s;
}
.navbar .btn-nav-signup:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--glow-primary);
}

/* Theme toggle */
.btn-theme-toggle {
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-theme-toggle:hover {
    background: var(--surface-active);
    color: var(--text-primary);
}

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

/* Cards */
.card-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    transition: all 0.2s;
}
.card-custom:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-light);
}

/* Form controls */
.form-control-dark {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 14px;
}
.form-control-dark::placeholder { color: var(--text-muted); }
.form-control-dark:focus {
    background: var(--input-focus-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow-primary);
    color: var(--text-primary);
}

/* Chat styles */
.chat-sidebar {
    background: var(--darker-bg);
    border-right: 1px solid var(--border-subtle);
    height: calc(100vh - 60px);
    overflow-y: auto;
}
.chat-main {
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--darker-bg);
}
.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}
.message-user {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.message-assistant {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 4px;
}

/* Task cards */
.task-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}
.task-card:hover {
    border-color: var(--border-light);
    background: var(--card-bg-hover);
}
.priority-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.priority-low { background: rgba(6,214,160,0.15); color: var(--accent); }
.priority-medium { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.priority-high { background: rgba(245,158,11,0.15); color: var(--warm); }
.priority-urgent { background: rgba(239,68,68,0.15); color: #ef4444; }

.status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.status-todo { background: rgba(148,163,184,0.15); color: var(--text-secondary); }
.status-in_progress { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.status-done { background: rgba(6,214,160,0.15); color: var(--accent); }

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* PDF split screen */
.pdf-split-container {
    display: flex;
    height: calc(100vh - 60px);
}
.pdf-form-panel {
    width: 40%;
    overflow-y: auto;
    padding: 32px;
    padding-bottom: 0;
    background: var(--dark-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}
.pdf-form-panel > form {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.pdf-actions-bar {
    display: flex;
    gap: 8px;
    padding: 12px 0 16px;
    background: var(--dark-bg);
    border-top: 1px solid var(--border-subtle);
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: auto;
}
.pdf-preview-panel {
    flex: 1;
    background: #525659;
    display: flex;
    align-items: stretch;
    position: relative;
}
.pdf-preview-panel iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* PDF Spinner */
.pdf-spinner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: spinnerFadeIn 0.3s ease;
}
@keyframes spinnerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.pdf-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.pdf-spinner-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    animation: spinnerRotate 1s cubic-bezier(0.68, -0.15, 0.27, 1.15) infinite;
    box-shadow: 0 0 24px var(--glow-primary), inset 0 0 24px rgba(99,102,241,0.08);
}
@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}
.pdf-spinner-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: spinnerPulse 1.5s ease-in-out infinite;
}
@keyframes spinnerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Footer */
.site-footer {
    background: var(--darker-bg);
    padding: 80px 0 32px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
}
.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.footer-logo {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}
.footer-logo .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
}
.footer-logo:hover { color: var(--text-primary); }
.footer-tagline {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 320px;
    line-height: 1.6;
    margin-top: 12px;
}
.footer-links {
    display: flex;
    gap: 64px;
}
.footer-col h6 {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile navbar collapse */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--navbar-scrolled-bg);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid var(--navbar-scrolled-border);
        border-radius: 12px;
        padding: 16px;
        margin-top: 12px;
    }
    .navbar-collapse .navbar-nav { margin-bottom: 12px; }
    .navbar-collapse .d-flex { flex-wrap: wrap; gap: 8px !important; }
    .pdf-split-container { flex-direction: column; height: auto; }
    .pdf-form-panel { width: 100%; height: auto; overflow-y: visible; flex: none; }
    .pdf-preview-panel { display: none; }
    .pdf-spinner-overlay { position: fixed; inset: 0; }
}

@media (max-width: 768px) {
    .footer-top { flex-direction: column; gap: 32px; }
    .footer-links { gap: 40px; }
    .chat-sidebar { display: none; }
    .pdf-form-panel { padding: 16px; padding-bottom: 0; }
    .pdf-actions-bar { padding: 10px 0 12px; }
}

/* Light theme overrides */
[data-theme="light"] .navbar-brand { color: var(--text-primary) !important; }
[data-theme="light"] .navbar .btn-outline-light { border-color: var(--border-light); color: var(--text-secondary); }
[data-theme="light"] .navbar .btn-outline-light:hover { background: var(--surface-active); border-color: rgba(0,0,0,0.2); color: var(--text-primary); }
[data-theme="light"] .navbar-toggler-icon { filter: invert(1); }
[data-theme="light"] .dropdown-menu { background: var(--card-bg); border-color: var(--border-light); }
[data-theme="light"] .dropdown-item { color: var(--text-secondary); }
[data-theme="light"] .dropdown-item:hover,
[data-theme="light"] .dropdown-item.active { background: rgba(79,70,229,0.08); color: var(--text-primary); }
[data-theme="light"] .card { background: var(--card-bg); border-color: var(--border-light); }
[data-theme="light"] .text-muted { color: var(--text-secondary) !important; }
[data-theme="light"] .form-control-dark { background: var(--input-bg); border-color: var(--input-border); color: var(--text-primary); }
