/* ==========================================================================
   ACCOUNT LAYOUT SYSTEM
   Mobile-first responsive account pages with sidebar navigation
   ========================================================================== */

/* Base Layout Container */
.account-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* ==========================================================================
   MOBILE HEADER
   ========================================================================== */
.account-mobile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.account-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-height: 44px;
    min-width: 44px;
}

    .account-menu-toggle span {
        width: 20px;
        height: 2px;
        background-color: var(--color-text-primary);
        transition: var(--transition-fast);
    }

.account-mobile-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.account-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--color-card-bg);
    border-right: 1px solid var(--color-border);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

    .account-sidebar.active {
        left: 0;
    }

.account-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

    .account-overlay.active {
        display: block;
    }

/* Navigation Structure */
.account-nav {
    display: flex;
    flex-direction: column;
}

.account-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

    .account-nav-header h2 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
    }

.account-close-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: var(--color-text-primary);
    min-height: 44px;
    min-width: 44px;
}

.account-nav-menu {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.5rem 0;
}

/* Navigation Items */
.account-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
    min-height: 44px;
}

    .account-nav-item:hover {
        background-color: var(--color-bg-tertiary);
        color: var(--color-primary);
        text-decoration: none;
    }

    .account-nav-item.active {
        background-color: var(--color-bg-tertiary);
        color: var(--color-primary);
        font-weight: 500;
        border-left: 3px solid var(--color-primary);
    }

    .account-nav-item i {
        font-size: 1.25rem;
        width: 20px;
        text-align: center;
    }

.account-nav-logout {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.account-content {
    flex: 1;
    padding: 1rem;
}

.account-header {
    margin-bottom: 2rem;
}

.account-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

/* ==========================================================================
   DASHBOARD COMPONENTS
   ========================================================================== */

/* Stats Grid - Fixed width issue */
.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.stat-card {
    background-color: var(--color-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: var(--theme-transition);
    width: 100%;
    min-width: 0; /* Prevents flex/grid overflow */
}

    .stat-card:hover {
        box-shadow: var(--shadow-md);
    }

.stat-title {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
    word-break: break-all; /* Handle long values */
}

.stat-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   CARDS & TABLES
   ========================================================================== */
.account-card {
    background-color: var(--color-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--theme-transition);
}

.account-card-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.account-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -0.5rem;
    padding: 0.5rem;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 600px; /* Ensures table doesn't get too cramped */
}

    .account-table th,
    .account-table td {
        padding: 0.75rem 1rem;
        text-align: left;
        border-bottom: 1px solid var(--color-border);
        vertical-align: middle;
    }

    .account-table th {
        font-weight: 600;
        color: var(--color-text-secondary);
        background-color: var(--color-bg-secondary);
    }

    .account-table tbody tr:hover {
        background-color: var(--color-bg-tertiary);
    }

.account-table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-confirmed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.status-cancelled {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.status-paid {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-unpaid {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

    .pagination-item:hover {
        background-color: var(--color-border);
        text-decoration: none;
    }

    .pagination-item.active {
        background-color: var(--color-primary);
        color: white;
    }

    .pagination-item.disabled {
        opacity: 0.5;
        pointer-events: none;
    }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .account-container {
        flex-direction: row;
    }

    .account-mobile-header {
        display: none;
    }

    .account-sidebar {
        position: static;
        left: 0;
        width: 280px;
        height: auto;
        min-height: calc(100vh - 2rem);
    }

    .account-close-menu {
        display: none;
    }

    .account-content {
        padding: 2rem;
        flex: 1;
        min-width: 0; /* Prevents content overflow */
    }

    .account-card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .account-content {
        padding: 2.5rem;
    }
}

/* Large Desktop: 1280px+ */
@media (min-width: 1280px) {
    .account-sidebar {
        width: 320px;
    }
}

/* ==========================================================================
   ACCESSIBILITY & FOCUS STATES
   ========================================================================== */
.account-nav-item:focus,
.account-menu-toggle:focus,
.account-close-menu:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .account-sidebar,
    .account-overlay,
    .account-nav-item,
    .stat-card {
        transition: none;
    }
}

.booking-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.booking-option {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-tertiary);
}

    .booking-option:hover {
        background-color: var(--color-bg-secondary);
    }

.terms-section {
    padding: 1rem;
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.terms-link {
    color: var(--color-primary);
    text-decoration: none;
}

    .terms-link:hover {
        text-decoration: underline;
    }

.booking-summary {
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

    .summary-row:last-child {
        border-bottom: none;
    }

    .summary-row.total {
        font-weight: bold;
        font-size: 1.125rem;
    }

@media (max-width: 767px) {
    .booking-options .form-check-label {
        font-size: 0.875rem;
    }

    .price {
        display: block;
        margin-top: 0.25rem;
    }
}

.day-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

    .day-breakdown h4 {
        margin: 1rem 0 0.5rem 0;
        font-size: 1rem;
        color: var(--color-text-secondary);
    }

.day-price-row,
.option-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.day-price-type {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.day-price-row span:first-child {
    flex: 1;
}

.day-price-row span:nth-child(2) {
    flex: 0 0 auto;
    margin: 0 1rem;
}

.day-price-row span:last-child,
.option-price-row span:last-child {
    font-weight: 500;
    text-align: right;
}

@media (max-width: 767px) {
    .day-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .day-price-type {
        margin-left: 1rem;
    }
}