.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    transition: opacity 0.5s;
}

.modal-content {
    background-color: #fefefe;
    margin: 1% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 1200px;
    max-height: 95vh;
    border-radius: 10px;
    position: relative;
    animation: zoomIn 0.5s;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes zoomIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    margin-right: 7px;
    margin-top: -10px;
    font-size: 35px;
    
    cursor: pointer;
    z-index: 10000;
}

.close:hover {
    color: #000;
}

.loading {
    text-align: center;
    padding: 40px 16px;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    padding: 12px 16px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    margin: 16px;
    display: none;
    
}

.vehicle-info {
    display: none;
    padding: 0;
    background: #ffffff;
    min-height: 100%;
}

.timeline-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-right: 32px;
}

.timeline-title {
    
    font-size: 18px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Poppins', sans-serif;
}

.timeline-meta {
    display: flex;
    gap: 6px;
    align-items: baseline;
    font-family: 'Poppins', sans-serif;
}

.timeline-vin {
    color: #1d4ed8;
    
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
}

.timeline-specs {
    color: inherit;
    
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
}

.timeline-bar {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 25px;
    padding: 3px;
    position: relative;
}

.timeline-segment {
    flex: 1;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    padding: 10px 8px;
    text-align: center;
    border-radius: 8px;
    position: relative;
    margin: 0 2px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #93c5fd;
}

.timeline-segment.current {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-segment.in-transit {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: 1px solid #1d4ed8;
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

.timeline-segment.active-blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: 1px solid #1d4ed8;
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.3);
}

.segment-text {
    
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.date-info {
    margin-top: 10px;
    background: rgba(255,255,255,0.8);
    border-radius: 6px;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.9);
}

.date-label {
    display: block;
    font-size: 12px;
    color: #111827;
    opacity: 0.8;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-value {
    display: block;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
    color: #111827;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 260px;
    gap: 12px;
    padding: 16px;
}

.sale-origin-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.middle-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.photos-section {
    display: flex;
    flex-direction: column;
}

.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    
    color: #1f2937;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
}

.card-body {
    padding: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.info-row:hover {
    background-color: #f9fafb;
    margin: 0 -16px;
    padding: 4px 16px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row strong {
    color: #374151;
    
    min-width: 140px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

.info-row span {
    color: #1f2937;
    
    text-align: right;
    flex: 1;
    font-family: 'Poppins', sans-serif;
}

/* Container tracking styles */
.company-info {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 0;
}

/* Slightly lower the text block (company name, container, port) while keeping icon at top */
.company-info > div:nth-child(2) {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.company-icon {
    background: #2563eb;
    padding: 6px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.company-title {
    font-size: 14px;
    color: #1f2937;
    margin: 0;
    line-height: 1.1;
    font-family: sans-serif;
    text-align: left;
}

.container-number {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.1;
    font-family: sans-serif;
    margin-top: 2px;
    text-align: left;
}

.status-section {
    margin-top: 2px;
    margin-bottom: 6px;
}

.status-title {
    font-size: 16px;
    
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-icon {
    color: #3b82f6;
}

.status-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.status-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: start;
    gap: 4px;
    padding: 1px 0;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
}

.status-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-circle.completed {
    background: #10b981;
    color: white;
}

.status-circle.pending {
    background: #6b7280;
    border: 2px solid #6b7280;
}

.status-content {
    flex: 1;
    padding-bottom: 0;
}

/* Reduce spacing between city and time */
.status-content p {
    margin: 0;
    line-height: 1.15;
}

.status-city {
    margin-bottom: 2px;
}

.status-time {
    margin-top: 0;
    font-size: 12px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.current-badge {
    color: #10b981;
}

@keyframes currentBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.status-action {
    
    font-size: 13px;
}

.status-action.current {
    color: #10b981;
    animation: currentBlink 1.2s ease-in-out infinite;
}

.status-action.completed {
    color: #10b981;
}

.status-action.pending {
    color: #6b7280;
}

.top-cards {
    position: absolute;
    top: 10px;
    right: 48px;
    display: flex;
    gap: 4px;
    z-index: 1000;
}

.top-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 4px;
    padding: 2px 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    line-height: 1.1;
}

.top-card p {
    margin: 0;
}

.top-card .card-label {
    display: block;
    line-height: 1;
    font-size: 11px;
}

.top-card .card-value {
    display: block;
    line-height: 1;
    margin-top: 2px;
}

.card-icon {
    color: #3b82f6;
    font-size: 10px;
    line-height: 1;
    margin-top: 1px;
}

.card-label {
    font-size: 10px;
    color: #6b7280;
}

.card-value {
    color: #1f2937;
    font-size: 12px;
}

.bottom-eta-card {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(to right, #2563eb, #10b981);
    border-radius: 10px;
    padding: 10px;
    color: white;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
}

.eta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.eta-label {
    font-size: 12px;
}

.eta-time {
    font-weight: bold;
    font-size: 15px;
    margin-left: auto;
}

.eta-date {
    font-size: 10px;
    color: #dbeafe;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: white;
    height: 100%;
    border-radius: 9999px;
    transition: width 1s ease;
}

.progress-text {
    font-size: 12px;
    color: #dbeafe;
    margin-top: 2px;
}

/* Photo styles */
.photo-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.photo-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    transition: all 0.2s;
    cursor: pointer;
    width: 100%;
    height: 80px;
    position: relative;
}

.photo-category:hover {
    transform: scale(1.02);
}

.photo-category.active {
    border-color: #93c5fd;
}

.photo-category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    padding: 12px;
}

.photo-category-info {
    display: flex;
    align-items: center;
}

.photo-category-text {
    display: flex;
    flex-direction: column;
}

.photo-category-name {
    font-weight: 600;
    color: white;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.photo-category-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: sans-serif;
}

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .timeline-container {
        margin: 10px 12px;
        padding: 12px;
    }
    
    .timeline-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-segment {
        width: 100%;
        margin: 0;
    }
}
