/**
 * PATH Train Display - Stylesheet
 * Version: 1.0.0
 */

/* Main Container */
.path-train-display {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.path-train-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.path-train-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #ffffff;
}

.path-train-updated {
    font-size: 0.85em;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.path-train-timestamp {
    font-weight: 600;
}

/* Content Area */
.path-train-content {
    padding: 0;
}

/* Table Styles */
.path-train-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.path-train-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.path-train-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.path-train-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.path-train-table tbody tr:hover {
    background-color: #f8fafc;
}

.path-train-table tbody tr:last-child {
    border-bottom: none;
}

.path-train-table td {
    padding: 15px;
    font-size: 0.95em;
    color: #334155;
}

/* Line Indicator */
.path-train-line {
    width: 40px;
    text-align: center;
}

.path-train-line-indicator {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Headsign */
.path-train-headsign {
    font-weight: 600;
    color: #1e293b;
    min-width: 150px;
}

/* Route */
.path-train-route {
    font-size: 0.85em;
    color: #64748b;
    min-width: 200px;
}

/* Direction */
.path-train-direction {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

.path-train-direction.direction-to_ny {
    color: #2563eb;
}

.path-train-direction.direction-to_nj {
    color: #dc2626;
}

/* Arrival Time */
.path-train-arrival {
    font-weight: 600;
    font-size: 1.1em;
    color: #0f172a;
    min-width: 80px;
}

/* Status */
.path-train-status {
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-on_time .path-train-status {
    color: #16a34a;
}

.status-delayed .path-train-status {
    color: #dc2626;
}

/* No Data Message */
.path-train-no-data {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-size: 1em;
    margin: 0;
}

/* Error Message */
.path-train-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 15px 20px;
    color: #991b1b;
    margin: 20px 0;
    font-size: 0.95em;
}

/* Loading State */
.path-train-display.loading {
    opacity: 0.6;
    pointer-events: none;
}

.path-train-display.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: path-train-spin 0.8s linear infinite;
}

@keyframes path-train-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .path-train-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .path-train-title {
        font-size: 1.2em;
    }
    
    .path-train-table {
        font-size: 0.9em;
    }
    
    .path-train-table th,
    .path-train-table td {
        padding: 10px 8px;
    }
    
    .path-train-route {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .path-train-table {
        font-size: 0.85em;
    }
    
    .path-train-table th,
    .path-train-table td {
        padding: 8px 5px;
    }
    
    .path-train-line-indicator {
        width: 20px;
        height: 20px;
    }
    
    .path-train-direction {
        display: none;
    }
}

/* Widget Specific Styles */
.widget .path-train-display {
    margin: 0;
}

.widget .path-train-title {
    font-size: 1.2em;
}

.widget .path-train-table {
    font-size: 0.85em;
}

.widget .path-train-route {
    display: none;
}

/* Print Styles */
@media print {
    .path-train-display {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .path-train-header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .path-train-table tbody tr:hover {
        background-color: transparent;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .path-train-display {
        background: #1e293b;
        border-color: #334155;
    }
    
    .path-train-table thead {
        background: #0f172a;
    }
    
    .path-train-table th {
        color: #cbd5e1;
    }
    
    .path-train-table tbody tr {
        border-bottom-color: #334155;
    }
    
    .path-train-table tbody tr:hover {
        background-color: #334155;
    }
    
    .path-train-table td {
        color: #e2e8f0;
    }
    
    .path-train-headsign {
        color: #f1f5f9;
    }
    
    .path-train-route {
        color: #94a3b8;
    }
    
    .path-train-arrival {
        color: #f8fafc;
    }
    
    .path-train-no-data {
        color: #94a3b8;
    }
}

/* Accessibility */
.path-train-table th:focus,
.path-train-table td:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* Animation for new data */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.path-train-row {
    animation: fadeIn 0.3s ease-out;
}