/* Dashboard Styles - Optimized for 1920x1080 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
}

#dashboard {
    width: 1920px;
    height: 1080px;
    position: relative;
    overflow: hidden;
}

.slide-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.slide iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
}

/* Hide scrollbars in iframes */
.slide iframe::-webkit-scrollbar {
    display: none;
}

.slide iframe {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.slide-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* Custom slide content styling */
.custom-slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.custom-slide-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.custom-slide-content p {
    font-size: 24px;
    margin: 10px 0;
}

/* Chart container styling */
.chart-container {
    width: 100%;
    height: 100%;
    padding: 60px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.chart-container h2 {
    font-size: 36px;
    margin-bottom: 30px;
    text-align: center;
}

.chart-container canvas {
    flex: 1;
    max-height: calc(100% - 100px);
}

/* Fullscreen adjustments */
:fullscreen #dashboard,
:-webkit-full-screen #dashboard,
:-moz-full-screen #dashboard {
    width: 100vw;
    height: 100vh;
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.slide {
    animation: fadeIn 0.5s ease-in-out;
}

/* iframe error message styling */
.iframe-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.error-content {
    text-align: center;
    padding: 60px;
    max-width: 800px;
}

.error-content h2 {
    font-size: 48px;
    margin-bottom: 30px;
    color: #ff9800;
}

.error-content p {
    font-size: 24px;
    margin: 15px 0;
    line-height: 1.5;
}

.error-content .error-detail {
    font-size: 20px;
    color: #aaa;
    margin-top: 10px;
}

.error-content .open-button {
    display: inline-block;
    margin-top: 40px;
    padding: 15px 40px;
    background: #4a9eff;
    color: #ffffff;
    text-decoration: none;
    font-size: 22px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.error-content .open-button:hover {
    background: #357abd;
}

/* Thumbnail view overlay */
.thumbnail-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
}

.thumbnail-view.active {
    display: flex;
}

.thumbnail-header {
    text-align: center;
    margin-bottom: 40px;
}

.thumbnail-header h2 {
    font-size: 42px;
    margin-bottom: 10px;
    color: #ffffff;
}

.thumbnail-hint {
    font-size: 18px;
    color: #aaa;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.thumbnail-item {
    position: relative;
    background: #2d2d2d;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 16/9;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(74, 158, 255, 0.3);
}

.thumbnail-item.current {
    outline: 4px solid #4a9eff;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
}

.thumbnail-preview {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.thumbnail-preview iframe {
    width: 1920px;
    height: 1080px;
    border: none;
    transform: scale(0.21);
    transform-origin: 0 0;
    pointer-events: none;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-preview .custom-preview {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    font-size: 24px;
    color: #ffffff;
}

.thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 15px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.thumbnail-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(74, 158, 255, 0.9);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 10;
}

/* Responsive adjustments for different screen sizes */
@media screen and (max-width: 1920px) {
    #dashboard {
        width: 100vw;
        height: 100vh;
    }
}

@media screen and (max-width: 1200px) {
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
}
