/**
 * TourGo Upcoming Departures Styles
 * 
 * Modern, responsive design for homepage departures section
 * Optimized for performance and mobile experience
 */

.departures-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

/* Section Header */
.section-header {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
    text-align: center;
    position: relative;
}

.section-title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 18px;
    color: #64748b;
    margin: 0 0 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.departures-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #475569;
    font-size: 20px;
    font-weight: bold;
}

.control-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slides-indicator {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.separator {
    margin: 0 8px;
    color: #94a3b8;
}

/* Slider */
.departures-slider {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: hidden;
}

.departures-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 24px;
}

/* Departure Cards */
.departure-card {
    flex: 0 0 calc(25% - 18px);
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.departure-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.departure-card.urgent {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, white 100%);
}

.departure-card.urgent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    animation: pulse-glow 2s ease-in-out infinite;
}

.departure-card.soon {
    border-color: #60a5fa;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Card Image */
.card-image {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.departure-card:hover .card-image img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #94a3b8;
    font-size: 28px;
}

/* Card Badges */
.card-image .badge {
    position: absolute;
    z-index: 2;
}

.badge-discount {
    top: 8px;
    left: 8px;
}

.badge-availability {
    top: 8px;
    right: 8px;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
}

.badge-discount {
    background: #ef4444;
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.badge-available {
    background: rgba(34, 197, 94, 0.95);
    color: white;
}

.badge-limited {
    background: rgba(249, 115, 22, 0.95);
    color: white;
}

.badge-full {
    background: rgba(107, 114, 128, 0.95);
    color: white;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Departure Date */
.departure-date {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    line-height: 1;
}

.date-month {
    font-size: 10px;
    letter-spacing: 0.05em;
}

.date-day {
    font-size: 15px;
}

/* Card Content */
.card-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-location {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.tour-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tour-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tour-title a:hover {
    color: #3b82f6;
}

.tour-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

.meta-item {
    font-weight: 500;
}

.meta-separator {
    color: #cbd5e1;
}

/* Departure Info */
.departure-info {
    padding: 6px 0;
}

.countdown-compact {
    font-size: 12px;
    color: #3b82f6;
    font-weight: 600;
    padding: 6px 10px;
    background: #eff6ff;
    border-radius: 6px;
    display: inline-block;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.pricing {
    flex: 1;
}

.price-original {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
    display: block;
    margin-bottom: 0px;
    line-height: 1.1;
}

.price-label {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    display: block;
    margin-bottom: 0px;
    line-height: 1.1;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 3px;
    margin-top: 0px;
    margin-bottom: 0px;
    line-height: 1;
}

.currency {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.amount {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.price-unit {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    display: block;
    margin-top: 0px;
    line-height: 1.1;
}

.book-btn {
    padding: 3px 6px !important;
    border: none !important;
    background: var(--tourgo-blue, #3b82f6) !important;
    color: white !important;
    border-radius: 2px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.book-btn:hover {
    background: var(--tourgo-light-blue, #2563eb) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.book-btn[data-urgent="true"] {
    background: var(--tourgo-red, #f59e0b) !important;
}

.book-btn[data-urgent="true"]:hover {
    background: #d97706 !important;
}

@keyframes pulse-urgent {
    0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5); }
}

/* Section Footer */
.section-footer {
    text-align: center;
    margin-top: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: var(--tourgo-blue, #3b82f6) !important;
    color: white !important;
}

.btn-primary:hover {
    background: var(--tourgo-light-blue, #2563eb) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-large {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    color: #475569;
}

/* Loading States */
.departures-loading {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.departure-card.loading {
    pointer-events: none;
}

.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.card-image.loading-shimmer {
    border-radius: 0;
}

.loading-text-short {
    height: 16px;
    width: 60%;
    margin-bottom: 12px;
}

.loading-text-medium {
    height: 16px;
    width: 80%;
    margin-bottom: 12px;
}

.loading-text-long {
    height: 24px;
    width: 100%;
    margin-bottom: 16px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Empty State */
.departures-empty {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.departures-empty h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
}

.departures-empty p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 32px;
}

/* Error State */
.departures-error {
    text-align: center;
    padding: 80px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.departures-error h3 {
    font-size: 24px;
    font-weight: 700;
    color: #dc2626;
    margin: 0 0 16px;
}

.departures-error p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 32px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .departure-card {
        flex: 0 0 calc(33.333% - 16px);
    }
}

@media (max-width: 768px) {
    .departure-card {
        flex: 0 0 calc(50% - 12px);
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .departures-controls {
        gap: 16px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .departures-section {
        padding: 60px 0;
    }
    
    .card-content {
        padding: 14px;
    }
    
    .tour-meta {
        gap: 8px;
    }
    
    .card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .book-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .departure-card {
        flex: 0 0 calc(100% - 0px);
    }
    
    .departures-track {
        gap: 16px;
    }
    
    .departures-slider {
        padding: 0 16px;
    }
    
    .section-header {
        padding: 0 16px;
    }
    
    .card-image {
        height: 160px;
    }
    
    .tour-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .tour-meta .meta-separator {
        display: none;
    }

    .tour-meta .meta-item {
        display: inline-flex;
        align-items: center;
        line-height: 1.35;
    }

    .tour-meta .meta-item + .meta-item::before {
        content: '•';
        color: #cbd5e1;
        margin-right: 6px;
    }

    .countdown-compact {
        font-size: 11px;
        padding: 5px 9px;
    }

    .card-footer {
        gap: 10px;
        padding-top: 6px;
    }

    .book-btn {
        width: 100%;
        min-height: 32px;
        border-radius: 4px !important;
        font-size: 11px !important;
    }
    
    .departure-countdown {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .departure-card,
    .control-btn,
    .book-btn,
    .btn,
    .departures-track {
        transition: none;
    }
    
    .loading-shimmer {
        animation: none;
        background: #f1f5f9;
    }
    
    .badge-limited,
    .book-btn[data-urgent="true"] {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .departure-card {
        border: 2px solid #000;
    }
    
    .control-btn {
        border-color: #000;
    }
    
    .badge {
        border: 1px solid #000;
    }
}

/* Print styles */
@media print {
    .departures-section {
        background: none;
        box-shadow: none;
    }
    
    .departure-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .control-btn,
    .book-btn {
        display: none;
    }
}