/* --- SHARED MODAL STYLES FOR GUIDE --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-ob {
    background-color: var(--bg-main, #282725);
    border-radius: 12px;
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.4s ease;
    color: var(--text-main, #f1f0ee);
}

.overlay.active .modal-ob {
    transform: translateY(0);
}

.modal-ob .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
}

.modal-ob .modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-ob .btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted, rgba(241, 240, 238, 0.6));
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-ob .btn-close:hover {
    color: var(--text-main, #f1f0ee);
    background: var(--hover-bg, rgba(255, 255, 255, 0.08));
}

/* MODAL 2: DETAILED GUIDE */
#detailedModal {
    width: 820px;
    max-width: 95%;
    height: 500px;
    display: flex;
    flex-direction: column;
}

.guide-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.guide-sidebar {
    width: 220px;
    border-right: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    background: rgba(0, 0, 0, 0.1);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, rgba(241, 240, 238, 0.6));
    padding: 14px 24px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn:hover {
    color: var(--text-main, #f1f0ee);
    background: var(--hover-bg, rgba(255, 255, 255, 0.08));
}

.tab-btn.active {
    color: var(--accent-cyan, #00eeff);
    background: var(--accent-cyan-dim, rgba(0, 238, 255, 0.15));
    border-left-color: var(--accent-cyan, #00eeff);
}

.guide-content-area {
    flex: 1;
    position: relative;
}

.tab-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.guide-anim-box {
    width: 240px;
    height: 160px;
    margin-bottom: 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-panel h3 {
    font-size: 20px;
    color: var(--text-main, #f1f0ee);
    margin-bottom: 12px;
}

.tab-panel p {
    font-size: 14px;
    color: var(--text-muted, rgba(241, 240, 238, 0.6));
    line-height: 1.6;
}

.tab-panel ul {
    text-align: left;
    color: var(--text-muted, rgba(241, 240, 238, 0.6));
    font-size: 14px;
    margin-top: 16px;
    padding-left: 20px;
    width: 100%;
    max-width: 400px;
}

.tab-panel li {
    margin-bottom: 8px;
}

.tab-panel li b {
    color: var(--text-main, #f1f0ee);
    font-weight: 500;
}

/* ANIMATIONS */
.anim-storage .folder { width: 80px; height: 60px; border: 2px solid var(--border-light, rgba(255,255,255,0.1)); border-radius: 6px; position: relative; animation: float-folder 4s infinite ease-in-out; }
@keyframes float-folder { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.anim-storage .folder::before { content: ''; position: absolute; top: -12px; left: -2px; width: 35px; height: 12px; border: 2px solid var(--border-light, rgba(255,255,255,0.1)); border-bottom: none; border-radius: 6px 6px 0 0; }
.anim-storage .shield { position: absolute; bottom: -12px; right: -12px; width: 32px; height: 38px; background: var(--bg-card, #302f2d); border: 2px solid var(--accent-cyan, #00eeff); border-radius: 4px 4px 16px 16px; animation: pulse-shield 2s infinite ease-in-out; }
@keyframes pulse-shield { 0% { box-shadow: 0 0 0 rgba(0, 238, 255, 0); transform: scale(1); } 50% { box-shadow: 0 0 20px rgba(0, 238, 255, 0.4); transform: scale(1.05); } 100% { box-shadow: 0 0 0 rgba(0, 238, 255, 0); transform: scale(1); } }

.anim-highlight .lines { width: 120px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.anim-highlight .line { width: 100%; height: 8px; background: var(--border-light, rgba(255,255,255,0.1)); border-radius: 4px; }
.anim-highlight .line-mid { position: relative; width: 100%; height: 8px; background: var(--border-light, rgba(255,255,255,0.1)); border-radius: 4px; overflow: hidden; }
.anim-highlight .highlighter { position: absolute; top: 0; left: 0; height: 100%; background: var(--accent-cyan, #00eeff); opacity: 0.5; animation: scan-text 3s infinite; }
.anim-highlight .pill { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); width: 40px; height: 16px; background: var(--text-main, #f1f0ee); border-radius: 8px; opacity: 0; display: flex; align-items: center; justify-content: center; gap: 4px; animation: pop-pill 3s infinite; }
.anim-highlight .pill::before, .anim-highlight .pill::after { content: ''; width: 6px; height: 6px; background: var(--bg-main, #282725); border-radius: 50%; }
@keyframes scan-text { 0%, 20% { width: 0; } 40%, 80% { width: 100%; } 100% { width: 0; } }
@keyframes pop-pill { 0%, 40% { opacity: 0; transform: translate(-50%, 5px); } 50%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 5px); } }

.anim-sidebar .browser { width: 140px; height: 100px; border: 2px solid var(--border-light, rgba(255,255,255,0.1)); border-radius: 8px; display: flex; overflow: hidden; position: relative; }
.anim-sidebar .main { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.anim-sidebar .main-line { width: 80%; height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.anim-sidebar .panel { width: 45px; background: var(--accent-cyan-dim, rgba(0,238,255,0.15)); border-left: 1px solid var(--accent-cyan, #00eeff); transform: translateX(100%); animation: slide-panel 4s infinite cubic-bezier(0.4, 0, 0.2, 1); }
.anim-sidebar .float-btn { position: absolute; bottom: 10px; right: 10px; width: 16px; height: 16px; background: var(--accent-cyan, #00eeff); border-radius: 50%; opacity: 0; animation: hide-float 4s infinite; }
@keyframes slide-panel { 0%, 20% { transform: translateX(100%); } 40%, 80% { transform: translateX(0); } 100% { transform: translateX(100%); } }
@keyframes hide-float { 0%, 20% { opacity: 1; } 40%, 80% { opacity: 0; } 100% { opacity: 1; } }

.anim-manager .layout { width: 140px; height: 90px; display: flex; gap: 8px; border: 2px solid var(--border-light, rgba(255,255,255,0.1)); border-radius: 8px; padding: 6px; }
.anim-manager .left { width: 35px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border-light, rgba(255,255,255,0.1)); padding-right: 4px; }
.anim-manager .right { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.anim-manager .search { height: 12px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; position: relative; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); }
.anim-manager .search::after { content: ''; position: absolute; top: 0; left: -100%; width: 15px; height: 100%; background: var(--accent-cyan, #00eeff); opacity: 0.4; animation: search-scan 2.5s infinite; filter: blur(2px); }
.anim-manager .line { height: 8px; background: var(--border-light, rgba(255,255,255,0.1)); border-radius: 4px; }
@keyframes search-scan { 0% { left: -100%; } 100% { left: 200%; } }

.anim-crud .list { display: flex; flex-direction: column; gap: 12px; width: 140px; }
.anim-crud .item { width: 100%; height: 30px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-light, rgba(255,255,255,0.1)); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; position: relative; }
.anim-crud .item-text { width: 50px; height: 6px; background: var(--text-muted, rgba(241,240,238,0.6)); border-radius: 3px; }
.anim-crud .dots { display: flex; gap: 3px; }
.anim-crud .dot { width: 4px; height: 4px; background: var(--text-muted, rgba(241,240,238,0.6)); border-radius: 50%; }
.anim-crud .popup { position: absolute; right: -50px; top: 15px; width: 40px; height: 26px; background: var(--bg-card, #302f2d); border: 1px solid var(--accent-cyan, #00eeff); border-radius: 4px; opacity: 0; transform: scale(0.8); animation: crud-pop 3s infinite; display: flex; flex-direction: column; gap: 2px; padding: 3px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.anim-crud .pop-line { height: 6px; background: rgba(255, 255, 255, 0.2); border-radius: 2px; }
@keyframes crud-pop { 0%, 20% { opacity: 0; transform: scale(0.8); } 30%, 80% { opacity: 1; transform: scale(1); } 90%, 100% { opacity: 0; transform: scale(0.8); } }

.anim-export .zip-box { width: 50px; height: 50px; border: 2px dashed var(--border-light, rgba(255,255,255,0.1)); border-radius: 8px; position: relative; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.02); }
.anim-export .zip-box::after { content: 'ZIP'; font-size: 12px; color: var(--text-muted, rgba(241,240,238,0.6)); font-weight: bold; }
.anim-export .note-item { position: absolute; width: 20px; height: 26px; background: var(--accent-cyan, #00eeff); border-radius: 4px; opacity: 0; box-shadow: 0 4px 8px rgba(0, 238, 255, 0.2); }
.anim-export .note-1 { animation: drop-in 3s infinite 0.2s; left: -40px; top: -30px; }
.anim-export .note-2 { animation: drop-in 3s infinite 0.6s; left: 70px; top: -10px; }
@keyframes drop-in { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 20% { opacity: 1; transform: translate(0, 0) scale(1); } 50%, 100% { opacity: 0; transform: translate(calc(30px - 100%), 20px) scale(0.3); } }

.anim-settings { flex-direction: column; }
.anim-settings .gear-wrapper { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.anim-settings .gear { width: 32px; height: 32px; border: 4px dashed var(--text-muted, rgba(241,240,238,0.6)); border-radius: 50%; animation: spin 4s linear infinite; position: relative; }
.anim-settings .gear::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 12px; height: 12px; background: rgba(0, 0, 0, 0.2); border: 4px solid var(--text-muted, rgba(241,240,238,0.6)); border-radius: 50%; }
.anim-settings .toggle { width: 32px; height: 16px; background: var(--accent-cyan, #00eeff); border-radius: 8px; position: relative; }
.anim-settings .toggle::after { content: ''; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; background: var(--bg-main, #282725); border-radius: 50%; }
.anim-settings .colors { display: flex; gap: 8px; }
.anim-settings .color { width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted, rgba(241,240,238,0.6)); }
.anim-settings .color.active { background: var(--accent-cyan, #00eeff); box-shadow: 0 0 10px var(--accent-cyan, #00eeff); }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* MOBILE RESPONSIVE FOR GUIDE MODAL */
@media (max-width: 768px) {
    #detailedModal {
        height: 85vh;
        max-height: none;
    }
    .guide-layout {
        flex-direction: column;
    }
    .guide-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
        -webkit-overflow-scrolling: touch;
        order: 2;
    }
    .guide-sidebar::-webkit-scrollbar {
        display: none; /* Hide scrollbar for a cleaner look */
    }
    .tab-btn {
        padding: 12px 16px;
        white-space: nowrap;
        border-left: none;
        border-top: 3px solid transparent;
    }
    .tab-btn.active {
        border-left-color: transparent;
        border-top-color: var(--accent-cyan, #00eeff);
        background: transparent;
    }
    .guide-content-area {
        overflow-y: auto;
        position: relative;
        order: 1;
    }
    .tab-panel {
        padding: 24px 16px;
        position: relative;
        height: auto;
        min-height: 100%;
        opacity: 1;
        visibility: visible;
        transform: none !important;
        display: none;
    }
    .tab-panel.active {
        display: flex;
    }
}
