/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F5F5F5; /* Changed */
    color: #424242; /* Changed */
    min-height: 100vh;
}

.app-container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    border-radius: 8px;
    transition: background 0.2s ease;
    text-decoration: none;
}

.back-btn:hover {
    background: #f8f9fa;
}

.page-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #424242; /* Changed */
}

.header-spacer {
    width: 40px;
}

.home-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6E6E6E; /* Changed */
    font-size: 18px;
    border-radius: 8px;
    transition: background 0.2s ease;
    text-decoration: none;
}

.home-btn:hover {
    background: #f8f9fa;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

/* Input Section */
.input-section {
    margin-bottom: 30px;
}

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

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #6E6E6E; /* Changed */
    font-size: 14px;
}

.input-container {
    position: relative;
}

.station-input {
    width: 100%;
    padding: 16px;
    border: 1px solid #BDBDBD; /* Changed */
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.station-input:focus {
    outline: none;
    border-color: #0052A4; /* Changed */
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #BDBDBD; /* Changed */
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s ease;
    font-size: 14px;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.search-btn {
    width: 100%;
    background: #0052A4; /* Changed */
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.search-btn:hover {
    background: #003B7A; /* Darker shade of main color */
}

.search-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Route Guidance */
.route-guidance {
    animation: fadeInUp 0.5s ease-out;
    /* height: 100vh; */ /* Removed to fit content */
    display: block; /* Changed from flex */
    background: white;
}

/* Route Progress Bar */
.route-progress {
    padding: 40px 20px 20px;
    background: white;
}

.progress-line {
    position: relative;
    height: 6px; /* Changed */
    background: #0052A4; /* Changed */
    border-radius: 4px; /* Changed */
    margin-bottom: 20px;
}

.station-marker, .transfer-marker {
    position: absolute;
    top: -21px; /* Changed */
    width: 50px; /* Changed */
    height: 50px; /* Changed */
    background: #0052A4; /* Changed */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.station-marker.start {
    left: 0;
}

.transfer-marker {
    left: 50%;
    transform: translateX(-50%);
    background: #2E9AFE; /* Changed */
}

.station-marker.end {
    right: 0;
}

.station-name {
    color: white;
    font-size: 12px; /* Changed */
    font-weight: 600;
    text-align: center;
    line-height: 1;
}

.train-icon {
    position: absolute;
    top: -16px;
    width: 40px;
    height: 40px;
    background: #DE314C; /* Changed */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: left 0.5s ease;
    transform: translateX(-50%);
}

.train-icon i {
    color: white;
    font-size: 18px;
}

.time-segments {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.time-segment {
    flex: 1;
    text-align: center;
}

.time-label {
    font-size: 12px;
    color: #6E6E6E; /* Changed */
    font-weight: 500;
}

/* Main Instruction */
.instruction-section {
    /* flex: 1; */ /* Removed */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px; /* Reduced padding */
    position: relative;
}

.nav-btn {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #0052A4; /* Changed */
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

.nav-btn:hover {
    background: #003B7A; /* Darker shade */
    transform: scale(1.05);
}

.prev-btn {
    background: #BDBDBD; /* Changed */
}

.prev-btn:hover {
    background: #9E9E9E; /* Darker grey */
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.instruction-content {
    text-align: center;
    max-width: 300px;
}

.instruction-icon {
    font-size: 48px;
    color: #0052A4; /* Changed */
    margin-bottom: 20px;
}

.instruction-text {
    color: #424242; /* Changed */
    font-size: 22px; /* Slightly smaller font */
    font-weight: 600;
    line-height: 1.4;
}

.instruction-text .highlight {
    color: #0052A4; /* Changed */
    font-weight: 700;
}

.instruction-line {
    margin-bottom: 8px;
}

.instruction-line:last-child {
    margin-bottom: 0;
}

/* Bottom Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.action-btn {
    flex: 1;
    background: white;
    border: 1px solid #BDBDBD; /* Changed */
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 80px;
    justify-content: center;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #0052A4; /* Changed */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-btn i {
    font-size: 20px;
    color: #6E6E6E; /* Changed */
}

.action-btn:nth-child(1) i {
    color: #6E6E6E; /* Changed */
}

.action-btn:nth-child(2) i {
    color: #2E9AFE; /* Changed */
}

.action-btn:nth-child(3) i {
    color: #DE314C; /* Changed */
}

.action-btn span {
    font-size: 12px;
    color: #6E6E6E; /* Changed */
    font-weight: 500;
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #424242; /* Changed */
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6E6E6E; /* Changed */
    padding: 4px;
    border-radius: 4px;
}

.close-btn:hover {
    background: #f8f9fa;
}

.modal-body {
    padding: 20px;
}

.facility-stations {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.station-btn {
    background: #f8f9fa;
    border: 1px solid #BDBDBD; /* Changed */
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.station-btn.active {
    background: #0052A4; /* Changed */
    color: white;
    border-color: #0052A4; /* Changed */
}

.station-btn:hover {
    background: #e9ecef;
}

.station-btn.active:hover {
    background: #003B7A; /* Darker shade */
}

.facility-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #424242; /* Changed */
}

.facility-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.facility-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
}

.facility-item i {
    color: #2E9AFE; /* Changed */
    width: 16px;
    text-align: center;
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }

    .story-card {
        padding: 20px;
    }

    .card-actions {
        flex-direction: column;
    }

    .card-bottom {
        flex-direction: column;
    }

    .action-btn {
        flex: none;
    }

    .station-line {
        flex-direction: column;
        gap: 12px;
    }

    .line-segment {
        flex-direction: row;
        margin: 0;
    }

    .line {
        width: 40px;
        height: 2px;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Line Color Classes (from station.css) */
.line-2 {
    background: #00a651 !important;
}

.line-bundang {
    background: #f5a200 !important;
}

.line-1 {
    background: #003499 !important;
}

.line-3 {
    background: #ff6600 !important;
}

.line-4 {
    background: #00a2d1 !important;
}

.line-5 {
    background: #996cac !important;
}

.line-6 {
    background: #cd7c2f !important;
}

.line-7 {
    background: #747f00 !important;
}

.line-8 {
    background: #e6186c !important;
}

.line-9 {
    background: #b7c452 !important;
}
