/* ========== GLOBAL RESET ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #111827;
    line-height: 1.5;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* ========== HEADER ========== */

header {
    width: 100%;
    height: 60px;
    background: #1f2933;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
    font-size: 20px;
    font-weight: 600;
}

#header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#auth-status {
    font-size: 13px;
    opacity: 0.85;
}


/* ========== PROFILE MENU ========== */

#profile-menu {
    position: relative;
    display: flex;
    align-items: center;
}


/* Profile button */

#profile-button {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#profile-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

#profile-name {
    font-weight: 600;
    font-size: 14px;
}


/* Dropdown container */

#profile-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border-radius: 14px;
    padding: 6px 0;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: dropdownFade 0.15s ease-out;
    backdrop-filter: blur(6px);
}


/* Dropdown buttons */

#profile-dropdown button {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: 10px 14px;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    transition: background 0.15s ease, color 0.15s ease;
}

#profile-dropdown button:hover {
    background: #eef2ff;
    color: #111827;
}


/* Icons */

#profile-dropdown button::before {
    font-weight: bold;
    font-size: 18px;
    opacity: 0.8;
}

#profile-my-bookings::before {
    content: "📄";
}

#logout-link::before {
    content: "🚪";
}


/* Animation */

@keyframes dropdownFade {
    0% {
        opacity: 0;
        transform: translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ========== LAYOUT ========== */

main {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 18px;
}


/* ========== CARD ========== */

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.card h2,
.card h3 {
    margin-bottom: 10px;
    font-weight: 600;
}


/* ========== FORM ELEMENTS ========== */

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

.form-row {
    display: flex;
    gap: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
}


/* ========== BUTTONS ========== */

button {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: #1e4ed8;
}

.secondary-btn {
    background: #e2e8f0;
    color: #111827;
}

.secondary-btn:hover {
    background: #cbd5e1;
}


/* ========== MESSAGES ========== */

.message {
    font-size: 13px;
    margin-top: 8px;
}

.message.success {
    color: #15803d;
}

.message.error {
    color: #b91c1c;
}


/* ========== FLIGHT TABLE ========== */

#flights-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

#flights-table th {
    background: #f8fafc;
    font-weight: 600;
}

#flights-table th,
#flights-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
}

#flights-table tbody tr:hover {
    background: #f1f5f9;
}


/* ========== SEAT GRID ========== */

#seat-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin: 14px 0;
}

.seat {
    border-radius: 6px;
    padding: 6px 0;
    text-align: center;
    font-size: 13px;
    border: 1px solid #d1d5db;
    cursor: pointer;
}


/* Available seats */

.seat.available {
    background: #ecfdf3;
    color: #065f46;
}


/* Selected seats */

.seat.selected {
    background: #2563eb;
    color: #ffffff;
}


/* Booked seats */

.seat.booked {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: line-through;
    cursor: not-allowed;
}


/* ========== JSON OUTPUT ========== */

.json-output {
    background: #0f172a;
    color: #e5e7eb;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    max-height: 210px;
    overflow: auto;
    white-space: pre-wrap;
}


/* ========== BOOKING MANAGEMENT ========== */

.sub-section {
    margin-top: 18px;
}

.sub-section h3 {
    margin-bottom: 6px;
}


/* ========== MOBILE RESPONSIVE ========== */

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
    #seat-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}