/**
 * Chart Zoom Modal Styles
 * Fullscreen overlay modal for chart enlargement
 * SempiPlancia®© Standard Design
 */

/* ===== OVERLAY ===== */
.chart-zoom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.chart-zoom-overlay.active {
    opacity: 1;
}

/* ===== MODAL CONTAINER ===== */
.chart-zoom-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #F16926;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(241, 105, 38, 0.4);
    width: 95vw;
    max-width: 1600px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    animation: slideUpFadeIn 0.5s forwards;
}

@keyframes slideUpFadeIn {
    from {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ===== HEADER ===== */
.chart-zoom-header {
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 2px solid #F16926;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px 18px 0 0;
    backdrop-filter: blur(10px);
}

.chart-zoom-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.chart-zoom-title i {
    color: #F16926;
    font-size: 1.8rem;
}

.chart-zoom-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== BUTTONS ===== */
.chart-zoom-btn {
    padding: 10px 18px;
    background: linear-gradient(45deg, #F16926, #ff8447);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(241, 105, 38, 0.3);
}

.chart-zoom-btn:hover {
    background: linear-gradient(45deg, #ff8447, #F16926);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 105, 38, 0.5);
}

.chart-zoom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(241, 105, 38, 0.3);
}

.chart-zoom-btn i {
    font-size: 1.1rem;
}

.chart-zoom-close-btn {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.chart-zoom-close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    border-color: #e74c3c;
    transform: rotate(90deg) scale(1.1);
}

.chart-zoom-close-btn:active {
    transform: rotate(90deg) scale(1);
}

/* ===== BODY (CHART AREA) ===== */
.chart-zoom-body {
    flex: 1;
    padding: 30px;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
}

.chart-zoom-canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(241, 105, 38, 0.2);
    padding: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

#chartZoomCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ===== FOOTER ===== */
.chart-zoom-footer {
    background: rgba(0, 0, 0, 0.6);
    border-top: 2px solid #F16926;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 18px 18px;
    backdrop-filter: blur(10px);
}

.chart-zoom-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 0.9rem;
}

.chart-zoom-info i {
    color: #F16926;
    font-size: 1.1rem;
}

.chart-zoom-powered {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 0.85rem;
}

.chart-zoom-powered strong {
    color: #F16926;
    font-weight: 700;
    font-size: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .chart-zoom-modal {
        width: 98vw;
        height: 95vh;
    }

    .chart-zoom-body {
        padding: 20px;
    }

    .chart-zoom-canvas-container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .chart-zoom-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .chart-zoom-title {
        font-size: 1.2rem;
    }

    .chart-zoom-title i {
        font-size: 1.4rem;
    }

    .chart-zoom-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .chart-zoom-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        flex: 1;
    }

    .chart-zoom-btn span {
        display: none; /* Hide button text on mobile, show only icons */
    }

    .chart-zoom-close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .chart-zoom-body {
        padding: 15px;
    }

    .chart-zoom-canvas-container {
        padding: 10px;
    }

    .chart-zoom-footer {
        padding: 12px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }

    .chart-zoom-info {
        font-size: 0.8rem;
    }

    .chart-zoom-powered {
        font-size: 0.75rem;
    }
}

/* ===== LOADING STATE ===== */
.chart-zoom-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.chart-zoom-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(241, 105, 38, 0.2);
    border-top: 4px solid #F16926;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chart-zoom-loading-text {
    color: #F16926;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== ACCESSIBILITY ===== */
.chart-zoom-btn:focus,
.chart-zoom-close-btn:focus {
    outline: 3px solid #F16926;
    outline-offset: 2px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.chart-zoom-overlay.closing {
    animation: fadeOut 0.3s forwards;
}

.chart-zoom-modal.closing {
    animation: slideDownFadeOut 0.4s forwards;
}

@keyframes slideDownFadeOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }
}
