
/* static/css/iframe_expand.css - Updated Version */

/* Base iframe container styles */
.iframe-container {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 0.375rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    transition: all 0.3s ease;
}

/* Loading indicator */
.iframe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    display: none;
}

/* Fullscreen overlay styles - Updated for 100% height */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    padding: 0; /* Removed padding for full height */
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.fullscreen-overlay iframe {
    width: 100%;
    height: 100%; /* Changed from calc(100% - 60px) to 100% */
    border: none; /* Removed border to maximize space */
    border-radius: 0; /* Removed border radius for full coverage */
    box-shadow: none; /* Removed shadow for full screen experience */
}

/* UPDATED: Smaller expand toggle button */
.expand-toggle {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 10;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px; /* Decreased from 45px to 32px */
    height: 32px; /* Decreased from 45px to 32px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem; /* Decreased from 1.1rem */
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Reduced shadow */
}

.expand-toggle:hover {
    transform: scale(1.0) rotate(180deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.expand-toggle:active {
    transform: scale(0.95);
}

/* UPDATED: Smaller close button positioned over fullscreen iframe */
.close-fullscreen {
    position: fixed; /* Changed from absolute to fixed for better positioning */
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px; /* Decreased from 55px to 32px */
    height: 32px; /* Decreased from 55px to 32px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem; /* Decreased from 1.3rem */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 10000; /* Higher z-index to stay above iframe */
}

.close-fullscreen:hover {
    transform: scale(1.0) rotate(90deg);
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
}

/* Card enhancements */
.iframe-card {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

.iframe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

.iframe-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-out {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9);
    }
    to { 
        opacity: 1; 
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from { 
        opacity: 1; 
        transform: scale(1);
    }
    to { 
        opacity: 0; 
        transform: scale(0.9);
    }
}

/* Responsive design - Updated button sizes for mobile */
@media (max-width: 768px) {
    .fullscreen-overlay {
        padding: 0; /* No padding on mobile for full height */
    }

    .fullscreen-overlay iframe {
        height: 100%; /* Full height on mobile too */
        border: none;
    }

    .iframe-container {
        height: 300px;
    }

    .expand-toggle {
        width: 28px; /* Even smaller on mobile */
        height: 28px;
        font-size: 0.8rem;
    }

    .close-fullscreen {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .iframe-container {
        height: 250px;
    }

    .card-header {
        padding: 0.75rem 1rem !important;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .expand-toggle {
        width: 26px; /* Extra small on very small screens */
        height: 26px;
        font-size: 0.75rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .iframe-container {
        background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    }

    .iframe-card {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .expand-toggle,
    .close-fullscreen {
        border: 2px solid #fff;
    }

    .fullscreen-overlay {
        background: #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .iframe-card,
    .expand-toggle,
    .close-fullscreen,
    .fade-in,
    .fade-out {
        transition: none;
        animation: none;
    }

    .expand-toggle:hover,
    .close-fullscreen:hover {
        transform: none;
    }
}

/* Additional styles for true fullscreen experience */
.fullscreen-overlay.no-chrome {
    background: #000; /* Pure black background for full immersion */
}

.fullscreen-overlay.no-chrome iframe {
    border-radius: 0;
    box-shadow: none;
}

/* Optional: Hide scrollbars in fullscreen for cleaner look */
.fullscreen-overlay::-webkit-scrollbar {
    display: none;
}

.fullscreen-overlay {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}





/* Info "I" icon just below expand-toggle */
.meta-info-icon {
    position: absolute;
    top: 36px;
    right: 8px;
    z-index: 10;
    font-size: 1.4rem;
    color: #3498db; /* bright blue */
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 7px rgba(52,152,219,0.18);
    padding: 2px 2px;
    cursor: pointer;
    transition: box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.meta-info-icon:hover, .meta-info-icon:focus {
    box-shadow: 0 0 10px rgba(52,152,219,0.40);
    outline: none;
}

/* Meta panel styles */
.meta-panel {
    position: absolute;
    top: 65px;
    right: 8px;
    width: 240px;
    background: #fff;
    color: #222;
    box-shadow: 0 6px 32px rgba(52,152,219,0.18);
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    padding: 18px 16px;
    z-index: 20;
    display: none;
    font-size: 0.95rem;
}

.meta-panel-header {
    margin-bottom: 8px;
    color: #3498db;
    font-weight: bold;
    letter-spacing: 0.03em;
    font-size: 1.07rem;
}

.meta-panel-list {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.meta-panel-list li {
    margin-bottom: 6px;
    font-size: 0.97rem;
}

/* Optional animation */
.meta-panel.fade-in {
    animation: fadeIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
