/**
 * Current/Past Toggle Component Styling
 * Mobile: Horizontal tabs below page title
 * Desktop: Toggle control in filter sidebar
 */

/* ============================================
   SHARED STYLES
   ============================================ */

/* Hide mobile-only elements on desktop */
@media (min-width: 992px) {
    .mobile-only {
        display: none !important;
    }
}

/* Hide desktop-only elements on mobile */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
}

/* ============================================
   MOBILE TABS
   ============================================ */

.safaroto-current-past-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin: 5px 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.safaroto-current-past-tabs .safaroto-tab {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.safaroto-current-past-tabs .safaroto-tab:hover {
    color: #333;
    background: rgba(36, 184, 244, 0.1);
}

.safaroto-current-past-tabs .safaroto-tab.active {
    background: #24B8F4;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(36, 184, 244, 0.3);
}

.safaroto-current-past-tabs .safaroto-tab i {
    font-size: 12px;
    margin-right: 6px;
    opacity: 0.8;
}

.safaroto-current-past-tabs .safaroto-tab.active i {
    opacity: 1;
}

/* ============================================
   DESKTOP TOGGLE
   ============================================ */

.safaroto-current-past-toggle {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.safaroto-current-past-toggle .toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-right: 12px;
    white-space: nowrap;
}

.safaroto-current-past-toggle .toggle-buttons {
    display: flex;
    gap: 6px;
    flex: 1;
}

.safaroto-current-past-toggle .toggle-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.safaroto-current-past-toggle .toggle-button:hover {
    background: #e9ecef;
    border-color: #ccc;
    color: #333;
}

.safaroto-current-past-toggle .toggle-button.active {
    background: #24B8F4;
    border-color: #24B8F4;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(36, 184, 244, 0.3);
}

.safaroto-current-past-toggle .toggle-button i {
    font-size: 12px;
    opacity: 0.8;
}

.safaroto-current-past-toggle .toggle-button.active i {
    opacity: 1;
}

/* Compact version for narrow sidebars */
@media (min-width: 992px) and (max-width: 1200px) {
    .safaroto-current-past-toggle .toggle-button span {
        display: none;
    }

    .safaroto-current-past-toggle .toggle-button i {
        font-size: 14px;
        margin: 0;
    }
}

/* ============================================
   INTEGRATION ADJUSTMENTS
   ============================================ */

/* Add spacing when toggle is placed above filters */
.filter-button-container {
    margin-top: 0 !important;
}

/* Ensure toggle doesn't break filter sidebar layout */
.safaroto-cards-panel .safaroto-current-past-toggle {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-left: 0;
    margin-right: 0;
}

/* Mobile: Add spacing below tabs before filter button */
@media (max-width: 991px) {
    .safaroto-current-past-tabs + .filter-button-container {
        margin-top: 10px;
    }
}

/* ============================================
   TAB PANEL SWITCHING
   ============================================ */

/* Wrapper for tabbed traveldata instances */
.traveldata-tabbed-wrapper {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Tab panels - hide inactive by default */
.traveldata-tab-panel {
    display: none;
    width: 100%;
}

.traveldata-tab-panel.active {
    display: block;
}

/* Smooth transitions when switching */
.traveldata-tab-panel {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states for keyboard navigation */
.safaroto-current-past-tabs .safaroto-tab:focus,
.safaroto-current-past-toggle .toggle-button:focus {
    outline: 2px solid #24B8F4;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .safaroto-current-past-tabs .safaroto-tab.active,
    .safaroto-current-past-toggle .toggle-button.active {
        border: 2px solid currentColor;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .safaroto-current-past-tabs .safaroto-tab,
    .safaroto-current-past-toggle .toggle-button {
        transition: none;
    }
}
