/* Admin Settings Styling */
.retro-settings-wrap .retro-monitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.retro-settings-wrap .retro-monitor-section {
    background: #fff;
    padding: 15px;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.retro-settings-wrap .image-preview-wrapper {
    margin-bottom: 10px;
    min-height: 100px;
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #b4b9be;
}

.retro-settings-wrap .image-preview-wrapper img {
    max-width: 100%;
    max-height: 200px;
}

/* Frontend Styling */
.retro-canvas-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto 20px auto;
    overflow: hidden;
    background: #000;
}

/* CRT scanlines are drawn by Fabric.js directly over each monitor screen */

#retro-canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
    pointer-events: none;
}

.fullscreen-overlay * {
    pointer-events: auto;
}

#fullscreen-desc {
    color: #fff;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    margin: 20px auto 18px auto;
    max-width: 80%;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px 24px;
    border-radius: 4px;
}

.exit-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    width: 120px;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 10px;
    padding: 5px;
    z-index: 1000;
}

.exit-fullscreen img {
    width: 100%;
    display: block;
    mix-blend-mode: screen;
}

.exit-fullscreen:hover {
    transform: scale(1.1);
}

.nav-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    box-sizing: border-box;
    pointer-events: none;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
    pointer-events: auto;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.nav-btn:hover {
    background: rgba(0, 255, 255, 0.4);
    border-color: #00ffff;
    transform: scale(1.1);
}

/* Mobile optimizations for fullscreen overlay */
@media (max-width: 768px) {
    #fullscreen-desc {
        font-size: 1.1rem;
        margin: 80px auto 15px auto; /* Push below absolute exit button */
        max-width: 90%;
        padding: 10px 16px;
    }
    
    .exit-fullscreen {
        top: 15px;
        right: 15px;
        width: 90px; /* smaller exit sign on mobile */
    }
    
    .nav-controls {
        padding: 0 15px;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 2.2rem;
    }
}

/* Allow page scrolling over the canvas on mobile touch screens */
/* touch-action: pan-y permite scroll vertical nativo mientras Fabric gestiona taps */
.retro-canvas-wrapper canvas,
.retro-canvas-wrapper .canvas-container {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
}