/**
 * Edutrade Economic Calendar - Frontend Stylesheet
 * 
 * @package Edutrade_Economic_Calendar
 * @version 1.0.0
 */

/* ==========================================================================
   1. CONTAINER WRAPPER
   ========================================================================== */

.edutrade-calendar-wrapper {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 1.5rem auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.edutrade-calendar-wrapper *,
.edutrade-calendar-wrapper *::before,
.edutrade-calendar-wrapper *::after {
    box-sizing: border-box;
}

/* Theme Light */
.edutrade-calendar-wrapper.edutrade-theme-light {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
}

/* Theme Dark */
.edutrade-calendar-wrapper.edutrade-theme-dark {
    background-color: #131722;
    border: 1px solid #2a2e39;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35), 0 2px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Transparent Background */
.edutrade-calendar-wrapper.edutrade-is-transparent {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   2. CUSTOM HEADER BAR
   ========================================================================== */

.edutrade-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #edf2f7;
    background: #fafbfc;
}

.edutrade-theme-dark .edutrade-calendar-header {
    background: #1e222d;
    border-bottom: 1px solid #2a2e39;
}

.edutrade-calendar-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edutrade-calendar-header-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.edutrade-calendar-title-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1a202c;
}

.edutrade-theme-dark .edutrade-calendar-title-text {
    color: #f7fafc;
}

/* LIVE BADGE */
.edutrade-calendar-header-badges {
    display: flex;
    align-items: center;
}

.edutrade-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background-color: #ebfbee;
    color: #2b8a3e;
    border: 1px solid #d3f9d8;
}

.edutrade-theme-dark .edutrade-live-indicator {
    background-color: rgba(43, 138, 62, 0.2);
    color: #69db7c;
    border-color: rgba(105, 219, 124, 0.3);
}

.edutrade-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #2b8a3e;
    box-shadow: 0 0 0 0 rgba(43, 138, 62, 0.7);
    animation: edutradePulse 1.8s infinite;
}

.edutrade-theme-dark .edutrade-live-dot {
    background-color: #69db7c;
    box-shadow: 0 0 0 0 rgba(105, 219, 124, 0.7);
}

@keyframes edutradePulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(43, 138, 62, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(43, 138, 62, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(43, 138, 62, 0);
    }
}

/* ==========================================================================
   3. TRADINGVIEW INNER CONTAINER & COPYRIGHT
   ========================================================================== */

.edutrade-calendar-inner {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 450px;
}

.edutrade-calendar-inner .tradingview-widget-container {
    width: 100% !important;
    height: 100% !important;
}

.edutrade-calendar-inner .tradingview-widget-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block;
}

.edutrade-calendar-inner .tradingview-widget-copyright {
    padding: 6px 12px;
    text-align: right;
    font-size: 0.75rem;
    line-height: 1.2;
    background: transparent;
}

.edutrade-calendar-inner .tradingview-widget-copyright a {
    color: #718096;
    text-decoration: none;
    transition: color 0.2s ease;
}

.edutrade-calendar-inner .tradingview-widget-copyright a:hover {
    color: #2962ff;
    text-decoration: underline;
}

.edutrade-theme-dark .edutrade-calendar-inner .tradingview-widget-copyright a {
    color: #a0aec0;
}

.edutrade-theme-dark .edutrade-calendar-inner .tradingview-widget-copyright a:hover {
    color: #2962ff;
}

/* ==========================================================================
   4. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 640px) {
    .edutrade-calendar-wrapper {
        border-radius: 8px;
        margin: 1rem 0;
    }

    .edutrade-calendar-header {
        padding: 10px 14px;
    }

    .edutrade-calendar-title-text {
        font-size: 0.9rem;
    }

    .edutrade-calendar-inner {
        min-height: 400px;
    }
}
