/**
 * TIST Events Calendar Timezone Converter Styles
 *
 * @package TIST_TEC_Timezone_Converter
 * @since 1.0.0
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

/**
 * Wrapper for converted timezone elements
 * Applied to both the wrapper span and container divs
 */
.tist-tz-event-time {
    display: inline;
}

/**
 * Globe icon styling
 * Shows inside the original timezone reference to indicate "event set in different timezone"
 */
.tist-tz-globe {
    font-size: 0.9em;
    margin-right: 0.15em;
    opacity: 0.8;
}

/**
 * Main converted time display
 */
.tist-tz-converted-time {
    font-weight: inherit;
}

/**
 * Original timezone reference (subtle, secondary text)
 */
.tist-tz-original-time {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
    margin-left: 0.25em;
    white-space: nowrap;
}

/* ==========================================================================
   Elementor Widget - Block Layout Styles
   ========================================================================== */

/**
 * Date line in block layout
 */
.tist-event-datetime .tist-tz-date {
    display: block;
    margin-bottom: 0;
}

/**
 * Converted time in block layout (div element)
 */
.tist-event-datetime div.tist-tz-converted-time {
    display: block;
    margin-bottom: 0;
}

/**
 * Original time in block layout (div element, on its own line)
 */
.tist-event-datetime div.tist-tz-original-time {
    display: block;
    margin-left: 0;
    margin-top: 0;
    white-space: normal;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .tist-tz-original-time {
        color: #aaa;
    }
}

/* ==========================================================================
   View-Specific Adjustments
   ========================================================================== */

/**
 * List View Adjustments
 */
.tribe-events-calendar-list__event-datetime-wrapper .tist-tz-globe {
    display: inline;
}

/**
 * Month View Calendar Grid
 * Compact display for calendar cells
 */
.tribe-events-calendar-month__calendar-event-datetime .tist-tz-original-time {
    display: none; /* Hide in compact month view */
}

.tribe-events-calendar-month__calendar-event-datetime .tist-tz-globe {
    display: none; /* Hide globe in compact view */
}

/**
 * Month View Tooltip
 * Show full info in tooltip
 */
.tribe-events-calendar-month__calendar-event-tooltip .tist-tz-original-time {
    display: inline;
}

.tribe-events-calendar-month__calendar-event-tooltip .tist-tz-globe {
    display: inline;
}

/**
 * Month View Mobile Events
 */
.tribe-events-calendar-month-mobile-events__meta .tist-tz-original-time {
    display: block;
    margin-left: 0;
    margin-top: 0.25em;
}

/**
 * Day View
 */
.tribe-events-calendar-day__event-datetime-wrapper .tist-tz-globe {
    display: inline;
}

/**
 * Week View (Events Calendar Pro)
 */
.tribe-events-pro-week-grid__event-datetime .tist-tz-original-time {
    display: none; /* Hide in compact week grid */
}

.tribe-events-pro-week-grid__event-datetime .tist-tz-globe {
    display: none;
}

/**
 * Week View Tooltip
 */
.tribe-events-pro-week-grid__event-tooltip .tist-tz-original-time {
    display: inline;
}

.tribe-events-pro-week-grid__event-tooltip .tist-tz-globe {
    display: inline;
}

/**
 * Single Event Page
 */
.tribe-events-schedule .tist-tz-globe {
    display: inline;
}

.tribe-events-schedule .tist-tz-original-time {
    display: block;
    margin-left: 0;
    margin-top: 0.5em;
    font-size: 0.9em;
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.tribe-events-widget .tist-tz-original-time {
    display: block;
    margin-left: 0;
    margin-top: 0.25em;
}

.tribe-events-widget .tist-tz-globe {
    display: none;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

/**
 * Loading state (optional, can be applied during conversion)
 */
.tist-tz-converting {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

/**
 * Error state - keeps original display
 */
.tist-tz-error {
    /* No special styling - just shows original */
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .tist-tz-original-time {
        display: block;
        margin-left: 0;
        margin-top: 0.25em;
    }

    .tist-tz-globe {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .tist-tz-original-time {
        font-size: 0.8em;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/**
 * Screen reader text for timezone conversion indication
 */
.tist-tz-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/**
 * Focus styles for interactive elements
 */
.tist-tz-event-time:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .tist-tz-converted-time::before {
        content: '[Local: ';
    }

    .tist-tz-converted-time::after {
        content: ']';
    }

    .tist-tz-original-time {
        display: inline !important;
    }

    .tist-tz-globe {
        display: inline !important;
    }
}
