/* =========================================
   Admin Panel - Dark Theme Styles
   Uses Bootstrap 5 + Fintech Design Tokens
========================================= */

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

body {
    overflow-y: hidden;
    background: var(--bg-main, #0b1220);
    color: var(--text-main, #e5e7eb);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Responsive Button Groups */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 5px;
    margin-bottom: 5px;
}


.btn-group .btn {
    flex: 1;
    min-width: auto;
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .admin-topbar .d-flex {
        flex-direction: initial;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .admin-topbar .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(160deg, var(--card-grad-2, #020617), var(--card-grad-1, #1f2937));
    color: var(--text-main, #e5e7eb);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.9);
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.admin-sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main, #e5e7eb);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-sidebar-brand i {
    color: var(--primary, #38bdf8);
}

.admin-sidebar-nav {
    padding: 1rem 0;
}

.admin-nav-item {
    margin: 0.25rem 0;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(226, 232, 240, 0.8);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}

.admin-nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.admin-nav-link:hover {
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    border-left-color: var(--primary, #38bdf8);
    transform: translateX(4px);
}

.admin-nav-link.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05));
    color: #e5e7eb;
}

/* Main Content Layout */
.admin-main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: all 0.3s ease;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 55%),
                radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.09), transparent 50%),
                var(--bg-main, #020617);
    display: flex;
    flex-direction: column;
    max-height: 100vh;
}

/* Topbar */
.admin-topbar {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.5rem 1rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.85);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    height: 50px;
    flex-shrink: 0;
    gap: 0.5rem;
}

.admin-topbar .btn-link {
    line-height: 1;
    padding: 0.5rem !important;
    color: var(--text-soft, #94a3b8);
}

.admin-topbar .btn-link:hover {
    color: #e5e7eb;
    opacity: 1;
}

@media (max-width: 768px) {
    .admin-topbar {
        padding: 0.5rem 0.75rem;
        height: 50px;
    }
}

/* Tabs & Content Area */
.tab-content {
    overflow-y: visible;
    padding: 0;
    margin: 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.admin-content-area {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 50px);
}

/* Stats Cards */
.admin-stats-card {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 1)),
                radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), rgba(15, 23, 42, 1));
    /* border-radius: 1.25rem; */
    padding: 1.5rem;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.45);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.admin-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary, #38bdf8), var(--accent, #a855f7));
}

.admin-stats-card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 1);
}

.admin-stats-icon {
    width: 28px;
    height: 28px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #e5e7eb;
    background: radial-gradient(circle at top left, var(--primary, #38bdf8), rgba(15, 23, 42, 1));
}

.admin-stats-number {
    font-size: 1rem;
    font-weight: 800;
    margin: 0.5rem 0 0.25rem 0;
    color: #f9fafb;
}

.admin-stats-label {
    color: var(--text-soft, #94a3b8);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Generic Admin Card */
.admin-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.98));
    margin-bottom: 0;
}

.admin-card .row:last-child {
    margin-bottom: 0;
}

.tab-pane > .row {
    margin-bottom: 0;
}

.admin-card-header {
    background: transparent;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem 1.25rem 0 0;
}

@media (max-width: 768px) {
    .admin-card-header {
        padding: 1rem;
    }
}

.admin-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #e5e7eb;
}

@media (max-width: 768px) {
    .admin-card-title {
        font-size: 1rem;
    }
}

h6.mb-0 {
    color: rgba(226, 232, 240, 0.85);
}

/* Ã–zel baÅŸlÄ±k renkleri */
#card-buton .card-title,
#menu .card-title {
    color: #f9fafb !important;
}

/* Admin Buttons */
.admin-btn {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.admin-btn-primary {
    background: linear-gradient(135deg, var(--primary, #38bdf8), var(--accent, #a855f7));
    color: #0b1120;
}

.admin-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(56, 189, 248, 0.4);
    color: #020617;
}

/* Tables */
.admin-table {
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.98);
}

@media (max-width: 768px) {
    .admin-table {
        font-size: 0.875rem;
    }

    .admin-table thead th,
    .admin-table tbody td {
        padding: 0.5rem;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.admin-table thead th {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 1));
    border-bottom: 1px solid rgba(148, 163, 184, 0.6);
    font-weight: 600;
    color: #e5e7eb;
    padding: 1rem;
}

.admin-table tbody tr {
    border-bottom: 1px solid rgba(30, 64, 175, 0.4);
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.9);
}

.admin-table tbody tr:hover {
    background: rgba(15, 23, 42, 1);
}

.admin-badge {
    border-radius: 999px;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    color: #f9fafb;
}

/* Login gradient helper */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--gray-700, #0f172a), var(--primary-dark, #1d4ed8));
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile form tweaks */
@media (max-width: 768px) {
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem;
        background-color: rgba(15, 23, 42, 0.9);
        border-color: rgba(148, 163, 184, 0.6);
        color: #e5e7eb;
    }

    .form-control::placeholder {
        color: rgba(148, 163, 184, 0.7);
    }

    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .card-body {
        padding: 1rem;
    }
}

/* Responsive sidebar behavior */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main-content {
        margin-left: 0;
        max-height: 100vh;
    }

    .admin-content-area {
        padding: 1rem;
        max-height: calc(100vh - 50px);
    }

    .admin-topbar .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        margin-left: 0.5rem !important;
    }

    .admin-topbar .d-flex.align-items-center {
        margin-bottom: 0;
    }

    .admin-stats-card {
        margin-bottom: 1rem;
    }

    .admin-stats-number {
        font-size: 1.5rem;
    }

    .admin-stats-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .admin-topbar {
        padding: 0.5rem;
    }

    .admin-topbar .btn-link i {
        font-size: 1.1rem;
    }

    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

.admin-sidebar-toggle {
    display: none;
}

@media (max-width: 768px) {
    .admin-sidebar-toggle {
        display: block;
    }
}

/* Simple Editor - Dark */
.simple-editor {
    border: 1px solid rgba(55, 65, 81, 0.9);
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.98);
}

.simple-editor-toolbar {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.96));
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.simple-editor-toolbar button {
    background: rgba(15, 23, 42, 1);
    border: 1px solid rgba(55, 65, 81, 0.9);
    border-radius: 999px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #e5e7eb;
    transition: all 0.15s ease;
}

.simple-editor-toolbar button:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(56, 189, 248, 0.8);
}

.simple-editor-toolbar button.active {
    background: linear-gradient(135deg, var(--primary, #38bdf8), var(--accent, #a855f7));
    color: #020617;
    border-color: transparent;
}

.simple-editor-content {
    min-height: 200px;
    padding: 15px;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    background: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
}

.simple-editor-content:focus {
    outline: none;
}

.simple-editor-content.empty:before {
    content: attr(placeholder);
    color: rgba(148, 163, 184, 0.8);
    font-style: italic;
    pointer-events: none;
}

/* Blog iÃ§erik yÃ¼kseklikleri */
#blog_icerik .simple-editor-content {
    min-height: 500px;
}

#blog_aciklama .simple-editor-content {
    min-height: 200px;
}

[id^="edit_icerik_"] .simple-editor-content,
[id^="edit_aciklama_"] .simple-editor-content {
    min-height: 400px;
}

/* Utility spacing overrides */
.mb-3 {
    margin-bottom: 1rem !important;
}

.card {
    margin-bottom: 1rem;
    background: #11283e!important;
}

/* Login card shadow */
.shadow-custom {
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.95) !important;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.95));
    margin-top:10%;
}

.list-group-flush>.list-group-item {
    background: #0f162a;
    border-bottom: 1px solid #495366;
}

.price, .value, strong {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.table>:not(caption)>*>* {
    padding: .5rem .5rem;
    background-color: #1d273600;
        border-bottom: 1px solid #495366;
    box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
    color: #fff;
}
.card.border-primary {
    border: none !important;
    background-color: #12152a !important;
}