/**
 * AgriData AI - SHOWTIME Modal Styles
 * Cinematographic Big Data Presentation
 */

/* Modal Overlay */
.showtime-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.showtime-modal.visible {
    opacity: 1;
    visibility: visible;
}

/* Dark Blurred Backdrop */
.showtime-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Main Content Container */
.showtime-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: linear-gradient(
        145deg,
        rgba(26, 46, 20, 0.98) 0%,
        rgba(13, 31, 10, 0.99) 100%
    );
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(218, 165, 32, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(218, 165, 32, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.showtime-modal.visible .showtime-content {
    transform: translateY(0) scale(1);
}

/* Close Button */
.showtime-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.showtime-close:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #F44336;
    transform: rotate(90deg);
}

/* Slide Container */
.showtime-slide {
    padding: 60px 50px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.showtime-slide.active {
    opacity: 1;
    transform: translateX(0);
}

/* Emoji Badge */
.showtime-emoji {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: bounceIn 0.6s ease;
}

/* Type Badge */
.showtime-type {
    display: inline-block;
    background: rgba(218, 165, 32, 0.15);
    border: 1px solid rgba(218, 165, 32, 0.3);
    color: var(--accent-gold);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* Main Counter */
.showtime-counter {
    font-size: 5rem;
    font-weight: 800;
    color: #DAA520;
    line-height: 1;
    margin: 20px 0;
    text-shadow:
        0 0 40px rgba(218, 165, 32, 0.5),
        0 0 80px rgba(218, 165, 32, 0.3);
    position: relative;
}

.showtime-counter::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shine 3s ease-in-out infinite;
    pointer-events: none;
}

/* Title & Headline */
.showtime-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
}

.showtime-headline {
    font-size: 1.3rem;
    font-weight: 500;
    color: #DAA520;
    margin-bottom: 15px;
}

/* Narrative Text */
.showtime-narrative {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 600px;
    margin: 15px auto;
}

.showtime-explanation {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    margin-top: 15px;
}

/* Sub Stats Row */
.showtime-sub-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.showtime-sub-stat {
    text-align: center;
}

.showtime-sub-stat .value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #DAA520;
}

.showtime-sub-stat .label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Correlation Specific */
.showtime-correlation-value {
    font-size: 4rem;
    font-weight: 800;
    margin: 20px 0;
}

.showtime-correlation-value.positive { color: #4CAF50; }
.showtime-correlation-value.negative { color: #F44336; }

.correlation-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 10px;
}

.correlation-badge span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Comparison Bars */
.showtime-comparison {
    width: 100%;
    max-width: 500px;
    margin: 25px auto;
}

.comparison-bar {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.comparison-year {
    width: 60px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.comparison-track {
    flex: 1;
    height: 35px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.comparison-fill {
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    width: 0;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.comparison-fill.current {
    background: linear-gradient(90deg, #DAA520, #B8860B);
}

.comparison-fill.previous {
    background: rgba(255, 255, 255, 0.15);
}

.comparison-change {
    margin-top: 15px;
    font-size: 1.5rem;
    font-weight: 700;
}

.comparison-change.up { color: #4CAF50; }
.comparison-change.down { color: #F44336; }

/* Sparkline */
.showtime-sparkline {
    width: 100%;
    max-width: 400px;
    height: 80px;
    margin: 20px auto;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.sparkline-path {
    fill: none;
    stroke: #DAA520;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease forwards;
}

.sparkline-area {
    fill: url(#sparklineGradient);
    opacity: 0;
    animation: fadeInArea 1s ease 1s forwards;
}

/* Confidence Meter */
.confidence-meter {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
}

.confidence-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #F44336, #FFC107, #4CAF50);
    border-radius: 6px;
    width: 0;
    transition: width 1.5s ease;
}

.confidence-label {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Factors List */
.factors-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.factor-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Controls */
.showtime-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 50px 30px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.3));
}

.showtime-nav {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.showtime-nav:hover {
    background: rgba(218, 165, 32, 0.2);
    border-color: rgba(218, 165, 32, 0.4);
    color: #DAA520;
}

.showtime-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Dots Navigation */
.showtime-dots {
    display: flex;
    gap: 10px;
}

.showtime-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.showtime-dot:hover {
    background: rgba(255, 255, 255, 0.4);
}

.showtime-dot.active {
    background: #DAA520;
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.5);
}

/* Auto-play Progress */
.showtime-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #DAA520, #B8860B);
    width: 0;
    transition: width 0.1s linear;
}

/* Showtime Button (Dashboard) */
.showtime-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #DAA520 0%, #B8860B 100%);
    color: #0D1F0A;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
}

.showtime-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.4);
}

.showtime-button i {
    font-size: 1.2rem;
}

.showtime-button .btn-text {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Loading State */
.showtime-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.showtime-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(218, 165, 32, 0.2);
    border-top-color: #DAA520;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.showtime-loading-text {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* Animations */
@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    50%, 100% {
        transform: translateX(100%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeInArea {
    to {
        opacity: 0.3;
    }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .showtime-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .showtime-slide {
        padding: 40px 25px;
    }

    .showtime-counter {
        font-size: 3.5rem;
    }

    .showtime-title {
        font-size: 1.4rem;
    }

    .showtime-narrative {
        font-size: 1rem;
    }

    .showtime-sub-stats {
        flex-direction: column;
        gap: 15px;
    }

    .showtime-controls {
        padding: 15px 25px 20px;
    }

    .showtime-nav {
        width: 40px;
        height: 40px;
    }
}
