/* assets/css/admin.css - Glows Waffle Yönetim Paneli Stilleri */

:root {
    --primary: #d97706;
    --primary-hover: #b45309;
    --primary-light: #fef3c7;
    --dark: #2c1810;
    --dark-muted: #5c483d;
    --bg-admin: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --font: 'Outfit', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-admin);
    color: var(--text);
    line-height: 1.5;
}

/* Navbar */
.admin-navbar {
    background: #2c1810;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.nav-brand span {
    color: #fbbf24;
}

.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-action-btn.btn-view {
    background: #fbbf24;
    color: #2c1810;
}
.nav-action-btn.btn-view:hover {
    background: #f59e0b;
}

.nav-action-btn.btn-logout {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.nav-action-btn.btn-logout:hover {
    background: #ef4444;
    color: #fff;
}

.nav-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-tabs-bar::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    color: #e2d9d2;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
}

.nav-tab:hover, .nav-tab.active {
    color: #2c1810;
    background: #fbbf24;
}

/* Container */
.admin-container {
    max-width: 1140px;
    margin: 28px auto;
    padding: 0 20px;
}

/* Top bar / Stats */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.page-actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}
.btn-danger:hover {
    background: #fecaca;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Tables & Card Boxes */
.card-box {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}

.card-box-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-box-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
}

.filter-pills-wrap {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.filter-pills-wrap::-webkit-scrollbar {
    height: 4px;
}
.filter-pills-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.btn.filter-active {
    background: #d97706 !important;
    color: #ffffff !important;
    border-color: #d97706 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35) !important;
}

.table-responsive-container {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: #f8fafc;
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background-color: #fafbfc;
}

.table-thumb {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.prod-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.prod-name-tr {
    font-weight: 700;
    font-size: 15px;
    color: var(--dark);
}

.prod-name-en {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.prod-cat-mobile {
    display: none; /* Only visible on mobile card */
    margin-top: 4px;
}

.prod-price-tag {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-hover);
}

.badge-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.badge-cat {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

/* Status Toggle Badge */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    user-select: none;
}

.status-pill:active {
    transform: scale(0.96);
}

.status-active {
    background: #dcfce7;
    color: #15803d;
}

.status-inactive {
    background: #fee2e2;
    color: #b91c1c;
}

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

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.form-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   MOBILE RESPONSIVE SPECIALIZATION (Smartphones & Tablets < 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .admin-container {
        margin: 14px auto;
        padding: 0 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .page-actions .btn {
        justify-content: center;
        padding: 10px 8px;
        font-size: 13px;
        text-align: center;
    }

    /* Stats on Mobile: Compact 3 items */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 10px 8px;
        gap: 8px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        border-radius: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 8px;
    }

    .stat-val {
        font-size: 18px;
        line-height: 1.1;
    }

    .stat-label {
        font-size: 10px;
        line-height: 1.2;
    }

    /* Card Box on Mobile */
    .card-box {
        border-radius: 14px;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .card-box-header {
        background: #fff;
        border-radius: 12px;
        border: 1px solid var(--border);
        padding: 14px;
        margin-bottom: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .card-box-title {
        font-size: 15px;
    }

    .filter-pills-wrap {
        width: 100%;
    }

    /* Transform Table Rows to Mobile Cards */
    .table-responsive-container {
        overflow: visible;
    }

    .admin-table {
        display: block;
        width: 100%;
    }

    .admin-table thead {
        display: none; /* Hide desktop table headers on mobile */
    }

    .admin-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .admin-table tr.admin-prod-row {
        display: grid;
        grid-template-columns: 76px 1fr;
        grid-template-areas: 
            "thumb info"
            "foot foot"
            "act act";
        gap: 10px 12px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 14px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }

    .admin-table tr:hover td {
        background-color: transparent;
    }

    .cell-thumb {
        grid-area: thumb;
        padding: 0 !important;
        border: none !important;
        display: flex;
        align-items: flex-start;
    }

    .cell-thumb .table-thumb {
        width: 76px;
        height: 76px;
        border-radius: 12px;
    }

    .cell-info {
        grid-area: info;
        padding: 0 !important;
        border: none !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
    }

    .prod-title-line {
        gap: 6px;
    }

    .prod-name-tr {
        font-size: 15px;
        font-weight: 700;
        line-height: 1.25;
    }

    .prod-name-en {
        font-size: 12px;
    }

    .prod-cat-mobile {
        display: block;
    }

    /* Hide desktop category column */
    .cell-cat {
        display: none !important;
    }

    /* Price and Status combined row */
    .cell-price, .cell-status {
        padding: 0 !important;
        border: none !important;
    }

    /* Container row for price and status */
    .cell-price {
        grid-area: foot;
        display: flex;
        align-items: center;
        border-top: 1px dashed var(--border) !important;
        padding-top: 10px !important;
    }

    .cell-status {
        grid-area: foot;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        border-top: 1px dashed var(--border) !important;
        padding-top: 10px !important;
    }

    .prod-price-tag {
        font-size: 18px;
        font-weight: 800;
        color: var(--primary-hover);
    }

    .status-pill {
        padding: 6px 14px;
        font-size: 12px;
    }

    /* Full width touch buttons for actions */
    .cell-actions {
        grid-area: act;
        padding: 0 !important;
        border: none !important;
    }

    .actions-wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .action-btn-edit, .action-btn-del {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 13px;
        font-weight: 600;
    }

    /* Form Mobile Layout */
    .form-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 14px;
    }

    .form-footer {
        flex-direction: column;
        padding: 16px;
    }

    .form-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .form-control {
        font-size: 16px; /* Prevents iOS auto-zoom on input focus */
    }
}

/* Alert Boxes */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Login Page Spec */
.login-body {
    background: linear-gradient(135deg, #1f1610 0%, #351c10 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
    padding: 36px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.nav-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.login-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.login-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 16px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    color: #2c1810;
}

.login-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}
