/* =========================================
   GLOBAL RESET & BASE
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background-color: #fdfbf7;
    user-select: none; 
}

.hidden {
    display: none !important;
}

/* =========================================
   DESAIN FILE INPUT (UPLOAD)
   ========================================= */
.gold-file-input {
    display: block;
    width: 100%;
    font-size: 12px;
    color: #5a4611;
    background: #ffffff;
    border: 1px dashed #d4af37;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    outline: none;
}

.gold-file-input::file-selector-button {
    background: linear-gradient(to bottom, #ffffff, #fdf8e7);
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 6px 10px;
    color: #5a4611;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
}

/* =========================================
   DESKTOP BACKGROUND (White & Gold)
   ========================================= */
.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, #ffffff 0%, #fdf9e6 70%, #f3e5b5 100%);
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: #ffffff;
    border-radius: 50px;
    opacity: 0.9;
    filter: blur(1px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
    animation: drift 60s infinite linear;
}

@keyframes drift {
    from { transform: translateX(-100px); }
    to { transform: translateX(110vw); }
}

.hill {
    position: absolute;
    bottom: 45px; 
    width: 120%;
    height: 35vh;
    border-radius: 50% 50% 0 0;
}

.hill-back {
    left: -10%;
    background: linear-gradient(to bottom, #fceeb5, #e8d070);
    opacity: 0.7;
    z-index: 1;
}

.hill-front {
    left: 20%;
    bottom: 45px;
    background: linear-gradient(to bottom, #fff5d1, #f2dc88);
    opacity: 0.8;
    z-index: 2;
}

/* =========================================
   DESKTOP ICONS
   ========================================= */
.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.d-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    color: #5a4611;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    font-weight: 600;
}

.d-icon:hover {
    background: rgba(255, 255, 255, 0.6);
    border: 1px dotted #d4af37;
}

.d-icon .glyph {
    font-size: 32px;
    margin-bottom: 5px;
}

/* =========================================
   WINDOW SYSTEM (APLIKASI)
   ========================================= */
.window {
    position: absolute;
    top: 10%;
    left: 15%;
    width: 70%;
    height: 75%;
    min-width: 600px;
    min-height: 450px;
    background: #ffffff;
    border: 1px solid #d4af37;
    border-radius: 6px 6px 0 0;
    box-shadow: 0px 5px 20px rgba(212, 175, 55, 0.3);
    z-index: 20;
    display: flex;
    flex-direction: column;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 45px) !important;
    border-radius: 0;
}

.titlebar {
    background: linear-gradient(to right, #fdf8e7, #ffffff);
    color: #5a4611;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d4af37;
    border-radius: 6px 6px 0 0;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 15px;
}

.title-buttons {
    display: flex;
    gap: 6px;
}

.tbtn {
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 1px solid #d4af37;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a4611;
}

.tbtn.close {
    color: #e04343;
}

.menubar {
    background: #ffffff;
    padding: 4px 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #888;
}

/* =========================================
   LAYOUT DALAM WINDOW
   ========================================= */
.window-body {
    display: flex;
    flex: 1;
    background: #fcfcfc;
    overflow: hidden;
}

.panel-left {
    width: 290px;
    background: #ffffff;
    border-right: 1px solid #eaeaea;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.section {
    background: #fff;
    border: 1px solid #f0e6d2;
    padding: 12px;
    border-radius: 6px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: #a38132;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.frame-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.frame-options button {
    padding: 10px;
    background: #ffffff;
    border: 1px solid #eaddb6;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    color: #5a4611;
    font-size: 13px;
}

.frame-options button.active {
    background: #fdf8e7;
    border-color: #d4af37;
    font-weight: bold;
}

.gold-btn {
    display: block;
    width: 100%;
    padding: 11px;
    background: #ffffff;
    border: 1px solid #d4af37;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    color: #5a4611;
    text-align: center;
    font-weight: 500;
}

.capture-btn {
    padding: 14px;
    background: linear-gradient(to bottom, #f5d677, #d4af37);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(212,175,55,0.3);
}

.capture-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
}

.panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f4ec;
    padding: 15px;
    position: relative;
}

.stage {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 2px dashed #d4af37;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.stage-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); 
}

.placeholder {
    color: #c5a059;
    font-style: italic;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.countdown {
    position: absolute;
    font-size: 100px;
    color: white;
    font-weight: bold;
    text-shadow: 0 4px 10px rgba(212,175,55,0.8);
    z-index: 10;
}

.flash {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.flash.go {
    animation: flashFx 0.4s ease-out;
}

@keyframes flashFx {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.idol-preview {
    position: absolute;
    bottom: 0;
    left: 10px;
    height: 85%;
    max-width: 65%;
    object-fit: contain;
    z-index: 5;
    pointer-events: none;
}

/* =========================================
   TASKBAR & START MENU
   ========================================= */
.taskbar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 45px;
    background: #ffffff;
    border-top: 2px solid #d4af37;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 100;
}

.start-btn {
    background: linear-gradient(to bottom, #ffffff, #fdf8e7);
    color: #d4af37;
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 0 18px;
    height: 32px;
    font-weight: bold;
    font-size: 15px;
    font-style: italic;
    cursor: pointer;
}

.task-sep {
    width: 1px;
    height: 60%;
    background: #eaeaea;
    margin: 0 12px;
}

.task-item {
    background: #fdf8e7;
    color: #5a4611;
    border: 1px solid #d4af37;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.task-item.inactive {
    background: transparent;
    border-color: transparent;
}

.tray {
    margin-left: auto;
    color: #5a4611;
    font-size: 13px;
    font-weight: 600;
    background: #ffffff;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    border-left: 1px solid #eaeaea;
}

.startmenu {
    position: absolute;
    bottom: 50px;
    left: 10px;
    width: 260px;
    background: #fff;
    border: 1px solid #d4af37;
    border-radius: 8px;
    box-shadow: 0 -4px 15px rgba(212,175,55,0.2);
    z-index: 99;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.startmenu-head {
    background: linear-gradient(to right, #fdf8e7, #ffffff);
    color: #5a4611;
    padding: 15px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0e6d2;
}

.startmenu-items {
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.startmenu-items button {
    text-align: left;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #5a4611;
    border-radius: 4px;
}

.startmenu-items button:hover {
    background: #fdf8e7;
    color: #d4af37;
    font-weight: bold;
}

/* =========================================
   POPUP MODAL HASIL FOTO
   ========================================= */
.result-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    backdrop-filter: blur(5px);
}

.result-modal img {
    max-height: 70vh;
    max-width: 95vw;
    object-fit: contain;
    border: 4px solid #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.modal-controls {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    width: 100%;
    max-width: 320px;
    justify-content: center;
}

.frame-choice-btn.active {
    background: #fdf8e7 !important;
    border-color: #d4af37 !important;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.frame-choice-btn:hover {
    background: #fff9e6;
}

/* =========================================
   MEDIA QUERY KHUSUS HP (MOBILE FRIENDLY)
   ========================================= */
@media screen and (max-width: 768px) {
    .window {
        width: 100% !important;
        height: calc(100vh - 45px) !important;
        top: 0 !important;
        left: 0 !important;
        min-width: unset;
        min-height: unset;
        border-radius: 0;
        border: none;
    }
    
    .window-body {
        flex-direction: column;
        overflow-y: auto; 
    }

    .panel-right {
        width: 100% !important;
        order: 1; 
        min-height: 320px;
        max-height: 45vh;
        padding: 10px;
        flex: none; 
        background: #ffffff;
    }
    
    .panel-left {
        width: 100% !important;
        order: 2; 
        border-right: none;
        border-top: 2px dashed #eaddb6;
        padding-bottom: 40px;
        overflow-y: visible;
    }
    
    .stage {
        height: 100%;
        min-height: 300px;
        border-radius: 8px;
    }

    video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .titlebar {
        pointer-events: none;
    }
    
    .title-buttons {
        pointer-events: auto;
    }

    .idol-preview {
        max-width: 60%;
        height: 80%;
        left: 5px;
    }
}