/* ============================================================
   Nusretoğlu Admin Panel — admin.css
   ============================================================ */

:root {
    --navy:      #0B2545;
    --navy-dark: #071a33;
    --gold:      #FFB400;
    --gold-light:#FFC933;
    --white:     #ffffff;
    --gray-50:   #f8f9fb;
    --gray-100:  #f0f2f5;
    --gray-200:  #e2e8f0;
    --gray-400:  #9ca3af;
    --gray-600:  #6b7280;
    --gray-900:  #111827;
    --success:   #10b981;
    --danger:    #ef4444;
    --sidebar-w: 260px;
    --radius:    12px;
    --shadow:    0 4px 24px rgba(0,0,0,.08);
    --transition: all .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Layout ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
    width: 42px; height: 42px;
    background: var(--gold);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--navy);
    font-size: 18px;
    flex-shrink: 0;
}

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--white);
}
.brand-sub {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,.45);
    letter-spacing: .5px;
}

.sidebar-nav { flex: 1; padding: 20px 12px; overflow-y: auto; }

.sidebar-nav ul li + li { margin-top: 4px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,.65);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,.1);
    color: var(--white);
}

.sidebar-nav a.active {
    background: var(--gold);
    color: var(--navy);
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-ext-link, .sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    color: rgba(255,255,255,.55);
    transition: var(--transition);
}
.sidebar-ext-link:hover { color: var(--gold); }
.sidebar-logout:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-600);
    font-weight: 500;
}

.user-avatar {
    width: 36px; height: 36px;
    background: var(--navy);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
}

/* ── Page Body ── */
.page-body {
    padding: 32px;
    flex: 1;
    min-width: 0;
}

/* ── Toast ── */
.toast {
    position: fixed;
    top: 80px; right: 24px;
    padding: 14px 22px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    animation: slideIn .3s ease;
    transition: opacity .5s ease;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-hide    { opacity: 0; pointer-events: none; }

@keyframes slideIn {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}
.card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h2 i {
    color: var(--gold);
    font-size: 18px;
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255,180,0,.12);
}
textarea.form-control { resize: vertical; min-height: 110px; }

.form-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 5px;
}

/* ── Remember Me ── */
.remember-group { display: flex; align-items: center; }
.remember-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-transform: none !important;
    font-size: 14px !important;
    color: var(--gray-600) !important;
    user-select: none;
}
.remember-label input { display: none; }
.remember-box {
    width: 20px; height: 20px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    position: relative;
    background: var(--white);
}
.remember-label input:checked + .remember-box {
    background: var(--navy);
    border-color: var(--navy);
}
.remember-label input:checked + .remember-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--gold);
    font-size: 10px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}
.btn-primary {
    background: var(--navy);
    color: var(--white);
}
.btn-primary:hover { background: var(--navy-dark); transform: translateY(-1px); }

.btn-gold {
    background: var(--gold);
    color: var(--navy);
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.btn-success {
    background: var(--success);
    color: #fff;
}

/* ── Dashboard Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    border-left: 4px solid var(--gold);
}
.stat-icon {
    width: 50px; height: 50px;
    background: var(--gray-100);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--navy);
}
.stat-label { font-size: 12px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--navy); }

/* ── Projects Table ── */
.proj-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
.proj-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--gray-200);
}
.proj-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    font-size: 13.5px;
}
.proj-table tbody tr:hover { background: var(--gray-50); }

.proj-thumb {
    width: 70px; height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--gray-100);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

.actions { display: flex; gap: 8px; }
.actions { flex-wrap: wrap; }

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Image Upload ── */
.upload-area {
    border: 2px dashed var(--gray-200);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
}
.upload-area:hover, .upload-area.drag-over {
    border-color: var(--gold);
    background: rgba(255,180,0,.05);
}
.upload-area i { font-size: 32px; color: var(--gray-400); margin-bottom: 8px; }
.upload-area p { color: var(--gray-400); font-size: 13px; }
#imagePreview {
    width: 100%; border-radius: 10px;
    margin-top: 12px; display: none;
    max-height: 240px; object-fit: cover;
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, #1a3a60 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: rgba(255,180,0,.06);
    top: -200px; right: -200px;
}
.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 50px 44px;
    width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,.3);
    position: relative;
}
.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 36px;
}
.login-logo .logo-icon {
    width: 60px; height: 60px;
    background: var(--navy);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    font-size: 26px;
    margin-bottom: 16px;
}
.login-logo h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--navy);
}
.login-logo p {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 4px;
}
.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}
.btn-login:hover { background: var(--navy-dark); }

/* ── Grid helpers ── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ── Dashboard quick links ── */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.quick-link-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}
.quick-link-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}
.quick-link-card i {
    font-size: 28px;
    color: var(--navy);
    margin-bottom: 12px;
}
.quick-link-card span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}

/* ── Responsive / Mobile ── */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--navy);
    cursor: pointer;
    margin-right: 15px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
    .topbar {
        padding: 0 20px;
    }
    .page-body {
        padding: 20px;
    }
    .card {
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        width: 90%;
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: auto;
        min-height: 64px;
        padding: 14px 16px;
        gap: 12px;
    }

    .topbar-title h1 {
        font-size: 16px;
        line-height: 1.3;
    }

    .topbar-user {
        gap: 8px;
        font-size: 12px;
    }

    .topbar-user span {
        display: none;
    }

    .page-body {
        padding: 16px;
    }

    .card {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .card-header .btn {
        width: 100%;
        justify-content: center;
    }

    .btn,
    .btn-sm {
        width: 100%;
        justify-content: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn,
    .form-actions a {
        width: 100%;
        justify-content: center;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .quick-link-card {
        padding: 18px;
    }

    .stat-card {
        padding: 18px;
        gap: 14px;
    }

    .stat-value {
        font-size: 22px;
    }

    .upload-area {
        padding: 18px;
    }

    .toast {
        left: 16px;
        right: 16px;
        top: 76px;
        width: auto;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: min(86vw, 320px);
    }

    .sidebar-brand {
        padding: 22px 18px;
    }

    .sidebar-nav {
        padding: 16px 10px;
    }

    .topbar {
        padding: 12px 14px;
    }

    .mobile-toggle {
        margin-right: 10px;
    }

    .topbar-title h1 {
        font-size: 15px;
    }

    .page-body {
        padding: 14px;
    }

    .card {
        padding: 14px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 96px;
    }

    .proj-table {
        min-width: 680px;
    }

    .actions {
        min-width: 180px;
    }

    .login-card {
        width: calc(100% - 28px);
        padding: 32px 20px;
    }
}
