/**
 * RailNest Custom Styles - Bootstrap 5 Based
 */

/* Color Variables */
:root {
    --railnest-primary: #1a56db;
    --railnest-primary-dark: #1e429f;
    --railnest-secondary: #f97316;
    --railnest-success: #16a34a;
    --railnest-danger: #dc2626;
    --railnest-warning: #f59e0b;
    --railnest-light: #f3f4f6;
    --railnest-dark: #1f2937;
    --railnest-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --railnest-radius: 8px;
}

/* Container */
.railnest-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Home Page */
.railnest-home-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Hero Section */
.railnest-hero {
    background: linear-gradient(135deg, var(--railnest-primary), var(--railnest-primary-dark));
    color: #fff;
    padding: 80px 40px;
    text-align: center;
    border-radius: var(--railnest-radius);
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.railnest-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,165.3C384,171,480,149,576,128C672,107,768,85,864,90.7C960,96,1056,128,1152,133.3C1248,139,1344,117,1392,106.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin: 0;
}

/* Services Grid */
.railnest-services {
    margin-bottom: 60px;
    padding: 0 20px;
}

.service-card {
    background: #fff;
    border-radius: var(--railnest-radius);
    padding: 30px 25px;
    text-align: center;
    box-shadow: var(--railnest-shadow);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--railnest-dark);
    margin-bottom: 12px;
}

.service-card p {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.service-card .btn {
    margin-top: auto;
}

/* Features Section */
.railnest-features {
    background: var(--railnest-light);
    border-radius: var(--railnest-radius);
    padding: 50px 40px;
    margin-bottom: 60px;
}

.feature-box {
    padding: 20px;
}

.feature-icon {
    font-size: 3rem;
    color: var(--railnest-primary);
    margin-bottom: 15px;
}

.feature-box h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--railnest-dark);
    margin-bottom: 10px;
}

.feature-box p {
    color: #6b7280;
    margin: 0;
}

/* Service Sections */
.service-section {
    margin-bottom: 50px;
    scroll-margin-top: 20px;
}

/* Header */
.railnest-header {
    text-align: center;
    margin-bottom: 30px;
}

.railnest-header h2 {
    color: var(--railnest-primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.railnest-header p {
    color: #6b7280;
    font-size: 1rem;
}

/* Cards */
.railnest-card {
    background: #fff;
    border-radius: var(--railnest-radius);
    padding: 25px;
    box-shadow: var(--railnest-shadow);
    border: 1px solid #e5e7eb;
}

.railnest-card .form-label {
    font-weight: 600;
    color: var(--railnest-dark);
    margin-bottom: 8px;
}

.railnest-card .form-control,
.railnest-card .form-select {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 10px 14px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.railnest-card .form-control:focus,
.railnest-card .form-select:focus {
    border-color: var(--railnest-primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

/* Buttons */
.railnest-card .btn {
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.2s;
}

.railnest-card .btn-primary {
    background: var(--railnest-primary);
    border-color: var(--railnest-primary);
}

.railnest-card .btn-primary:hover {
    background: var(--railnest-primary-dark);
    border-color: var(--railnest-primary-dark);
    transform: translateY(-1px);
}

.railnest-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Result Section */
.railnest-result {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
}

/* Train Info Card */
.train-info-card {
    background: #fff;
    border-radius: var(--railnest-radius);
    overflow: hidden;
    box-shadow: var(--railnest-shadow);
    margin-bottom: 20px;
}

.train-header {
    background: linear-gradient(135deg, var(--railnest-primary), var(--railnest-primary-dark));
    color: #fff;
    padding: 20px;
}

.train-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.train-header .train-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    display: inline-block;
    margin-top: 8px;
}

.train-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f9fafb;
}

.route-station {
    text-align: center;
}

.route-station .station-code {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--railnest-primary);
}

.route-station .station-name {
    font-size: 0.875rem;
    color: #6b7280;
}

.route-arrow {
    color: var(--railnest-secondary);
    font-size: 1.5rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-limited {
    background: #fef3c7;
    color: #92400e;
}

.status-waitlisted {
    background: #fee2e2;
    color: #991b1b;
}

.status-completed {
    background: #d1d5db;
    color: #374151;
}

.status-current {
    background: #dbeafe;
    color: #1e40af;
}

.status-upcoming {
    background: #f3f4f6;
    color: #4b5563;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -26px;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #d1d5db;
}

.timeline-item.completed .timeline-marker {
    border-color: var(--railnest-success);
    background: var(--railnest-success);
}

.timeline-item.current .timeline-marker {
    border-color: var(--railnest-primary);
    background: var(--railnest-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(26, 86, 219, 0);
    }
}

.timeline-content {
    background: #f9fafb;
    padding: 15px;
    border-radius: var(--railnest-radius);
}

.timeline-content h4 {
    margin: 0 0 8px 0;
    color: var(--railnest-dark);
}

.timeline-time {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Passenger Table */
.passenger-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.passenger-table th,
.passenger-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.passenger-table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--railnest-dark);
}

.passenger-table tr:hover {
    background: #f9fafb;
}

/* Station Info */
.station-info-card {
    background: #fff;
    border-radius: var(--railnest-radius);
    padding: 25px;
    box-shadow: var(--railnest-shadow);
}

.station-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--railnest-primary);
    margin-bottom: 5px;
}

.station-code-badge {
    display: inline-block;
    background: var(--railnest-primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Fare Table */
.fare-table {
    width: 100%;
    margin-top: 15px;
}

.fare-table th,
.fare-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.fare-table th {
    background: var(--railnest-primary);
    color: #fff;
}

.fare-table tr:nth-child(even) {
    background: #f9fafb;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--railnest-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error/Success Messages */
.alert {
    padding: 15px 20px;
    border-radius: var(--railnest-radius);
    margin-bottom: 15px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Train Card (Search Results) */
.train-card {
    background: #fff;
    border-radius: var(--railnest-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--railnest-shadow);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.train-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.train-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.train-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--railnest-dark);
}

.train-number-badge {
    background: var(--railnest-light);
    color: var(--railnest-dark);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.train-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.time-box {
    text-align: center;
}

.time-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--railnest-dark);
}

.time-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.time-arrow {
    color: var(--railnest-secondary);
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .railnest-container {
        padding: 15px;
    }

    .railnest-card {
        padding: 20px;
    }

    .train-route {
        flex-direction: column;
        gap: 15px;
    }

    .route-arrow {
        transform: rotate(90deg);
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline-marker {
        left: -16px;
    }

    .train-card-header {
        flex-direction: column;
        gap: 10px;
    }
}