/**
 * Index Page (Home) Styles
 * Main navigation card grid page
 */

/* ===== PAGE LAYOUT ===== */
body {
    padding: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== HEADER - Matches restaurants.css ===== */
header {
    background: var(--card);
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 6px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Logout Button - Left side */
.btn-logout {
    width: 3rem;
    height: 3rem;
    background: var(--accent);
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.btn-logout:hover {
    background: white;
    border-color: var(--accent);
    transform: scale(1.05);
}

.btn-logout i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    flex: 1;
    min-width: 0;
}

/* Date and Time Display */
.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.current-time {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.current-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

h1 {
    font-family: 'Work Sans', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: 1.1;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

/* ===== DASHBOARD CARDS GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: var(--card);
    border: 3px solid var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
}

.dashboard-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.dashboard-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #ffffff 0%, #f8f6f2 100%);
}

.dashboard-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    white-space: nowrap;
    margin: 0;
}

.dashboard-card p {
    margin: 0.5rem 0 0 0;
    white-space: nowrap;
    font-size: 0.85rem;
    color: #999;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header {
        padding: 1.5rem 2rem;
        flex-direction: row;          /* Override common.css column */
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .btn-logout {
        order: 1;
    }

    .header-title {
        order: 2;
        flex: 1;
        min-width: 0;
    }

    .header-info {
        order: 3;
        align-items: flex-start;  /* Left-align on tablet/mobile */
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .current-time {
        font-size: 1.25rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-card {
        min-height: 150px;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    header {
        padding: 1.25rem 1.5rem;
        gap: 1rem;
        flex-direction: row;          /* Override common.css column */
        flex-wrap: wrap;              /* Ensure wrapping on mobile */
    }

    .btn-logout {
        order: 1;                     /* Button first */
    }

    .header-title {
        order: 2;                     /* Title second */
        flex: 1;
        min-width: 0;
    }

    .header-info {
        order: 3;                     /* Date/time third */
        align-items: flex-start;      /* Left-align date/time */
        width: 100%;                  /* Force full width for left alignment */
    }

    h1 {
        font-size: 1.5rem;
        max-width: 200px;             /* Force "POS" to wrap to next line */
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .current-time {
        font-size: 1.15rem;
    }

    .current-date {
        font-size: 0.75rem;
    }

    .dashboard-card {
        padding: 1.5rem 1rem;
    }

    .dashboard-card h2 {
        font-size: 1.25rem;
    }
}

/* Extra small mobile - Even tighter wrapping */
@media (max-width: 375px) {
    h1 {
        max-width: 160px;             /* Tighter wrap for smallest screens */
    }

    header {
        gap: 0.75rem;
    }
}