/* =====================================================
   RailWay Express - Main Stylesheet
   ===================================================== */

/* CSS Variables */
:root {
    --primary-dark: #0a0a0a;
    --secondary-dark: #1a1a2e;
    --accent-gold: #ffc107;
    --accent-orange: #ff9800;
    --text-light: #ffffff;
    --text-muted: #6c757d;
    --glass-bg: rgba(26, 26, 46, 0.8);
    --glass-border: rgba(255, 193, 7, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

/* Glass Navigation */
.glass-nav {
    background: rgba(10, 10, 10, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
    transition: all 0.3s ease;
}

.glass-nav.scrolled {
    padding: 10px 0;
    background: rgba(10, 10, 10, 0.95) !important;
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    position: relative;
    margin: 0 5px;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffc107' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

/* Animated Trains */
.animated-trains {
    position: absolute;
    bottom: 100px;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.train {
    position: absolute;
    font-size: 3rem;
    animation: trainMove 15s linear infinite;
    opacity: 0.3;
}

.train-1 { bottom: 0; animation-delay: 0s; }
.train-2 { bottom: 0; animation-delay: 0.2s; }
.train-3 { bottom: 0; animation-delay: 0.4s; }

@keyframes trainMove {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease forwards;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease 0.3s forwards;
    opacity: 0;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 1s ease 0.6s forwards;
    opacity: 0;
}

.animate-slide-up {
    animation: slideUp 1s ease 0.5s forwards;
    opacity: 0;
    transform: translateY(50px);
}

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

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

/* Feature Cards */
.feature-card {
    background: linear-gradient(145deg, #1a1a2e, #0a0a0a);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 40px rgba(255, 193, 7, 0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.8rem;
    color: var(--primary-dark);
}

/* Stats Section */
.stats-section {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
}

.stat-item {
    padding: 20px;
}

/* Route Cards */
.route-card {
    background: linear-gradient(145deg, #1a1a2e, #0a0a0a);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.route-card:hover {
    transform: scale(1.02);
    border-color: var(--accent-gold);
}

.route-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.route-body {
    padding: 20px;
}

.route-line {
    flex: 1;
    text-align: center;
    position: relative;
}

.route-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), transparent, var(--accent-gold));
}

/* Footer */
.footer-section {
    background: #0a0a0a;
    border-top: 1px solid var(--glass-border);
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-gold);
    padding-left: 5px;
}

.social-icons a {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-gold);
    transform: translateY(-3px);
}

/* Page Header */
.page-header {
    padding: 150px 0 80px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--primary-dark), transparent);
}

/* Form Styles */
.form-control, .form-select {
    background-color: var(--secondary-dark) !important;
    border-color: var(--glass-border) !important;
    color: var(--text-light) !important;
    padding: 12px 15px;
    border-radius: 10px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.15) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

/* Booking Card */
.booking-card {
    background: linear-gradient(145deg, #1a1a2e, #0a0a0a);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 30px;
    margin-bottom: 20px;
}

/* Train Result Card */
.train-result-card {
    background: var(--glass-bg);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.train-result-card:hover {
    border-color: var(--accent-gold);
    transform: translateX(5px);
}

.train-number {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Seat Selection */
.seat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.seat {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    font-weight: bold;
}

.seat.available {
    background: #2d4a3e;
    border: 2px solid #4caf50;
    color: #4caf50;
}

.seat.available:hover {
    background: #4caf50;
    color: white;
}

.seat.selected {
    background: var(--accent-gold);
    border: 2px solid var(--accent-gold);
    color: var(--primary-dark);
}

.seat.booked {
    background: #4a2d2d;
    border: 2px solid #f44336;
    color: #f44336;
    cursor: not-allowed;
}

.seat.aisle {
    background: transparent;
    border: none;
    cursor: default;
}

/* PNR Status Card */
.pnr-status-card {
    background: linear-gradient(145deg, #1a1a2e, #0a0a0a);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.pnr-header {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    padding: 20px 30px;
    color: var(--primary-dark);
}

.pnr-body {
    padding: 30px;
}

.status-badge {
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
}

.status-confirmed {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status-waiting {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid #ff9800;
}

.status-cancelled {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid #f44336;
}

/* Schedule Table */
.schedule-table {
    background: var(--glass-bg);
    border-radius: 15px;
    overflow: hidden;
}

.schedule-table thead {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
}

.schedule-table thead th {
    color: var(--primary-dark);
    font-weight: 600;
    padding: 15px;
    border: none;
}

.schedule-table tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-light);
}

.schedule-table tbody tr:hover {
    background: rgba(255, 193, 7, 0.05);
}

/* Login Page */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    padding: 100px 0;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    overflow: hidden;
    max-width: 900px;
    width: 100%;
}

.login-image {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-image i {
    font-size: 8rem;
    color: var(--primary-dark);
}

/* Ticket Preview */
.ticket-preview {
    background: linear-gradient(145deg, #1a1a2e, #0a0a0a);
    border-radius: 20px;
    border: 2px dashed var(--accent-gold);
    padding: 30px;
    position: relative;
}

.ticket-preview::before,
.ticket-preview::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--primary-dark);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.ticket-preview::before {
    left: -15px;
}

.ticket-preview::after {
    right: -15px;
}

.ticket-qr {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: inline-block;
}

/* Payment Section */
.payment-option {
    background: var(--secondary-dark);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-option:hover,
.payment-option.selected {
    border-color: var(--accent-gold);
    background: rgba(255, 193, 7, 0.1);
}

.payment-option input {
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 80px;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .seat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .seat {
        width: 35px;
        height: 35px;
    }
    
    .ticket-preview::before,
    .ticket-preview::after {
        display: none;
    }
}

/* Loading Animation */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Success Animation */
.success-checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Journey Line */
.journey-line {
    position: relative;
    padding: 20px 0;
}

.journey-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent-gold), var(--accent-orange));
    transform: translateX(-50%);
}

.journey-point {
    width: 20px;
    height: 20px;
    background: var(--accent-gold);
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

/* Tooltip */
.custom-tooltip {
    position: relative;
}

.custom-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gold);
    color: var(--primary-dark);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}