/* Modern Bus Scheduler Styling */
/* Shared across all pages for consistent look and feel */

/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Headers */
h1 {
    color: #2c3e50;
    border-bottom: 4px solid #3498db;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-align: center;
}

h2 {
    color: #34495e;
    margin: 30px 0 20px 0;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: "🔍";
    font-size: 0.8em;
}

h3 {
    color: #2c3e50;
    margin: 25px 0 15px 0;
    font-size: 1.4em;
}

/* Statistics cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(116, 185, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(116, 185, 255, 0.4);
}

.stat-number {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Search functionality */
.search-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
    border-left: 5px solid #3498db;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 15px;
    align-items: end;
}

.search-input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3);
}

.clear-btn {
    padding: 12px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.clear-btn:hover {
    background: #7f8c8d;
    text-decoration: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
}

tr:hover {
    background-color: #f0f8ff;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn, .button {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin: 0 10px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.btn:hover, .button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.4);
    text-decoration: none;
    color: white;
}

.btn.secondary, .button.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.3);
}

.btn.secondary:hover, .button.secondary:hover {
    box-shadow: 0 10px 25px rgba(149, 165, 166, 0.4);
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

input[type="text"], 
input[type="time"], 
input[type="number"],
select,
textarea {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus, 
input[type="time"]:focus, 
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Station lists */
.stations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.station-item {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
    transition: all 0.3s ease;
}

.station-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}

/* Clickable stations */
.clickable-station {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.clickable-station:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 184, 148, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.clickable-station:active {
    transform: translateY(-2px) scale(1.02);
}

/* Navigation */
.navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    text-align: center;
}

.nav-link {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin: 0 10px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.nav-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.4);
    text-decoration: none;
    color: white;
}

/* Info boxes */
.filter-info {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #3498db;
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 15px;
    border: 3px dashed #bdc3c7;
}

.no-data h2 {
    color: #95a5a6;
    margin-bottom: 20px;
}

/* Badges and labels */
.duration-badge {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.route-cell {
    font-weight: bold;
    color: #2c3e50;
}

.date-cell {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Tab system for index page */
.section-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Runs section styling */
.runs-section {
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.section-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.section-controls .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.runs-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    max-width: 100%;
}

.run-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr auto;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.run-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.run-field-wide {
    grid-column: span 2;
}

.run-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Terminal configuration styling */
.terminal-inputs {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.terminal-input-row {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.terminal-input-row label {
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.terminal-input-row input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.875rem;
}

.terminal-configs-list {
    margin-top: 1rem;
}

.terminal-config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.terminal-config-text {
    font-weight: 500;
    color: #495057;
}

/* Collapsible run cards */
.collapsible-card {
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.collapsible-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.run-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    border-bottom: 1px solid #dee2e6;
    transition: background 0.3s ease;
}

.run-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.run-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.run-title h4 {
    margin: 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.run-name-preview {
    color: #6c757d;
    font-size: 0.875rem;
    font-style: italic;
}

.toggle-indicator {
    font-size: 0.875rem;
    color: #495057;
    background: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-weight: 500;
}

.run-content {
    padding: 1.5rem;
    background: #ffffff;
}

/* Imported runs section styling */
.imported-runs-section {
    margin: 1rem 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
    max-width: 100%;
}

.imported-runs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    user-select: none;
}

.imported-runs-header:hover {
    background: #dee2e6;
}

.imported-runs-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.imported-runs-title h4 {
    margin: 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.runs-count {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.imported-runs-content {
    padding: 1rem;
    background: white;
    overflow-x: auto;
    max-width: 100%;
}

.imported-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    min-width: max-content;
    white-space: nowrap;
}

.imported-table th,
.imported-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid #dee2e6;
    font-size: 0.875rem;
    min-width: 80px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imported-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.imported-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.imported-table tbody tr:hover {
    background: #e9ecef;
}

/* Enhanced checkbox styling for better visibility */
.checkbox-group {
    margin: 1rem 0;
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    color: #2c3e50 !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: #3498db !important;
    cursor: pointer;
}

.checkmark {
    margin-right: 0.5rem !important;
    font-size: 1.2rem !important;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .search-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stations-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .btn, .button, .nav-link {
        padding: 12px 20px;
        margin: 5px;
    }
    
    .run-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .run-field-wide {
        grid-column: span 1;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .section-header h3 {
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .config-sections {
        gap: 1.5rem;
    }
    
    .config-section {
        padding: 1.5rem;
    }
    
    .config-section h2 {
        font-size: 1.2rem;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .bus-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .run-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .break-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .timetable-container {
        padding: 0.5rem;
    }
    
    .timetable-table th,
    .timetable-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) {
    .runs-sections-container {
        gap: 1.5rem;
    }
    
    .run-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .run-field:nth-child(3),
    .run-field:nth-child(4) {
        grid-column: span 2;
    }
    
    .run-actions {
        grid-column: span 2;
        justify-content: flex-start;
    }
}

/* Focus states for accessibility */
.search-btn:focus,
.clear-btn:focus,
.nav-link:focus,
.btn:focus,
.button:focus {
    outline: 3px solid rgba(52, 152, 219, 0.3);
    outline-offset: 2px;
}

/* Loading and interaction states */
.search-btn:active {
    transform: translateY(0px);
}

.station-item:active {
    transform: translateY(0px) scale(1);
}
