/* Line Movement Modal Styles */
.line-movement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.line-movement-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.line-movement-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.line-movement-modal .modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.line-movement-modal .modal-title-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.line-movement-modal .current-line-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.line-movement-modal .current-line-badge {
    background: #f0f9ff;
    color: #0369a1;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e0f2fe;
}

.line-movement-modal .modal-close-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.line-movement-modal .modal-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Modal Body */
.line-movement-modal .modal-body {
    padding: 1rem 1.5rem;
    flex: 1;
    overflow-y: auto;
}

/* Loading State */
.line-movement-modal .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.line-movement-modal .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.line-movement-modal .loading-state p {
    color: #6b7280;
    margin: 0;
}

/* Error State */
.line-movement-modal .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.line-movement-modal .error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.line-movement-modal .error-state p {
    color: #dc2626;
    margin: 0 0 1rem 0;
    font-weight: 500;
}

/* No Movement State */
.line-movement-modal .no-movement-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.line-movement-modal .no-movement-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.line-movement-modal .no-movement-state h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1.125rem;
    font-weight: 600;
}

.line-movement-modal .no-movement-state p {
    color: #6b7280;
    margin: 0 0 1.5rem 0;
}

.line-movement-modal .opening-line-info {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 300px;
}

.line-movement-modal .info-label {
    font-weight: 500;
    color: #374151;
}

.line-movement-modal .line-value {
    font-weight: 600;
    color: #111827;
}

/* Movement Timeline */
.line-movement-modal .timeline-header {
    margin-bottom: 1.5rem;
}

.line-movement-modal .timeline-header h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.line-movement-modal .movement-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.line-movement-modal .summary-badge {
    background: #f3f4f6;
    color: #374151;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.line-movement-modal .summary-badge.significant {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.line-movement-modal .summary-badge.up {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.line-movement-modal .summary-badge.down {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Timeline Container */
.line-movement-modal .timeline-container {
    position: relative;
    padding-left: 2rem;
}

.line-movement-modal .timeline-container::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.line-movement-modal .timeline-item {
    position: relative;
    padding: 1rem 0;
    margin-left: 1rem;
}

.line-movement-modal .timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5e7eb;
    z-index: 1;
}

.line-movement-modal .timeline-item.current::before {
    border-color: #3b82f6;
    background: #3b82f6;
}

.line-movement-modal .timeline-item.significant::before {
    border-color: #f59e0b;
    background: #f59e0b;
}

.line-movement-modal .timeline-item.opening::before {
    border-color: #6b7280;
    background: #6b7280;
}

.line-movement-modal .timeline-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.line-movement-modal .timeline-time {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.line-movement-modal .timeline-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.line-movement-modal .line-display {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.line-movement-modal .timeline-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.line-movement-modal .change-badge {
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.line-movement-modal .change-badge.up {
    background: #dcfce7;
    color: #16a34a;
}

.line-movement-modal .change-badge.down {
    background: #fee2e2;
    color: #dc2626;
}

.line-movement-modal .change-badge.current {
    background: #dbeafe;
    color: #2563eb;
}

.line-movement-modal .change-badge.opening {
    background: #f3f4f6;
    color: #6b7280;
}

/* Modal Footer */
.line-movement-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.line-movement-modal .modal-footer-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.line-movement-modal .modal-footer-info small {
    color: #6b7280;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .line-movement-modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .line-movement-modal .modal-content {
        max-height: 90vh;
    }
    
    .line-movement-modal .modal-header {
        padding: 1rem;
    }
    
    .line-movement-modal .modal-body {
        padding: 0.75rem 1rem;
    }
    
    .line-movement-modal .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .line-movement-modal .timeline-container {
        padding-left: 1.5rem;
    }
    
    .line-movement-modal .timeline-item {
        margin-left: 0.75rem;
    }
    
    .line-movement-modal .timeline-item::before {
        left: -1.5rem;
    }
    
    .line-movement-modal .timeline-lines {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .line-movement-modal .movement-summary {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animation */
.line-movement-modal {
    animation: modalFadeIn 0.2s ease-out;
}

.line-movement-modal .modal-content {
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
