/* Y'Thai Admin Panel - Mobile First CSS */

:root {
    --gold: #C4975C;
    --gold-light: #E8D4B8;
    --gold-dark: #5C4419;
    --green: #2D5A3D;
    --green-light: #4A7C59;
    --cream: #FBF8F3;
    --charcoal: #1A1A1A;
    --white: #FFFFFF;
    --danger: #E85D4C;
    --success: #28a745;
    --grey: #6c757d;
    --grey-light: #e9ecef;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--grey-light);
    color: var(--charcoal);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.admin-header {
    background: var(--green);
    color: var(--white);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
}

.logo span {
    color: var(--gold-light);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Navigation */
.admin-nav {
    background: var(--white);
    border-bottom: 1px solid var(--grey-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
    min-width: max-content;
}

.nav-tabs li {
    flex-shrink: 0;
}

.nav-tabs a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--grey);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-tabs a.active,
.nav-tabs a:hover {
    color: var(--green);
    border-bottom-color: var(--green);
}

/* Main Content */
.admin-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--grey-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--grey);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--green);
}

.stat-card.gold .value {
    color: var(--gold);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--green-light);
}

.btn-secondary {
    background: var(--grey-light);
    color: var(--charcoal);
}

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

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--charcoal);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--grey-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--green);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Menu Items List */
.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--grey-light);
    gap: 1rem;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item .drag-handle {
    color: var(--grey);
    cursor: grab;
    font-size: 1.25rem;
}

.menu-item .item-details {
    flex: 1;
    min-width: 0;
}

.menu-item .item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.menu-item .item-desc {
    font-size: 0.85rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item .item-price {
    font-weight: 600;
    color: var(--green);
    white-space: nowrap;
}

.menu-item .item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: #FF6B35;
    color: var(--white);
}

.badge-sold-out {
    background: var(--danger);
    color: var(--white);
}

.badge-spicy {
    background: var(--gold-light);
    color: var(--gold-dark);
}

/* Activity Log */
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--grey-light);
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item .time {
    color: var(--grey);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--grey-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--grey-light);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 2000;
}

.toast {
    background: var(--charcoal);
    color: var(--white);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.3s ease;
}

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

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--grey-light);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--grey);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .admin-main {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .modal {
        max-width: 500px;
        border-radius: 16px;
        margin: auto;
    }
    
    .modal-overlay {
        align-items: center;
    }
    
    .card-header h2 {
        font-size: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .admin-header {
        padding: 1rem 2rem;
    }
    
    .nav-tabs a {
        padding: 1rem 1.5rem;
    }
    
    .admin-main {
        padding: 2rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--grey); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
