/* File: public_html/assets/css/components/accessibility-widget.css (VERSI DISEMPURNAKAN) */

/* =================================================================== */
/* ==           WIDGET AKSESIBILITAS & PANEL PENGATURAN             == */
/* =================================================================== */

/* POSISI & VISIBILITAS TOMBOL MENGAMBANG (FAB) */
.accessibility-widget-fab {
    position: fixed;
    bottom: 90px;
    left: 0;
    z-index: 1002;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-15px); /* Posisi awal: tersembunyi sebagian */
}

/* Muncul penuh saat di-scroll (desktop) atau saat di-hover */
.accessibility-widget-fab.visible,
.accessibility-widget-fab:hover {
    transform: translateX(25px);
}

@media (max-width: 768px) {
  .accessibility-widget-fab {
    /* Default state: "Mengintip" dari sisi kiri */
    transform: translateX(-20px); 
    bottom: 85px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Transisi halus */
  }

  /* Muncul penuh saat scroll ke bawah (diberi kelas .visible oleh JS) ATAU saat disentuh (hover) */
  .accessibility-widget-fab.visible,
  .accessibility-widget-fab:hover {
    transform: translateX(20px);
  }
}

/* GAYA DASAR TOMBOL, PANEL, DAN LATAR BELAKANG */
.accessibility-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); z-index: 1001;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.accessibility-backdrop.show { opacity: 1; visibility: visible; }

.accessibility-btn {
    width: 50px; height: 50px;
    background-color: var(--primary-color, #673DE6);
    color: white; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.accessibility-btn:hover { background-color: var(--primary-deep, #4319BB); }
.accessibility-btn.active { transform: rotate(45deg); background-color: var(--danger-color, #dc3545); }
.accessibility-btn.active .material-icons { transform: scale(1.1); }

.accessibility-panel {
    position: fixed; top: 0; left: 0;
    width: 320px; max-width: 90%; height: 100%;
    background-color: var(--container-bg-color, #ffffff);
    border-right: 1px solid var(--border-color, #dee2e6);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 1003;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex; flex-direction: column;
}
.accessibility-panel.show { transform: translateX(0); }

/* KONTEN PANEL AKSESIBILITAS */
.panel-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color, #dee2e6); flex-shrink: 0; }
.panel-header h3 { margin: 0; font-size: 1.1em; color: var(--text-color, #2F1C6A); }
.panel-header .close-btn { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--light-text-color, #6c757d); padding: 0 5px; line-height: 1; }
.panel-header .close-btn:hover { color: var(--danger-color, #dc3545); }
.panel-tools { flex-grow: 1; overflow-y: auto; padding: 10px 0; }
.tools-list { list-style: none; padding: 0; margin: 0; }
.tools-list li button, .tools-list li .tool-group { display: flex; align-items: center; width: 100%; padding: 12px 20px; background: none; border: none; text-align: left; font-size: 1rem; font-family: inherit; cursor: pointer; color: var(--text-color, #2F1C6A); transition: background-color 0.2s ease, color 0.2s ease; }
.tools-list li button:hover { background-color: var(--bg-color, #F7F7FF); }
.tools-list li button.active { background-color: var(--primary-deep, #4319BB); color: white; font-weight: 500; }
.tools-list .separator { height: 1px; background-color: var(--border-color, #dee2e6); margin: 8px 20px; }
.tool-group { justify-content: space-between; cursor: default; }
.tool-group > span { display: flex; align-items: center; gap: 15px; }
.tool-group div { display: flex; align-items: center; }
.tool-group div button { width: auto; min-width: 38px; height: 35px; font-weight: bold; padding: 0 10px; border: 1px solid var(--border-color, #dee2e6); border-radius: 5px; margin-left: 5px; display: inline-flex; justify-content: center; align-items: center; }
.tool-group div button:hover { border-color: var(--primary-color, #673DE6); }
.tool-group div button.active { border-color: var(--primary-deep, #4319BB); background-color: var(--primary-deep, #4319BB); color: white; }
.tools-list li button .material-icons, .tools-list li .tool-group .material-icons { margin-right: 15px; opacity: 0.8; }
.tools-list li button.active .material-icons { opacity: 1; }

/* EFEK-EFEK SPESIFIK AKSESIBILITAS */
html.acc-grayscale { filter: grayscale(100%); }
html.acc-negative-contrast { filter: invert(100%) hue-rotate(180deg); }
html.acc-brightness { filter: brightness(115%); }
html.acc-bolder-text body { font-weight: bold !important; }
html.acc-highlight-links a:not(.btn):not(.menu-item) { background-color: yellow !important; color: black !important; padding: 2px 4px; border-radius: 3px; }
html.acc-highlight-headings h1, html.acc-highlight-headings h2, html.acc-highlight-headings h3 { background-color: #d1e7ff !important; padding: 5px; border-left: 5px solid var(--primary-color, #673DE6) !important; }
body[data-theme]:is([data-theme="dark"], [data-theme="twitter"], [data-theme="ai"], [data-theme="gold"], [data-theme="hotpink"], [data-theme="spotify"], [data-theme="netflix"]) html.acc-highlight-headings h1, 
body[data-theme]:is([data-theme="dark"], [data-theme="twitter"], [data-theme="ai"], [data-theme="gold"], [data-theme="hotpink"], [data-theme="spotify"], [data-theme="netflix"]) html.acc-highlight-headings h2, 
body[data-theme]:is([data-theme="dark"], [data-theme="twitter"], [data-theme="ai"], [data-theme="gold"], [data-theme="hotpink"], [data-theme="spotify"], [data-theme="netflix"]) html.acc-highlight-headings h3 { background-color: rgba(138, 112, 255, 0.2) !important; }
html.acc-cursor-white { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNiAxTDIzLjM4IDEzLjM4TDE2LjUgMjguOUw2IDFaIiBmaWxsPSJ3aGl0ZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+'), auto; }
html.acc-cursor-black { cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNiAxTDIzLjM4IDEzLjM4TDE2LjUgMjguOUw2IDFaIiBmaWxsPSJibGFjayIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+'), auto; }
.acc-reading-guide { position: fixed; height: 35px; width: 100%; background-color: rgba(103, 61, 230, 0.2); border-top: 2px solid var(--primary-deep, #4319BB); border-bottom: 2px solid var(--primary-deep, #4319BB); pointer-events: none; z-index: 9999; transition: top 0.1s ease-out; }

/* =================================================================== */
/* ==   MODAL POPUP UNTUK PALET WARNA (FINAL & RESPONSIVE SCROLL)   == */
/* =================================================================== */

#theme-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 1005;
    visibility: hidden; opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#theme-modal.active {
    visibility: visible; opacity: 1;
}

#theme-modal .modal-content {
    background: var(--container-bg-color, #fff);
    color: #333;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 680px;
    position: relative;
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;

    /* == PERBAIKAN UTAMA UNTUK MOBILE == */
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* Batasi tinggi modal, maksimal 85% dari tinggi layar */
}

body[data-theme]:is([data-theme="dark"], [data-theme="twitter"], [data-theme="ai"], [data-theme="gold"], [data-theme="hotpink"], [data-theme="spotify"], [data-theme="netflix"]) #theme-modal .modal-content {
    background: #222;
    color: #eee;
    border: 1px solid #444;
}

#theme-modal.active .modal-content {
    opacity: 1; transform: scale(1) translateY(0);
}

#theme-modal .modal-content h2 { 
    margin-top: 0; 
    margin-bottom: 8px; 
    color: var(--primary-color, #5a2f8b);
    flex-shrink: 0; /* Pastikan judul tidak ikut ter-scroll */
}
#theme-modal .modal-content p { 
    margin-top: 0; 
    margin-bottom: 20px; 
    font-size: 0.95rem; 
    line-height: 1.5;
    flex-shrink: 0; /* Pastikan paragraf tidak ikut ter-scroll */
}

#theme-modal .theme-choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    
    /* == PERBAIKAN UTAMA UNTUK SCROLL == */
    flex-grow: 1; /* Biarkan area ini mengisi sisa ruang */
    overflow-y: auto; /* Tambahkan scroll vertikal HANYA jika kontennya meluap */
    
    /* Beri sedikit jarak agar rapi */
    margin-top: 15px;
    margin-bottom: 20px;
    padding-top: 15px;
    padding-bottom: 10px;
    border-top: 1px solid var(--border-color, #ddd);
    border-bottom: 1px solid var(--border-color, #ddd);
}

#theme-modal .theme-choice-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px; border: 1px solid var(--border-color, #ddd);
    background-color: transparent;
    color: inherit;
    border-radius: 8px; cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
    font-size: 0.9rem;
}

#theme-modal .theme-choice-btn:hover { 
    border-color: var(--primary-color, #5a2f8b); 
    background-color: rgba(128, 128, 128, 0.1); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

#theme-modal .theme-choice-btn.active { 
    border-color: var(--primary-color, #5a2f8b); 
    background-color: var(--primary-color, #e9dff7);
    color: white; 
    font-weight: bold; 
}

#theme-modal .modal-content .close-btn { 
    position: absolute; top: 10px; right: 15px; 
    background: none; border: none; font-size: 2rem; 
    cursor: pointer; 
    color: #aaa;
    transition: color 0.2s ease;
    z-index: 10; /* Pastikan tombol close di atas konten scroll */
}
#theme-modal .modal-content .close-btn:hover {
    color: var(--danger-color, #dc3545);
}

#theme-modal .modal-btn.secondary-btn { 
    margin-top: 10px; 
    flex-shrink: 0; /* Pastikan tombol 'Pengaturan Profil' tidak ikut ter-scroll */
}
/* =================================================================== */
/* ==   PENYESUAIAN TAMPILAN MOBILE UNTUK MODAL TEMA                == */
/* =================================================================== */

@media (max-width: 480px) {
    #theme-modal .theme-choices-grid {
        /* Paksa grid untuk selalu menampilkan 2 kolom */
        grid-template-columns: repeat(2, 1fr);
    }
}