/* BacAI Student Styles */

:root {
    --primary: #58cc02;
    --primary-rgb: 88, 204, 2;
    --success: #58cc02;
    --warning: #ffc800;
    --danger: #ff4b4b;
    --info: #1cb0f6;
    --owl-green:#58cc02;
    --owl-green-deep:#58a700;
    --owl-green-light:#89e219;
    --owl-green-pale:#dbf8c5;
    --streak-orange:#ff9600;
    --streak-orange-deep:#cc7a00;
    --gem-pink:#ce82ff;
    --eel-blue:#1cb0f6;
    --cardinal-red:#ff4b4b;
    --bee-yellow:#ffc800;
    --snow:#ffffff;
    --eel:#f7f7f7;
    --swan:#e5e5e5;
    --wolf:#777777;
    --ink:#3c3c3c;
    --hare:#afafaf;
    --duo-green:#58cc02;
    --duo-green-dark:#58a700;
    --duo-blue:#1cb0f6;
    --duo-yellow:#ffc800;
    --duo-gray:#e5e5e5;
}

/* Duo is master — app.css defers to duo.css for cards/buttons */
body {
    font-family: 'Inter','Mona Sans','Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--snow);
    color:var(--ink);
}

/* Legacy .card now maps to duo 2px+4px bottom; keep minimal override */
.card {
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.card:hover {
    /* duo.css handles border+shadow; don't override with BS shadow */
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
    transform: translateY(-2px);
}

.hover-bg:hover {
    background-color: rgba(var(--primary-rgb), 0.05);
}

.transition {
    transition: all 0.2s ease;
}

.badge {
    font-weight: 700;
    padding: 0.4em 0.7em;
    font-size: 13px;
}

.btn {
    border-radius: 16px;
    font-weight: 800;
    font-family:'Nunito',sans-serif;
    letter-spacing:0.03em;
}
/* btn-primary deferred to duo.css chunky shadow */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid var(--swan);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--eel-blue);
    box-shadow: 0 0 0 3px rgba(28,176,246,0.2);
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-link {
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    transition: background-color 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255,255,255,0.15) !important;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background-color 0.2s;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: rgba(var(--primary-rgb), 0.03);
}

.list-group-item.active {
    background-color: rgba(var(--primary-rgb), 0.1);
    border-color: transparent;
}

.modal-content {
    border-radius: 1rem;
    border: none;
}

.modal-header, .modal-footer {
    border-color: rgba(0,0,0,0.05);
}

.table th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    vertical-align: middle;
}

.prose {
    line-height: 1.75;
    font-size: 16px;
    color: #1e293b;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #0f172a;
}
.prose p {
    margin-bottom: 1rem;
}
.prose ul, .prose ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
.prose li { margin-bottom: 0.35rem; }
.prose code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.9em;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}
.prose pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    border: 1px solid #1e293b;
}
.prose pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    border: none;
}
.prose blockquote {
    border-left: 4px solid #6366f1;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: #475569;
    font-style: italic;
    background: #f8fafc;
    border-radius: 0 0.5rem 0.5rem 0;
}
.bacai-response h5 { font-size: 18px; letter-spacing: -0.01em; }
.bacai-response .prose { font-size: 16px; }
.bacai-response .katex { font-size: 1.05em; }
.bacai-response .card { border-radius: 0.85rem; }
.bacai-response .badge { font-weight: 600; }

.max-width-75 {
    max-width: 75%;
}

@media (max-width: 767.98px) {
    .max-width-75 {
        max-width: 90%;
    }
}

/* Chat bubbles */
#chatMessages .card {
    border-radius: 1rem;
    max-width: 85%;
}

#chatMessages .card.bg-primary {
    border-bottom-right-radius: 0.25rem;
}

#chatMessages .card.bg-light {
    border-bottom-left-radius: 0.25rem;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Badge variants */
.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

.text-truncate {
    max-width: 100%;
}

/* Auth pages */
.auth-wrapper {
    min-height: 100vh;
}

.auth-card {
    border-radius: 1rem;
    overflow: hidden;
}

.auth-illustration {
    border-radius: 1rem 0 0 1rem;
}

@media (max-width: 991.98px) {
    .auth-illustration {
        border-radius: 1rem 1rem 0 0;
        min-height: 200px;
    }
}

/* Admin sidebar */
.admin-sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.875rem 1.5rem;
    border-radius: 0;
    margin: 0;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-left-color: #0d6efd;
}

.sidebar-nav .nav-link i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.75rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-main {
    flex: 1;
    background: #f8f9fa;
}

.admin-content {
    padding: 1.5rem;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1050;
        transition: left 0.3s;
    }
    .admin-sidebar.show {
        left: 0;
    }
    .admin-main {
        margin-left: 0;
    }
}

/* Plan cards */
.plan-card {
    border: 1px solid #dee2e6;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 2rem rgba(0,0,0,0.1) !important;
}

.plan-card.border-primary {
    border-width: 2px !important;
    border-color: #0d6efd !important;
}

.plan-card.border-warning {
    border-width: 2px !important;
    border-color: #ffc107 !important;
}

/* Progress bars */
.progress {
    border-radius: 1rem;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 575.98px) {
    .display-1 {
        font-size: 3.5rem;
    }
    .card-body {
        padding: 1rem;
    }
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* RTL support — when html dir=rtl (ar) */
html[dir="rtl"] body {
    font-family: 'Segoe UI', Tahoma, 'Noto Naskh Arabic', sans-serif;
}
html[dir="rtl"] .navbar-nav { padding-right:0; }
html[dir="rtl"] .dropdown-menu-end {
    --bs-position: start;
    right: auto;
    left: 0;
}
html[dir="rtl"] .me-2 { margin-right:0 !important; margin-left:0.5rem !important; }
html[dir="rtl"] .me-1 { margin-right:0 !important; margin-left:0.25rem !important; }
html[dir="rtl"] .ms-2 { margin-left:0 !important; margin-right:0.5rem !important; }
html[dir="rtl"] .prose ul, html[dir="rtl"] .prose ol { padding-left:0; padding-right:1.5rem; }
html[dir="rtl"] #chatMessages .card.bg-primary { border-bottom-right-radius:1rem; border-bottom-left-radius:0.25rem; }
html[dir="rtl"] #chatMessages .card.bg-light { border-bottom-left-radius:1rem; border-bottom-right-radius:0.25rem; }
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before { float:right; padding-left:0.5rem; padding-right:0; }
html[dir="rtl"] .text-end { text-align:left !important; }
html[dir="rtl"] .text-start { text-align:right !important; }

/* Lang toggle button specific */
#langToggleBtn { font-weight:600; min-width:72px; justify-content:center; }
#langToggleBtn:hover { background:rgba(255,255,255,0.22); }

/* Translation UX */
[data-translate].translating { opacity:0.6; position:relative; }
[data-translate].translating::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.4) 50%, transparent 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
.translated { animation: fadeTr 0.3s ease; }
@keyframes fadeTr { from{opacity:0.5} to{opacity:1} }
.bacai-bilingual { border-left:3px solid #6366f1; padding-left:0.75rem; }
html[dir="rtl"] .bacai-bilingual { border-left:none; border-right:3px solid #6366f1; padding-left:0; padding-right:0.75rem; }