:root {
    --primary: #6F7F63;
    --primary-dark: #5a6850;
    --primary-light: #8a9a7d;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-border: #e2e8f0;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.glass-bg {
    display: none;
    /* Removed for white theme */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

header {
    margin-bottom: 3rem;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.admin-logo {
    height: 50px;
    width: auto;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -1px;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.main-grid {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.form-section {
    flex: 0 0 380px;
    position: sticky;
    top: 2rem;
}

.list-section {
    flex: 1;
}

/* Cards */
.card {
    background: var(--bg-white);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
}

.card-header h2 i {
    color: var(--primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 12px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.813rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

/* Form Styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(111, 127, 99, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--error);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
}

/* Grid & Items */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.image-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.img-wrapper {
    height: 180px;
    background: #f1f5f9;
    overflow: hidden;
    position: relative;
}

.img-wrapper img,
.img-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 1.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    background: rgba(111, 127, 99, 0.1);
    color: var(--primary);
}

.card-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-content a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 1.25rem;
    word-break: break-all;
    font-weight: 500;
}

.offer-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.offer-list li {
    font-size: 0.875rem;
    color: var(--text-main);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.4;
}

.offer-list li i {
    color: var(--primary);
    font-size: 0.9rem;
    margin-top: 0.1rem;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    color: var(--primary);
}

.btn-delete {
    color: var(--error);
}

.btn-icon:hover {
    background: #f8fafc;
}

/* Search */
.search-box {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: white;
    outline: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    background: var(--text-main);
    color: white;
    font-weight: 600;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--error);
}

/* Loader */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(111, 127, 99, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Drawer Menu Styling --- */
.drawer-item-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(111, 127, 99, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
    position: relative;
    animation: itemFadeIn 0.25s ease-out;
}

@keyframes itemFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.drawer-item-row input {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem !important;
}

.drawer-item-row input.item-label {
    flex: 1;
}

.drawer-item-row input.item-link {
    flex: 1.8;
}

.btn-remove-item {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

/* --- Responsiveness & Premium Mobile Layouts --- */

/* For medium screens / Tablets (collapsing side-by-side card-header components) */
@media (max-width: 1100px) {
    .main-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
    .form-section {
        flex: none;
        width: 100%;
        position: static;
    }
}

/* Stacking search and header when width gets squeezed */
@media (max-width: 950px) {
    .list-section .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }
    .search-box {
        max-width: 100%;
    }
}

/* For small tablets and mobile devices */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    header {
        margin-bottom: 2rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    header p {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.25rem 1rem;
        border-radius: 18px;
        margin-bottom: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.15rem;
    }

    /* Scrollable horizontal tab bar with hidden scrollbar for a touch-first premium native feel */
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        gap: 0.4rem;
        padding: 0.3rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;  /* IE/Edge */
    }
    
    .tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Opera */
    }

    .tab-btn {
        flex: 0 0 auto;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .img-wrapper {
        height: 160px;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        text-align: center;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Extremely small devices / older phones */
@media (max-width: 380px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
}