/* ============================================================
   rawFizz Theme — Bootstrap 5.3 modern tema (dark / light)
   Volt temasından ilham alan, yeniden yazılmış hafif arayüz.
   ============================================================ */

/* ---------- Tema değişkenleri ---------- */
:root,
[data-bs-theme="light"] {
    --bs-primary: #4361ee;
    --bs-primary-rgb: 67, 97, 238;
    --bs-link-color: #4361ee;
    --bs-link-color-rgb: 67, 97, 238;
    --bs-body-bg: #f3f5fa;
    --bs-body-color: #1f2937;
    --bs-body-font-family: "Overpass", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-card-bg: #ffffff;
    --bs-card-border-color: #e7eaf3;
    --bs-border-color: #e7eaf3;

    --app-sidebar-bg: #ffffff;
    --app-sidebar-text: #5b6478;
    --app-sidebar-active-bg: rgba(67, 97, 238, 0.10);
    --app-sidebar-active-text: #4361ee;
    --app-topbar-bg: rgba(255, 255, 255, 0.82);
    --app-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
    --app-brand-gradient: linear-gradient(135deg, #4361ee, #8b5cf6);
}

[data-bs-theme="dark"] {
    --bs-primary: #6d8bff;
    --bs-primary-rgb: 109, 139, 255;
    --bs-link-color: #8aa3ff;
    --bs-link-color-rgb: 138, 163, 255;
    --bs-body-bg: #0f1526;
    --bs-body-color: #e2e8f0;
    --bs-card-bg: #17203a;
    --bs-card-border-color: #25304e;
    --bs-border-color: #25304e;

    --app-sidebar-bg: #0b1224;
    --app-sidebar-text: #93a0bd;
    --app-sidebar-active-bg: rgba(109, 139, 255, 0.14);
    --app-sidebar-active-text: #aebfff;
    --app-topbar-bg: rgba(15, 21, 38, 0.82);
    --app-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.28);
    --app-brand-gradient: linear-gradient(135deg, #6d8bff, #a78bfa);
}

/* ---------- Genel görünüm ---------- */
body {
    background-color: var(--bs-body-bg);
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
}

.card {
    border: 1px solid var(--bs-card-border-color);
    border-radius: 1rem;
    box-shadow: var(--app-shadow);
    background-color: var(--bs-card-bg);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-top-left-radius: 1rem !important;
    border-top-right-radius: 1rem !important;
}

.card-header:first-child {
    border-radius: calc(1rem - 1px) calc(1rem - 1px) 0 0;
}

.btn {
    border-radius: 0.6rem;
    font-weight: 600;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 0.75rem;
    color: var(--bs-body-color);
    background-color: transparent;
    border: 1px solid var(--bs-border-color);
}

.btn-icon:hover {
    background-color: var(--app-sidebar-active-bg);
    color: var(--app-sidebar-active-text);
    border-color: transparent;
}

.badge {
    font-weight: 600;
}

.table> :not(caption)>*>* {
    border-bottom-color: var(--bs-border-color);
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.form-control,
.form-select {
    border-radius: 0.6rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

.form-range::-webkit-slider-thumb {
    background: var(--bs-primary);
}

.form-range::-moz-range-thumb {
    background: var(--bs-primary);
}

.form-range {
    accent-color: var(--bs-primary);
}

/* ---------- Uygulama iskeleti ---------- */
.app-shell {
    min-height: 100vh;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(8, 12, 24, 0.55);
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    width: 260px;
    display: flex;
    flex-direction: column;
    background-color: var(--app-sidebar-bg);
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.15rem 1.25rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--bs-body-color);
    letter-spacing: -0.02em;
}

.sidebar-brand:hover {
    color: var(--bs-body-color);
}

.logo-dot {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: var(--app-brand-gradient);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 0.5rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0.8rem 0.3rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.65rem;
    color: var(--app-sidebar-text);
    font-size: 0.94rem;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 1.4rem;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    color: var(--app-sidebar-active-text);
    background-color: var(--app-sidebar-active-bg);
}

.sidebar-nav .nav-link.active {
    color: var(--app-sidebar-active-text);
    background-color: var(--app-sidebar-active-bg);
    font-weight: 700;
}

.sidebar-section-title {
    padding: 0.9rem 1.6rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-sidebar-text);
    opacity: 0.75;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--bs-border-color);
    font-size: 0.78rem;
    color: var(--app-sidebar-text);
}

.app-main {
    margin-left: 260px;
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    background-color: var(--app-topbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bs-border-color);
}

.app-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
}

.avatar-sm {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 50%;
    background: var(--app-brand-gradient);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.topbar-user {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }
}

/* ---------- Sayfa başlığı ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
}

.page-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

/* ---------- İstatistik kartları ---------- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    height: 100%;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.stat-icon.success {
    background-color: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.stat-icon.warning {
    background-color: rgba(255, 193, 7, 0.14);
    color: #d39e00;
}

.stat-icon.danger {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}

.stat-label {
    margin: 0;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* ---------- Hızlı işlem kartları ---------- */
.action-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    height: 100%;
    border: 1px solid var(--bs-card-border-color);
    border-radius: 0.9rem;
    background-color: var(--bs-card-bg);
    color: var(--bs-body-color);
    box-shadow: var(--app-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
    color: var(--app-sidebar-active-text);
}

.action-card .stat-icon {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.15rem;
}

.action-card .action-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

/* ---------- Anket soruları ---------- */
.survey .question-block {
    border: 1px solid var(--bs-card-border-color);
    border-radius: 1rem;
    background-color: var(--bs-card-bg);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}

.survey .question-title {
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.survey .form-check {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.6rem;
    padding: 0.55rem 0.85rem;
    margin: 0.35rem 0;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.survey .form-check:hover {
    border-color: var(--bs-primary);
}

.survey .form-check:has(.form-check-input:checked) {
    border-color: var(--bs-primary);
    background-color: var(--app-sidebar-active-bg);
}

.survey .form-check-input:checked+.form-check-label {
    font-weight: 700;
    color: var(--app-sidebar-active-text);
}

.survey .form-check-label {
    width: 100%;
    cursor: pointer;
}

.survey-vas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.survey-vas .form-check {
    flex: 1 1 auto;
    min-width: 2.9rem;
    text-align: center;
    padding: 0.5rem 0;
}

.survey-vas .form-check-label {
    width: 100%;
}

/* ---------- Tablo sayfaları ---------- */
.table-card .table {
    margin-bottom: 0;
}

.table-card .table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

.empty-state i {
    font-size: 2.4rem;
    opacity: 0.5;
}

/* ---------- Giriş sayfası ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgba(var(--bs-primary-rgb), 0.25), transparent 60%),
        radial-gradient(40rem 25rem at 0% 110%, rgba(139, 92, 246, 0.2), transparent 60%),
        var(--bs-body-bg);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--bs-body-color);
    margin-bottom: 1.5rem;
}

.auth-brand:hover {
    color: var(--bs-body-color);
}

/* ---------- Bildirim listesi ---------- */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.8rem;
    margin-bottom: 0.6rem;
    color: var(--bs-body-color);
    transition: border-color 0.12s ease;
}

.notification-item:hover {
    border-color: var(--bs-primary);
    color: var(--bs-body-color);
}

.notification-item.unread {
    border-left: 3px solid var(--bs-primary);
}

.notification-item .ni-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.7rem;
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* ---------- Video ---------- */
.video-frame {
    border-radius: 0.8rem;
    overflow: hidden;
    width: 100%;
}

.video-frame video {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- CKEditor alanı koyu tema uyumu ---------- */
.django_ckeditor_5 {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    border-radius: 0.6rem !important;
}