/*
 * Account Area CSS - Redesigned for visual consistency with style.css
 * ====================================================================
 * This file has been refactored to use the main site's design language,
 * ensuring a seamless user experience between the landing page and the account area.
 * Changes include:
 * - Full adoption of the CSS variables from style.css.
 * - Unified typography (Heebo, Playfair Display).
 * - Redesigned buttons, forms, and cards to match the luxury theme.
 * - Kept the layout functional while enhancing the aesthetics.
*/

/* This is a conceptual import. In reality, you just use the same variables. */

:root {
    /* Copied from style.css for clarity, assuming it's globally available */
    --primary-gold: #C9A961;
    --secondary-gold: #B8941F;
    --dark-gold: #996F1A;
    --accent-gold: #E6CC7A;
    --text-primary: #2C2C2C;
    --text-secondary: #5A5A5A;
    --text-light: #8B8B8B;
    --background-cream: #FBF8F2;
    --white-soft: #FEFEFE;
    --shadow-light: rgba(201, 169, 97, 0.15);
    --shadow-medium: rgba(201, 169, 97, 0.25);
    --shadow-dark: rgba(60, 60, 60, 0.15);
    --shadow-warm: rgba(184, 148, 31, 0.2);
    --gradient-gold: linear-gradient(135deg, #C9A961 0%, #B8941F 50%, #996F1A 100%);
    --gradient-cream: linear-gradient(135deg, #FBF8F2 0%, #F7F1E8 100%);
    --gradient-elegant: linear-gradient(135deg, #FEFEFE 0%, #F7F1E8 100%);
}

body {
    font-family: 'Heebo', 'Assistant', sans-serif;
    direction: rtl;
    margin: 0;
    padding: 20px;
    background: var(--gradient-cream);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Language direction support - Complete LTR/RTL layout changes */
body[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Text alignment for all text elements */
[dir="ltr"] .form-input,
[dir="ltr"] input,
[dir="ltr"] textarea,
[dir="ltr"] select,
[dir="ltr"] p,
[dir="ltr"] span,
[dir="ltr"] div,
[dir="ltr"] label,
[dir="ltr"] button {
    text-align: left;
}

[dir="rtl"] .form-input,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] div,
[dir="rtl"] label,
[dir="rtl"] button {
    text-align: right;
}

/* Flexbox direction adjustments */
[dir="ltr"] .header,
[dir="ltr"] .nav-links {
    flex-direction: row;
}

[dir="rtl"] .header,
[dir="rtl"] .nav-links {
    flex-direction: row;
}

/* Info item flex direction - reverse in LTR so value is on right */
[dir="ltr"] .info-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .info-item {
    flex-direction: row;
}

/* Table alignment */
[dir="ltr"] table,
[dir="ltr"] th,
[dir="ltr"] td {
    text-align: left;
}

[dir="rtl"] table,
[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

/* List alignment */
[dir="ltr"] ul,
[dir="ltr"] ol {
    padding-left: 20px;
    padding-right: 0;
}

[dir="rtl"] ul,
[dir="rtl"] ol {
    padding-right: 20px;
    padding-left: 0;
}

/* Center-aligned elements should stay centered */
[dir="ltr"] .welcome-message,
[dir="ltr"] .sub-nav-menu .nav-link,
[dir="ltr"] .nav-link {
    text-align: center;
}

[dir="rtl"] .welcome-message,
[dir="rtl"] .sub-nav-menu .nav-link,
[dir="rtl"] .nav-link {
    text-align: center;
}

/* Headers should align based on direction */
[dir="ltr"] .header h1,
[dir="ltr"] .welcome-back h2 {
    text-align: left;
}

[dir="rtl"] .header h1,
[dir="rtl"] .welcome-back h2 {
    text-align: right;
}

/* Info item labels and values alignment */
[dir="ltr"] .info-item .label,
[dir="ltr"] .info-item .label span,
[dir="ltr"] .summary-label,
[dir="ltr"] .summary-label span {
    text-align: left !important;
}

[dir="ltr"] .info-item .value,
[dir="ltr"] .info-item .value span,
[dir="ltr"] .summary-value,
[dir="ltr"] .summary-value span {
    text-align: right !important;
}

[dir="rtl"] .info-item .label,
[dir="rtl"] .info-item .label span,
[dir="rtl"] .summary-label,
[dir="rtl"] .summary-label span {
    text-align: right !important;
}

[dir="rtl"] .info-item .value,
[dir="rtl"] .info-item .value span,
[dir="rtl"] .summary-value,
[dir="rtl"] .summary-value span {
    text-align: left !important;
}

/* Float utilities for directional floating */
[dir="ltr"] .float-end {
    float: right !important;
}

[dir="ltr"] .float-start {
    float: left !important;
}

[dir="rtl"] .float-end {
    float: left !important;
}

[dir="rtl"] .float-start {
    float: right !important;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    background: var(--white-soft);
    border-radius: 20px;
    box-shadow: 0 25px 70px var(--shadow-light), 0 10px 30px var(--shadow-dark);
    overflow: hidden;
    border: 1px solid var(--accent-gold);
}

.header {
    background: var(--gradient-gold);
    color: var(--white-soft);
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    border-radius: 20px 20px 0 0;
}

/* Fix header direction for LTR */
[dir="ltr"] .header {
    flex-direction: row-reverse;
}

[dir="rtl"] .header {
    flex-direction: row;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: shimmer 20s linear infinite;
}

@keyframes shimmer {
    from {
        transform: translateX(0) translateY(0);
    }

    to {
        transform: translateX(100px) translateY(100px);
    }
}

.header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
    position: relative;
}

/* Fix h1 text direction */
[dir="ltr"] .header h1 {
    direction: ltr;
}

[dir="rtl"] .header h1 {
    direction: rtl;
}

.nav-links {
    display: flex;
    gap: 15px;
    position: relative;
}

/* --- UNIFIED BUTTON STYLES --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn.btn-primary {
    background: var(--gradient-gold);
    color: var(--white-soft);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.btn.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 40px var(--shadow-warm);
}

.btn.btn-secondary {
    background: transparent;
    color: var(--white-soft);
    border-color: var(--white-soft);
}

.btn.btn-secondary:hover {
    background: var(--white-soft);
    color: var(--primary-gold);
    transform: translateY(-2px);
}

/* --- UNIFIED FORM STYLES --- */
.login-section {
    padding: 50px 40px;
    background: var(--gradient-elegant);
}

.welcome-message {
    text-align: center;
    margin-bottom: 50px;
}

.welcome-message h2 {
    color: var(--primary-gold);
    font-size: 2.2rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 20px;
}

.welcome-message p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.login-form {
    max-width: 450px;
    margin: 0 auto;
    background: var(--white-soft);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 70px var(--shadow-light), 0 10px 30px var(--shadow-dark);
    border: 1px solid var(--accent-gold);
}

.login-form h3 {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--dark-gold);
    margin-bottom: 25px;
}

.form-input {
    width: 100%;
    padding: 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    /* text-align removed - handled by dir attribute */
    background: var(--white-soft);
    color: var(--text-primary);
    box-shadow: inset 0 2px 10px rgba(44, 44, 44, 0.1), 0 5px 20px rgba(44, 44, 44, 0.1);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    margin: 15px 0;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    box-shadow: inset 0 2px 10px rgba(44, 44, 44, 0.1), 0 0 0 4px rgba(201, 169, 97, 0.3);
    border-color: var(--accent-gold);
}

.register-link,
.admin-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.register-link a {
    color: var(--primary-gold);
    font-weight: 600;
    text-decoration: none;
}

.admin-link a {
    color: var(--text-light);
    text-decoration: none;
}

/* --- DASHBOARD & CARDS --- */
.dashboard {
    padding: 50px 40px;
    background: var(--gradient-elegant);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

.welcome-back h2 {
    color: var(--primary-gold);
    font-size: 2.2rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 50px;
}

/* Fix welcome-back h2 text direction */
[dir="ltr"] .welcome-back h2 {
    direction: ltr;
}

[dir="rtl"] .welcome-back h2 {
    direction: rtl;
}

.account-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.info-card,
.settings-card,
.contact-info {
    background: var(--white-soft);
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 25px 70px var(--shadow-light), 0 10px 30px var(--shadow-dark);
    border: 1px solid var(--accent-gold);
    transition: all 0.4s ease;
}

.info-card:hover,
.settings-card:hover,
.contact-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 90px var(--shadow-medium), 0 15px 40px var(--shadow-dark);
}

.info-card h3,
.settings-card h3,
.contact-info h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-gold);
    font-size: 1.6rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--accent-gold);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.info-item:last-child {
    border: none;
}

.label {
    font-weight: 600;
    color: var(--text-secondary);
}

.value {
    font-weight: 500;
}

.status-confirmed {
    color: #28a745;
    font-weight: bold;
}

.status-pending {
    color: #ffc107;
    font-weight: bold;
}

.settings-form select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    background: var(--white-soft);
    transition: all 0.3s ease;
}

.settings-form select:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.2);
}

/* --- MESSAGES & NOTIFICATIONS --- */
.status-message {
    margin-bottom: 50px;
}

.success-message,
.pending-message {
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    border-style: solid;
    border-width: 1px;
}

.success-message {
    background: #e8f5e8;
    color: #388e3c;
    border-color: #388e3c;
}

.pending-message {
    background: #fff8e1;
    color: #ffa000;
    border-color: #ffa000;
}

.success-message h3,
.pending-message h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.success,
.error {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    font-weight: 600;
    text-align: center;
    border-style: solid;
    border-width: 1px;
}

.success {
    background: #e8f5e8;
    color: #388e3c;
    border-color: #388e3c;
}

.error {
    background: #fbe9e7;
    color: #d9534f;
    border-color: #d9534f;
}

/* --- SUB-NAVIGATION BAR --- */
.sub-nav-bar {
    background: linear-gradient(135deg, rgba(254, 254, 254, 0.98) 0%, rgba(247, 241, 232, 0.98) 100%);
    border-bottom: 3px solid #C9A961;
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: -40px -40px 30px -40px;
    padding: 0 40px;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    will-change: transform;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-toggle {
    display: none;
    width: 100%;
    background: var(--gradient-gold);
    color: var(--white-soft);
    border: none;
    padding: 18px 25px;
    font-size: 17px;
    font-weight: 700;
    font-family: 'Heebo', sans-serif;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    outline: none;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #996F1A;
    outline-offset: -2px;
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.3);
}

.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mobile-menu-toggle:hover::before {
    left: 100%;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #B8941F, #996F1A);
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(184, 148, 31, 0.4);
}

.sub-nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0;
    flex-wrap: nowrap;
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Show scrollbar for better UX */
.sub-nav-menu::-webkit-scrollbar {
    height: 4px;
}

.sub-nav-menu::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 2px;
}

.sub-nav-menu::-webkit-scrollbar-track {
    background: rgba(201, 169, 97, 0.1);
}

.sub-nav-menu .nav-link {
    flex: 0 0 auto;
    padding: 16px 24px;
    color: #2C2C2C;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Heebo', sans-serif;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    background: transparent;
    outline: none;
}

.sub-nav-menu .nav-link:focus {
    outline: none;
}

.sub-nav-menu .nav-link:hover {
    color: #C9A961;
    border-bottom-color: #C9A961;
    background: rgba(201, 169, 97, 0.05);
}

.sub-nav-menu .nav-link.active {
    color: #C9A961;
    border-bottom-color: #C9A961;
    font-weight: 700;
    background: rgba(201, 169, 97, 0.08);
}

/* Quick Link Cards (for home page) */
.quick-link-card {
    display: block;
    background: var(--white-soft);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px var(--shadow-light);
    border: 2px solid transparent;
}

.quick-link-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 50px var(--shadow-medium);
    border-color: var(--accent-gold);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--background-cream);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: var(--accent-gold);
    transform: translateX(-5px);
}

.summary-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Desktop - ensure mobile button is hidden */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .sub-nav-menu {
        display: flex !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .account-info {
        grid-template-columns: 1fr;
    }

    .login-section,
    .dashboard {
        padding: 30px 20px;
    }

    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: block;
        border-radius: 20px 20px 0 0;
    }

    .sub-nav-bar {
        position: relative;
        top: 0;
        border-radius: 20px;
        margin: 0 -20px 20px -20px;
        padding: 0 20px;
    }

    .sub-nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 0;
        background: linear-gradient(180deg, #FBF8F2 0%, #F7F1E8 100%);
    }

    .sub-nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .sub-nav-menu .nav-link {
        width: 100%;
        border-bottom: 1px solid rgba(201, 169, 97, 0.2);
        border-right: none;
        border-radius: 0;
        padding: 18px 25px;
        justify-content: flex-start;
        flex-direction: row;
        gap: 12px;
        font-size: 16px;
    }

    .sub-nav-menu .nav-link:hover {
        transform: translateX(5px);
        background: linear-gradient(90deg,
            rgba(201, 169, 97, 0.1) 0%,
            transparent 100%
        );
    }

    .sub-nav-menu .nav-link.active {
        border-left: 4px solid var(--primary-gold);
    }

    .sub-nav-menu .nav-link:last-child {
        border-bottom: none;
        border-radius: 0 0 18px 18px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .quick-link-card {
        padding: 20px;
    }
}