:root {
    --primary-color: #be1e2d;
    --primary-dark: #900014;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --font-main: 'Cairo', sans-serif;
    --border-radius: 16px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);

    /* Bus specific - Vertical Layout */
    --seat-w: 9.1%; 
    --seat-h: 2.6%; 
    --primary-bus: #2ecc71; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.profile-container {
    width: 100%;
    max-width: 480px;
    background: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Header */
.profile-header {
    background: linear-gradient(rgba(190, 30, 45, 0.7), rgba(150, 20, 35, 0.8)), url('assets/cover.jpg') center/cover;
    color: white;
    text-align: center;
    padding: 40px 20px 60px;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(190, 30, 45, 0.3);
}

.lang-switcher {
    position: absolute;
    top: 15px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

[dir="rtl"] .lang-switcher {
    left: auto;
    right: 20px;
}

.lang-switcher:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.logo-container {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    margin: 0 auto 15px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.05);
}

.profile-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.company-slogan {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

/* BOOKING SECTION STYLES */
.booking-section {
    flex: 1;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: -30px; 
}

.bus-wrapper {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease backwards;
}

.bus-map {
    position: relative;
    /* عرض 100% ليأخذ المساحة كاملة، والطول سيتحدد تلقائياً حسب أبعاد الصورة */
    width: 100%;
    border-radius: 20px; 
    overflow: hidden;
    background-color: #eee;
}

#busImage {
    width: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.seats-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.seat {
    position: absolute;
    width: var(--seat-w);
    height: var(--seat-h);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.75rem; 
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s, transform 0.3s, border-color 0.3s;
    background-color: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255,255,255,0.4);
    user-select: none; 
    transform: translate(-50%, -50%);
}

.seat:hover:not(.reserved):not(.selected) {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255,255,255,0.8);
}

.seat.selected {
    background-color: rgba(46, 204, 113, 0.9); /* Green */
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.6);
    color: white;
    transform: translate(-50%, -50%) scale(1.1);
}

.seat.reserved {
    background-color: rgba(100, 100, 100, 0.9); /* Gray */
    border-color: transparent;
    cursor: not-allowed;
    color: rgba(255,255,255,0.4);
}

.seat.reserved-female {
    background-color: rgba(100, 100, 100, 0.9); /* Gray */
    border-color: transparent;
    cursor: not-allowed;
    color: rgba(255,255,255,0.4);
    overflow: hidden;
}

.seat.reserved-female::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-top: 18px solid #ff9ff3; /* Pink */
}

/* Legend */
.legend {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
}

.legend-color.available { background-color: #eee; }
.legend-color.selected { background-color: rgba(46, 204, 113, 0.9); border-color: #2ecc71; }
.legend-color.reserved { background-color: rgba(100, 100, 100, 0.9); }


/* Booking Panel */
.booking-panel {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease backwards;
    animation-delay: 0.2s;
}

.booking-panel h2 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.selected-seats-info {
    background: #fdf2f3;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.selected-seats-info strong {
    color: var(--primary-color);
    font-size: 1.05rem;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
    font-family: var(--font-main);
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--primary-color);
}

.btn-book {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #25D366, #128C7E); /* WhatsApp Green */
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
    font-family: var(--font-main);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-book:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.btn-book:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

/* Footer from original css */
.profile-footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 0.85rem;
    color: #ffffff;
    background-color: #222222;
    margin-top: 40px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
.developer-info { margin-top: 15px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.design-by { font-size: 0.75rem; color: #cccccc; font-weight: 300; }
.developer-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: transform 0.2s; background: rgba(255, 255, 255, 0.1); padding: 5px 12px; border-radius: 20px; }
.developer-link:hover { transform: scale(1.05); background: rgba(255, 255, 255, 0.15); }
.developer-text { font-size: 0.8rem; font-weight: 600; color: #ffffff; }
.nova-logo { height: 25px; width: auto; object-fit: contain; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Login Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh; /* Fix for mobile browser bars */
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 10px 80px 10px; /* Extra bottom padding to clear keyboard/address bar */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    backdrop-filter: blur(5px);
}
.modal-overlay.hidden {
    display: none;
}
.login-modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
    animation: fadeInUp 0.4s ease;
}
.login-modal h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}
.login-toggle {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

.welcome-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: bold;
    display: none; /* Shown via JS */
}
