/**
 * Dashboard Customer Styles - Rasin & Saveur
 * Estil dashboard pou klyan
 */

/* ===== DASHBOARD PAGE ===== */
.dashboard-page {
    background: var(--cream);
    min-height: 100vh;
    padding-top: 70px;
}

/* ===== DASHBOARD MAIN ===== */
.dashboard-main {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* ===== SIDEBAR ===== */
.dashboard-sidebar {
    width: 280px;
    background: var(--board);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
    z-index: 100;
    overflow: scroll;
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.user-info h3 {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 4px;
}

.user-info p {
    font-family: var(--body);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    color: var(--cream);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(217, 164, 65, 0.1);
    border-left-color: var(--gold);
}

.nav-item i {
    width: 20px;
    font-size: 18px;
}

.nav-item span {
    font-family: var(--body);
    font-size: 15px;
    font-weight: 500;
}

.nav-badge {
    margin-left: auto;
    background: var(--rust);
    color: var(--cream);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--cream);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--rust);
    border-color: var(--rust);
}

/* ===== DASHBOARD CONTENT ===== */
.dashboard-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
}

/* Sections */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-family: var(--display);
    font-size: 32px;
    font-weight: 600;
    color: var(--board);
    margin-bottom: 8px;
}

.section-header p {
    font-family: var(--body);
    font-size: 16px;
    color: var(--ink-soft);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white-ghost);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--cream);
}

.stat-icon.orders {
    background: var(--gold);
}

.stat-icon.pending {
    background: var(--rust);
}

.stat-icon.completed {
    background: var(--green);
}

.stat-icon.spent {
    background: var(--board);
}

.stat-info h3 {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 600;
    color: var(--board);
    margin-bottom: 4px;
}

.stat-info p {
    font-family: var(--body);
    font-size: 14px;
    color: var(--ink-soft);
}

/* ===== RECENT ORDERS ===== */
.recent-orders {
    background: var(--white-ghost);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h2 {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 600;
    color: var(--board);
}

.view-all {
    color: var(--gold);
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.order-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.order-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-number {
    font-family: var(--display);
    font-weight: 600;
    color: var(--board);
    font-size: 16px;
}

.order-date {
    font-family: var(--body);
    font-size: 13px;
    color: var(--ink-soft);
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-family: var(--body);
    font-size: 12px;
    font-weight: 600;
}

.order-status.PENDING {
    background: rgba(217, 164, 65, 0.1);
    color: #b8860b;
}

.order-status.PREPARING {
    background: rgba(181, 80, 45, 0.1);
    color: #b5502d;
}

.order-status.OUT_FOR_DELIVERY {
    background: rgba(71, 97, 74, 0.1);
    color: #47614a;
}

.order-status.DELIVERED {
    background: rgba(71, 97, 74, 0.2);
    color: var(--green);
}

.order-total {
    font-family: var(--display);
    font-weight: 600;
    color: var(--gold);
    font-size: 16px;
}

/* ===== ADDRESSES ===== */
.addresses-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.add-address-btn {
    padding: 14px 24px;
    background: var(--board);
    color: var(--cream);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    width: fit-content;
    transition: all 0.3s;
}

.add-address-btn:hover {
    background: var(--gold);
}

.addresses-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.address-card {
    background: var(--white-ghost);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
}

.address-card.default {
    border: 2px solid var(--gold);
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.address-title {
    font-family: var(--display);
    font-weight: 600;
    color: var(--board);
    font-size: 16px;
}

.default-badge {
    background: var(--gold);
    color: var(--board);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.address-details p {
    font-family: var(--body);
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

.address-details p strong {
    color: var(--board);
}

.address-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.address-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-btn {
    background: var(--gold);
    color: var(--board);
}

.delete-btn {
    background: var(--rust);
    color: var(--cream);
}

/* ===== PROFILE FORM ===== */
.profile-form {
    max-width: 600px;
    background: var(--white-ghost);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group label {
    display: block;
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    color: var(--board);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(43, 35, 32, 0.1);
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 16px;
    color: var(--board);
    background: var(--cream);
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
}

.form-group input:disabled {
    background: rgba(43, 35, 32, 0.05);
    color: var(--ink-soft);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--board);
    color: var(--cream);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    background: var(--gold);
    color: var(--board);
}

/* ===== FOOTER ===== */
.dashboard-footer {
    text-align: center;
    padding: 24px;
    font-family: var(--body);
    font-size: 14px;
    color: var(--ink-soft);
    margin-left: 280px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .addresses-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .dashboard-sidebar.mobile-open {
        transform: translateX(0);
    }

    .dashboard-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-footer {
        margin-left: 0;
    }

    .order-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ===== LOADING STATE ===== */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--cream-dark);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== DASHBOARD LINKS ===== */
.dashboard-links {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.dashboard-links-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.dashboard-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 6px;
}

.dashboard-link:last-child {
    margin-bottom: 0;
}

.dashboard-link:hover {
    background: rgba(217, 164, 65, 0.2);
    color: var(--gold);
}

.dashboard-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

/* ===== MANAGER SIDEBAR VARIANTS ===== */
.manager-sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.manager-sidebar .sidebar-header {
    background: linear-gradient(135deg, rgba(217, 164, 65, 0.2) 0%, rgba(198, 147, 45, 0.1) 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 0 16px 24px;
}

.manager-avatar {
    background: linear-gradient(135deg, #D9A441 0%, #C6932D 100%);
}

/* ===== RESTAURANT SIDEBAR VARIANTS ===== */
.restaurant-sidebar {
    background: linear-gradient(180deg, #2C5F2D 0%, #1e4220 100%);
}

.restaurant-sidebar .sidebar-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin: 0 16px 24px;
}

.restaurant-avatar {
    background: rgba(255, 255, 255, 0.2);
}

/* Chwa kliyan an te fè — kuizin nan bezwen wè yo pou prepare bon plat la. */
.order-item-options {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #8F3D20;
    margin-top: 2px;
}
