/* İMLA-AI Custom Styles */

/* ── Renk Teması: Turuncu ── */
:root {
    --brand:        #F97316;
    --brand-dark:   #EA6C0A;
    --brand-darker: #D96109;
    --brand-rgb:    249, 115, 22;

    /* Bootstrap 5 primary override */
    --bs-primary:        #F97316;
    --bs-primary-rgb:    249, 115, 22;
    --bs-link-color:     #F97316;
    --bs-link-hover-color: #EA6C0A;
    --bs-btn-bg:         #F97316;
    --bs-btn-border-color: #F97316;
}

/* Bootstrap btn-primary */
.btn-primary {
    background-color: var(--brand) !important;
    border-color:     var(--brand) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--brand-dark) !important;
    border-color:     var(--brand-darker) !important;
}
.btn-outline-primary {
    color:        var(--brand) !important;
    border-color: var(--brand) !important;
}
.btn-outline-primary:hover {
    background-color: var(--brand) !important;
    color: #fff !important;
}

/* Bootstrap bg-primary */
.bg-primary { background-color: var(--brand) !important; }

/* Bootstrap text-primary */
.text-primary { color: var(--brand) !important; }

/* Bootstrap border-primary */
.border-primary { border-color: var(--brand) !important; }

/* Bootstrap badge bg-primary */
.badge.bg-primary { background-color: var(--brand) !important; }

/* Focus ring */
.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--brand-rgb), 0.6);
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-rgb), 0.2);
}

/* Nav tabs */
.nav-tabs .nav-link:hover  { color: var(--brand); border: none; }
.nav-tabs .nav-link.active {
    color: var(--brand);
    border-bottom: 3px solid var(--brand);
    background-color: transparent;
}

/* Nav pills */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--brand) !important;
}

/* Links */
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* ── Global Styles ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8f9fa;
}

/* ── Sidebar ── */
.sidebar {
    background-color: #1a1a1a;
    overflow-y: auto;
}


.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: var(--brand);
}

.sidebar .book-list { max-height: 300px; overflow-y: auto; }
.sidebar .book-item { transition: all 0.2s; }
.sidebar .book-item:hover { background-color: rgba(255, 255, 255, 0.08) !important; }

.sidebar .book-item.bg-primary {
    background-color: var(--brand) !important;
}

/* Sidebar brand link */
.sidebar .navbar-brand:hover { color: var(--brand) !important; }

/* ── Navbar ── */
.navbar.bg-light {
    background-color: #ffffff !important;
    border-bottom: 2px solid #f0f0f0 !important;
}

/* ── Main Content ── */
main {
    padding-top: 1rem;
    min-height: 100vh;
}

.main-content { margin-left: 250px; }

/* ── Cards ── */
.card {
    border: 1px solid #e9ecef;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
}
.card:hover {
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ── Buttons ── */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* ── Table ── */
.table-hover tbody tr:hover {
    background-color: rgba(var(--brand-rgb), 0.05);
}

/* ── Badge ── */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* ── Alert ── */
.alert {
    border: none;
    border-radius: 0.375rem;
}

/* ── Step Number (Welcome) ── */
.step-number {
    width: 50px;
    height: 50px;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px;
}

/* ── Timeline ── */
.timeline { position: relative; padding-left: 30px; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-marker {
    position: absolute;
    left: -30px; top: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
}
.timeline-content {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid var(--brand);
    overflow: hidden;
    word-break: break-word;
}
.timeline-content .badge {
    white-space: normal;
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
}

/* ── Chat Container ── */
.chat-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 0.375rem;
}

/* ── Modal ── */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}
.modal-header { border-bottom: 2px solid #f0f0f0; }
.modal-footer { border-top: 1px solid #f0f0f0; }

/* ── Progress ── */
.progress { border-radius: 0.375rem; }
.progress-bar { background-color: var(--brand) !important; }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track  { background: rgba(255,255,255,0.05); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.25); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.45); }

/* ── Chat Responsive ── */
@media (max-width: 767px) {
    .chat-container { height: 55vh !important; min-height: 280px !important; }
    #chatMessages .card-body { font-size: 0.9rem; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .display-4 { font-size: 2.5rem; }
    .btn-lg { padding: 0.5rem 1rem; font-size: 1rem; }

    .sidebar {
        z-index: 1045 !important;
        position: fixed !important;
        bottom: 0; top: 0; left: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }
    .sidebar.collapse:not(.show) { display: none !important; }
    .sidebar.collapse.show       { display: block !important; }
    .main-content { margin-left: 0 !important; }
    #sidebarMenu .nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }
    #sidebarMenu .nav-item { width: 100% !important; }
    #sidebarMenu .nav-link { width: 100% !important; }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 5px;
    }
    .nav-tabs::-webkit-scrollbar { height: 4px; }
    .nav-tabs::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }
}
