/**
 * My Account / Client Portal Styles
 * Uses site-wide CSS variables and design system
 */

/* ============ LOGIN PAGE ============ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10) var(--space-4);
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-10);
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-logo img {
    width: 80px;
    height: 80px;
}

.login-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-medium);
    text-align: center;
    margin-bottom: var(--space-2);
}

.login-subtitle {
    color: var(--color-text-muted);
    text-align: center;
    font-size: var(--text-sm);
    margin-bottom: var(--space-8);
}

.login-footer {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.login-footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
    display: none;
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard-page {
    display: none;
}

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

/* Dashboard Topbar */
.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-6);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-sm);
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 70vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    padding: var(--space-6) 0;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: var(--color-text-light);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--color-background-alt);
    color: var(--color-text);
}

.nav-item.active {
    background: var(--color-background-alt);
    color: var(--color-primary);
    border-right: 3px solid var(--color-primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    padding: var(--space-8);
    background: var(--color-background-alt);
    overflow-y: auto;
}

.content-section {
    display: none;
}

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

.section-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-6);
}

/* Cards */
.card {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
}

.welcome-card {
    grid-column: 1 / -1;
}

.welcome-text {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
}

.booking-highlight {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-4);
    margin-top: var(--space-4);
}

.booking-service {
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
}

.booking-date {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

/* Booking List */
.booking-tabs {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.booking-tab {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.booking-tab:hover {
    color: var(--color-text);
}

.booking-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.booking-card {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-background-alt);
}

.booking-card-header h4 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin: 0;
}

.booking-card-body {
    padding: var(--space-5);
}

.booking-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.booking-detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.booking-detail-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.booking-detail-value {
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
}

.booking-card-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-light);
}

.booking-card-actions .btn {
    flex: 1;
    min-width: 120px;
}

.booking-info h4 {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.booking-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.booking-status {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.status-confirmed {
    background: #D1FAE5;
    color: #065F46;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-completed {
    background: var(--color-background-alt);
    color: var(--color-text-muted);
}

.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

/* Profile Form */
.profile-section {
    max-width: 500px;
}

.form-row {
    margin-bottom: var(--space-5);
}

.form-input:disabled {
    background: var(--color-background-alt);
    cursor: not-allowed;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.form-success {
    background: #D1FAE5;
    border: 1px solid #A7F3D0;
    color: #065F46;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
    display: none;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2) 0;
    z-index: var(--z-fixed);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--text-xs);
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-item.active {
    color: var(--color-primary);
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    color: var(--color-text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-10);
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-md);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-text-muted);
}

.modal-body {
    padding: var(--space-6);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-label {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.detail-value {
    font-weight: var(--font-medium);
    text-align: right;
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
}

.modal-footer .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* Side Panel */
.side-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.side-panel-backdrop.open {
    display: block;
    opacity: 1;
}

.side-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 460px;
    max-width: 90vw;
    height: 100%;
    background: var(--color-white);
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.side-panel.open {
    right: 0;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
}

.side-panel-header h3 {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    margin: 0;
}

.side-panel-body {
    padding: var(--space-6);
}

.side-panel-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-background);
}

/* Info Box */
.info-box {
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
}

.info-box.warning {
    background: #fff8e6;
    border-color: #f5d87f;
}

.info-box.error {
    background: #fff0f0;
    border-color: #f5c6c6;
}

.info-box ul {
    margin: var(--space-2) 0 0 var(--space-4);
    padding: 0;
}

.info-box li {
    margin-bottom: var(--space-1);
}

/* Form in side panel */
.panel-form-group {
    margin-bottom: var(--space-5);
}

.panel-form-group label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.panel-form-group select,
.panel-form-group input,
.panel-form-group textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
}

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

/* Booking summary in panel */
.booking-summary {
    background: var(--color-background-alt);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}

.booking-summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
}

.booking-summary-row:not(:last-child) {
    border-bottom: 1px solid var(--color-border-light);
}

.booking-summary-label {
    color: var(--color-text-muted);
}

.booking-summary-value {
    font-weight: var(--font-medium);
}

/* ============ FORM ELEMENTS ============ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: border-color var(--transition-fast);
}

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

/* Phone Input with Country Selector */
.phone-input-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.phone-country-select {
    flex-shrink: 0;
    width: 90px;
    padding: var(--space-3) 0.5rem;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--color-background-alt);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23717171' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}

.phone-country-select:focus {
    outline: none;
    border-color: var(--color-primary);
    z-index: 1;
}

.phone-input-wrapper .phone-number-input {
    flex: 1;
    min-width: 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast);
}

.phone-input-wrapper .phone-number-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ============ BUTTONS ============ */
/* Base .btn, .btn-primary, .btn-outline inherited from style.min.css */

/* Dashboard-specific: disabled outline buttons */
.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline:disabled:hover {
    background: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: none;
}

/* Login page: full-width button */
.login-card .btn {
    width: 100%;
}

/* Dashboard action buttons: compact sizing */
.booking-card-actions .btn {
    padding: 10px 20px;
    font-size: var(--text-xs);
}

/* Side panel footer buttons */
.side-panel-footer .btn {
    padding: 12px 24px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .dashboard-main {
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + 70px);
    }

    .dashboard-topbar {
        padding: var(--space-3) var(--space-4);
    }

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

    .booking-details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .booking-card-actions {
        flex-direction: column;
    }

    .booking-card-actions .btn {
        width: 100%;
    }
}
