/* Sembunyikan scrollbar di browser utama */
html,
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* CUSTOM PREMIUM SCROLLBARS FOR CHILDS */
.kolom-tengah::-webkit-scrollbar,
.kolom-kanan::-webkit-scrollbar,
#history-dropdown::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    display: block !important;
}

.kolom-tengah::-webkit-scrollbar-track,
.kolom-kanan::-webkit-scrollbar-track,
#history-dropdown::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.kolom-tengah::-webkit-scrollbar-thumb,
.kolom-kanan::-webkit-scrollbar-thumb,
#history-dropdown::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.15);
    border-radius: var(--radius);
    transition: background 0.3s;
}

.kolom-tengah::-webkit-scrollbar-thumb:hover,
.kolom-kanan::-webkit-scrollbar-thumb:hover,
#history-dropdown::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.3);
}

:root {
    --primary: #0077b6;       /* Vibrant Blue */
    --primary-hover: #005f96; /* Darker Vibrant Blue */
    --bg: #ffffff; /* Tetap Putih sesuai permintaan */
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #f1f5f9;
    --border-light: #f8fafc;
    --accent: #f72585;        /* Pink */
    --focus-ring: rgba(0, 119, 182, 0.15);
    --radius: 6px;           /* Consistent Border Radius Token (Reduced) */
    
    /* Section Colors - Custom Palette */
    --c-angka: #e63946;       /* Red */
    --c-karakter: #38b000;    /* Forest Green */
    --c-fase: #f77f00;        /* Orange */
    --c-nama: #7209b7;        /* Purple */
    --c-elemen: #00b4d8;      /* Teal */
    --c-profiling: #4361ee;   /* Indigo */
    --c-amber: #ffa600;       /* Amber Yellow */
    --c-lime: #80b918;        /* Lime Green */
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
}

/* BACKGROUND COSMIC BLOBS */
.glass-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    transition: all 1s ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(190, 18, 60, 0.25) 0%, rgba(91, 33, 182, 0.15) 100%);
    top: -10%;
    left: -10%;
    animation: floatBlob1 25s infinite alternate ease-in-out;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(67, 56, 202, 0.25) 0%, rgba(3, 105, 161, 0.15) 100%);
    bottom: -15%;
    right: -10%;
    animation: floatBlob2 30s infinite alternate ease-in-out;
}

@keyframes floatBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 40px) scale(1.15); }
    100% { transform: translate(-40px, 80px) scale(0.9); }
}

@keyframes floatBlob2 {
    0% { transform: translate(0, 0) scale(1.1); }
    50% { transform: translate(-60px, -80px) scale(0.9); }
    100% { transform: translate(40px, 40px) scale(1.05); }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Figtree', sans-serif;
}

body {
    background: radial-gradient(circle at top right, #ffffff, #fcfcff 40%, #f9f9ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-main);
    position: relative;
    overflow-x: hidden;
}

.layout-container {
    display: flex;
    width: 100%;
    max-width: 1350px;
    min-height: 80vh;
    gap: 1rem;
    align-items: flex-start;
}

.kolom-kiri {
    width: 26%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.header {
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-main);
    letter-spacing: 0.05em;
}

.input-text,
.input-select {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: var(--surface-solid);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.input-text:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-select:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.tanggal-lahir-group {
    display: flex;
    gap: 0.75rem;
}

/* QUICK CLEAR BUTTONS */
.input-with-clear {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-clear .input-text {
    width: 100%;
    padding-right: 2.25rem !important;
}

.btn-clear-field {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.btn-clear-field:hover {
    color: #be123c;
    background-color: rgba(190, 18, 60, 0.05);
    transform: scale(1.05);
}

.btn-clear-field:active {
    transform: scale(0.95);
}

.btn-clear-date:hover {
    color: #be123c !important;
    background-color: rgba(190, 18, 60, 0.05) !important;
}

.btn-clear-date:active {
    transform: scale(0.95);
}

/* DROPDOWN HISTORY */
.dropdown-container {
    position: relative;
}

#history-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

#history-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

.btn-delete-profile:hover {
    background-color: rgba(190, 18, 60, 0.08) !important;
    color: #be123c !important;
}

#btn-clear-all-history:hover {
    background-color: rgba(190, 18, 60, 0.08) !important;
    color: #be123c !important;
}

.tanggal-lahir-group .input-select,
.tanggal-lahir-group .input-text {
    flex: 1;
}

.btn-submit {
    margin-top: 1rem;
    width: 100%;
    padding: 0.65rem 0.875rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 14px var(--focus-ring);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: buttonShimmer 6s infinite ease-in-out;
}

@keyframes buttonShimmer {
    0% { left: -60%; }
    15%, 100% { left: 140%; }
}

.btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}

.btn-submit:active {
    transform: translateY(0);
}

/* TABS STYLING */
.tabs {
    position: relative;
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    padding: 4px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: var(--radius);
    width: 100%;
    z-index: 1;
    overflow: hidden;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    position: relative;
    padding: 0.7rem 0.4rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex: 1;
    z-index: 2;
}

.tab-item:hover {
    color: var(--text-main);
}

.tab-item.active {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tab-active-color, var(--primary)) !important;
}

.tab-item.active svg {
    color: var(--tab-active-color, var(--primary)) !important;
}

.tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.btn-submit:disabled {
    cursor: not-allowed;
    opacity: 1; /* Keep opacity full to see progress clearly */
}

.btn-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
    transition: width 0.1s linear;
}

.progress-text {
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}


.kolom-tengah {
    width: 48%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    position: relative;
    transition: all 0.3s ease;
}

.kolom-kanan {
    width: 26%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* --- TABS SYSTEM --- */
#btn-tab-angka.active {
    color: var(--c-angka) !important;
}
#btn-tab-nama.active {
    color: var(--c-nama) !important;
}
#btn-tab-karakter.active {
    color: var(--c-profiling) !important;
}

.tab-pane {
    display: none;
    width: 100%;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    animation: tabFadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

.tab-pane.active.tab-pane-flex {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pane Themes */
.pane-angka { 
    background: rgba(255, 241, 242, 0.65); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(190, 18, 60, 0.15); 
    color: var(--c-angka); 
    box-shadow: 0 4px 20px rgba(190, 18, 60, 0.02);
}
.pane-karakter { 
    background: rgba(240, 253, 244, 0.65); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(22, 163, 74, 0.15); 
    color: var(--c-karakter); 
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.02);
}
.pane-fase { 
    background: rgba(255, 247, 237, 0.65); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(180, 83, 9, 0.15); 
    color: var(--c-fase); 
    box-shadow: 0 4px 20px rgba(180, 83, 9, 0.02);
}
.pane-nama { 
    background: rgba(238, 242, 255, 0.65); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(67, 56, 202, 0.15); 
    color: var(--c-nama); 
    box-shadow: 0 4px 20px rgba(67, 56, 202, 0.02);
}

.pane-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
}

/* 12-column grid for special layouts like Fase Kehidupan */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }

.fase-header {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Modal Overlay */


.btn-editor-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(22, 163, 74, 0.08);
    color: var(--primary);
    transition: all 0.2s;
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.btn-editor-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.btn-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(22, 163, 74, 0.08);
    color: var(--primary);
    transition: all 0.2s;
    border: 1px solid rgba(22, 163, 74, 0.15);
    cursor: pointer;
}

.btn-hint:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

/* Blob disembunyikan (tidak digunakan di desain baru) */
.blob {
    display: none;
}

.hasil-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1;
}

.hasil-header {
    text-align: left;
    margin-bottom: 0;
}

.hasil-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.hasil-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.hasil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}

/* Grid utama hasil (ANGKA, KARAKTER, NAMA, FASE) dengan template areas */
.hasil-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "angka    karakter"
        "fase     nama";
    gap: 1rem;
    width: 100%;
}

.cell-angka {
    grid-area: angka;
}

.cell-karakter {
    grid-area: karakter;
}

.cell-nama {
    grid-area: nama;
}

.cell-fase {
    grid-area: fase;
}

.hasil-cell {
    background-color: var(--surface-solid);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: none;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 180px;
    transition: transform 0.2s;
}

.cell-angka { grid-area: angka; background: #fff1f2; border: 1px solid rgba(190, 18, 60, 0.1); color: var(--c-angka); }
.cell-karakter { grid-area: karakter; background: #f0fdf4; border: 1px solid rgba(22, 163, 74, 0.1); color: var(--c-karakter); }
.cell-fase { grid-area: fase; background: #fff7ed; border: 1px solid rgba(180, 83, 9, 0.1); color: var(--c-fase); }
.cell-nama { grid-area: nama; background: #eef2ff; border: 1px solid rgba(67, 56, 202, 0.1); color: var(--c-nama); }

.hasil-cell h3 {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hasil-cell h3 svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.cell-angka h3 { color: var(--c-angka); border-bottom-color: var(--c-angka); }
.cell-karakter h3 { color: var(--c-karakter); border-bottom-color: var(--c-karakter); }
.cell-fase h3 { color: var(--c-fase); border-bottom-color: var(--c-fase); }
.cell-nama h3 { color: var(--c-nama); border-bottom-color: var(--c-nama); }

/* Specific border colors for boxes to match theme */
.cell-angka .hasil-box { border-color: rgba(190, 18, 60, 0.15); }
.cell-karakter .hasil-box { border-color: rgba(22, 163, 74, 0.15); }
.cell-fase .hasil-box { border-color: rgba(180, 83, 9, 0.15); }
.cell-nama .hasil-box { border-color: rgba(67, 56, 202, 0.15); }

/* Elemen & Zodiak */
#val-zodiak.hasil-box, #val-elemen.hasil-box, #val-kutub.hasil-box, .box-mini-elemen { 
    border-color: rgba(3, 105, 161, 0.15); 
    color: var(--c-elemen); 
    font-weight: 700;
}



.cell-angka h3 svg { color: var(--c-angka); }
.cell-karakter h3 svg { color: var(--c-karakter); }
.cell-fase h3 svg { color: var(--c-fase); }
.cell-nama h3 svg { color: var(--c-nama); }

/* Sync result colors (using inheritance) */
.hasil-box span, .hasil-box p, .angka-display span, .nama-display span, .karakter-display span, .box-mini-elemen span, .box-mini-elemen p { 
    color: inherit; 
}

/* Kotak Fase Kehidupan: lebar sama dengan kotak ANGKA */
.cell-fase {
    min-height: auto;
}



.angka-display,
.nama-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: var(--radius);
    border: 1px solid #f3f4f6;
}

.placeholder-text {
    color: #9ca3af;
    font-size: 0.95rem;
    font-style: italic;
}

.hasil-grid-9 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
}

.hasil-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
}

/* --- PREMIUM HOVER EFFECTS (Lift & Glow) --- */
.hasil-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hasil-item:hover {
    transform: translateY(-4px) scale(1.02);
    filter: brightness(1.03);
}

.layout-container.has-results .kolom-tengah {
    transform: translateY(0);
    opacity: 1;
}

/* Category Glows */
.pane-angka .hasil-item:hover .hasil-box {
    box-shadow: 0 8px 20px rgba(190, 18, 60, 0.2);
    border-color: var(--c-angka);
}

.pane-karakter .hasil-item:hover .hasil-box {
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.2);
    border-color: var(--c-karakter);
}

.pane-nama .hasil-item:hover .hasil-box {
    box-shadow: 0 8px 20px rgba(67, 56, 202, 0.2);
    border-color: var(--c-nama);
}

.pane-fase .hasil-item:hover .hasil-box {
    box-shadow: 0 8px 20px rgba(180, 83, 9, 0.2);
    border-color: var(--c-fase);
}

.pane-elemen .hasil-item:hover .hasil-box {
    box-shadow: 0 8px 20px rgba(3, 105, 161, 0.2);
    border-color: var(--c-elemen);
}

/* Label Pop Effect (Disabled motion as requested) */
.hasil-item:hover h4 {
    color: var(--text-muted);
}

/* Icon Micro-animation (Disabled as requested) */
.hasil-item:hover .ikon-teks-wrapper svg {
    transform: none;
}

.hasil-item h4 {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: transparent;
    transition: all 0.2s ease;
}

.hasil-item:has(.tooltip-icon:hover) h4 {
    background: transparent !important;
    color: var(--text-muted) !important;
}

.hasil-box {
    background-color: #fff;
    border-radius: var(--radius);
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border);
    height: 38px; /* Tinggi seragam untuk semua kotak */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Aturan tampilan tulisan / angka yang akan di-inject ke dalam kotak */
.hasil-box span,
.hasil-box p,
.angka-display span,
.nama-display span,
.karakter-display span {
    text-align: center;
    font-size: 0.85rem;
    /* Mengecilkan skala font agar muat */
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flexbox style khusus untuk container span berserta SVG ikon inline */
.ikon-teks-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: inherit;
    width: 100%;
    height: 100%;
    text-align: center;
}

.ikon-teks-wrapper svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: inherit;
}

/* Base style angka di section ANGKA (9 kotak) agar konsisten sebelum & sesudah kalkulasi */
.hasil-grid-9 .hasil-box span:not(.placeholder-text) {
    font-size: 1.35rem;
    font-weight: 700;
    color: inherit;
    width: auto;
    overflow: visible;
    text-overflow: unset;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    display: inline-block;
}

/* Khusus Char Besar agar angka dan raw berdekatan */
#box-Char-Besar, #box-Potensi {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
}

#box-Char-Besar span {
    width: auto;
    display: inline-block;
    text-align: center;
}

/* Placeholder tetap kecil dan muted */
.hasil-grid-9 .hasil-box .placeholder-text {
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 400;
}

.box-mini-elemen {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--c-elemen);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    padding: 0 4px;
}

.box-mini-elemen svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Desktop landscape & tablet landscape (≥1280px): Tampilan penuh tanpa scroll luar */
@media (min-width: 1280px) {

    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    body {
        padding: 1.25rem 2rem;
        align-items: stretch;
        flex-direction: column;
    }

    .layout-container {
        flex: 1;
        min-height: 0;
        height: 100%;
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
    }

    .kolom-kiri {
        height: 100%;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .kolom-tengah,
    .kolom-kanan {
        height: 100%;
        overflow-y: auto;
    }
}



/* Responsive */
@media (max-width: 1024px) {
    .layout-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }

    .kolom-kiri,
    .kolom-tengah,
    .kolom-kanan {
        width: 100%;
        padding: 1.5rem;
    }

    .kolom-kanan {
        min-height: 400px;
    }

    .hasil-grid {
        grid-template-columns: 1fr;
    }

    /* Tablet: ubah main-grid jadi 2 kolom khusus */
    .hasil-main-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "angka karakter"
            "fase  nama";
    }

    /* Menyesuaikan kotak Fase Kehidupan di Tablet ke grid 4 lajur (kembali seperti desktop) */
    .cell-fase>div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Penyesuaian baris Fase 1, 2, 3 di tablet landscape/portrait */
    .cell-fase>div>div[style*="grid-column: 1 / -1"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Smartphone (Portrait & Landscape Medium) */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .layout-container {
        gap: 1rem;
        padding: 0;
    }

    .kolom-kiri,
    .kolom-tengah,
    .kolom-kanan {
        padding: 1.25rem;
        border-radius: var(--radius);
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .tanggal-lahir-group {
        flex-direction: row;
        gap: 0.4rem;
    }

    .tanggal-lahir-group .input-text {
        min-width: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .hasil-header h2 {
        font-size: 1.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        letter-spacing: -0.02em;
    }

    #hasil-subtitle {
        font-size: 0.85rem;
        margin-top: 0.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Kotak Grid Angka & Karakter 3 kolom di mobile */
    .hasil-grid-9,
    .hasil-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Kotak Nama (Ekspresi, dsb) */
    .cell-nama>div:last-child {
        grid-template-columns: 1fr !important;
    }

    /* NAMA di bawah FASE di mobile portrait */
    .hasil-main-grid {
        grid-template-columns: 1fr;
        grid-template-areas: unset;
    }

    .cell-angka {
        grid-area: auto;
        order: 2;
    }

    .cell-fase {
        grid-area: auto;
        order: 3;
    }

    .cell-karakter {
        grid-area: auto;
        order: 1;
    }

    .cell-nama {
        grid-area: auto;
        order: 4;
    }

    /* Kotak Fase Kehidupan: 4 kolom di mobile */
    .fase-hide-mobile {
        display: flex;
    }

    .cell-fase>div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .cell-fase>div>div[style*="grid-column: 1 / -1"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Perbaikan Teks Terpotong (Ellipsis) di Mobile */
    .hasil-box {
        height: auto !important;
        min-height: 38px;
        padding: 0.5rem 0.25rem !important;
    }

    .hasil-box span,
    .hasil-box p,
    .angka-display span,
    .nama-display span,
    .karakter-display span {
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        font-size: 0.85rem !important;
    }

    /* Modal Height Adjustment for Mobile */
    .modal-body {
        max-height: 75vh !important;
    }

    /* Perbaikan Judul Terpotong (T1, T2, X1, dll) di Fase Kehidupan */
    .hasil-item h4 {
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        line-height: 1.1 !important;
        height: auto !important;
        min-height: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Small Smartphone (Portrait) */
@media (max-width: 540px) {
    body {
        padding: 0.5rem;
    }
    
    .kolom-kiri,
    .kolom-tengah,
    .kolom-kanan {
        padding: 1rem;
    }

    /* ANGKA & KARAKTER tetap 3 kolom di mobile portrait */
    .hasil-grid-9,
    .hasil-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .pane-rumus {
        overflow-x: auto;
    }

    .hasil-header h2 {
        font-size: 1.15rem;
    }

    #hasil-subtitle {
        font-size: 0.75rem;
    }

    /* Tab bar optimization for small screens */
    .tab-item {
        font-size: 0.65rem !important;
        gap: 0.25rem !important;
        padding: 0.6rem 0.2rem !important;
    }
    .tab-item svg {
        width: 12px !important;
        height: 12px !important;
    }

    /* Profiling Grid Table Mobile Adjustments */
    .profiling-grid-table th, 
    .profiling-grid-table td {
        padding: 4px 2px !important;
        font-size: 0.6rem !important;
    }
}

/* FLOATING ACTIONS REMOVED */


.btn-print svg,
.btn-download-pdf svg,
.btn-download-img svg,
.btn-share svg {
    width: 20px;
    height: 20px;
}

.btn-download-pdf:disabled,
.btn-download-img:disabled,
.btn-share:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.inline-actions {
    display: none;
    /* Muncul saat dihitung */
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    background: rgba(22, 163, 74, 0.05);
    border: 1px solid rgba(22, 163, 74, 0.15);
    color: var(--primary);
}

.btn-action svg {
    width: 14px;
    height: 14px;
}

.btn-action.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-action:hover {
    background: var(--border-light);
}

.btn-action.primary:hover {
    background: var(--primary-hover);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ══ EXPORT TEMPLATE STYLES (Tersedia untuk PDF dan Image) ══ */
#print-report {
    display: none;
    /* Hide interactive web part by default */
    position: relative;
        font-family: 'Figtree', sans-serif;
    color: #111827;
    font-size: 10pt;
    width: 100%;
    background: white;
    padding: 32px;
    box-sizing: border-box;
}

/* Header */
.rpt-header {
    background: var(--primary);
    color: white;
    padding: 14px 18px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rpt-header-label {
    font-size: 7.5pt;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
}

.rpt-header-name {
    font-size: 16pt;
    font-weight: 700;
    margin: 2px 0 1px;
}

.rpt-header-sub {
    font-size: 8pt;
    opacity: 0.75;
}

.rpt-header-date {
    text-align: right;
    font-size: 8pt;
    opacity: 0.85;
}

.rpt-header-date span {
    display: block;
    font-size: 13pt;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* Grid sections */
.rpt-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rpt-card {
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 10px 12px;
    page-break-inside: avoid;
}

.rpt-card-full {
    grid-column: 1 / -1;
}

.rpt-card-title {
    font-size: 7.5pt;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-nama);
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 5px;
    margin-bottom: 8px;
}

/* Grid angka dalam card */
.rpt-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.rpt-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.rpt-item {
    border: 1px solid #f3f4f6;
    border-radius: var(--radius);
    padding: 4px 5px;
    text-align: center;
    background: #fafafa;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rpt-item-label {
    font-size: 6pt;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0px;
}

.rpt-item-value {
    font-size: 13pt;
    font-weight: 700;
    color: #111827;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

#rpt-char-besar,
#rpt-char-kecil {
    color: var(--c-karakter);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rpt-item-value.green {
    color: #16a34a;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rpt-item-value.gray {
    color: #374151;
    font-size: 8.5pt;
}

.rpt-item-sub {
    font-size: 6pt;
    color: #9ca3af;
    display: block;
}

/* Fase Kehidupan */
.rpt-fase-section {
    margin-bottom: 4px;
}

.rpt-fase-label {
    font-size: 6pt;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}

/* Footer */
.rpt-footer {
    margin-top: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 6px;
    text-align: center;
    font-size: 7pt;
    color: #9ca3af;
}

/* Nama section dua kolom */
.rpt-nama-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rpt-nama-col-title {
    font-size: 6.5pt;
    font-weight: 700;
    color: var(--c-nama);
    text-align: center;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.rpt-nama-col-title.alt {
    color: var(--c-angka);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 14mm;
    }

    body {
            font-family: 'Figtree', sans-serif;
        background-color: white !important;
    }

    .navbar,
    .main-container,
    .blob,
    .floating-actions,
    .inline-actions,
    .kolom-kiri {
        display: none !important;
    }

    .layout-container {
        display: block !important;
        padding: 0 !important;
    }

    .kolom-tengah {
        display: none !important;
    }
    .kolom-kanan {
        display: none !important;
    }

    #print-report {
        display: block !important;
        background: white !important;
    }
}

/* Modal Penjelasan Dihapus */

/* Make boxes clickable indicator */
.hasil-item {
    cursor: pointer;
    position: relative;
}

.hasil-item:hover .hasil-box {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--focus-ring);
}

.hasil-item.no-click {
    cursor: default !important;
}

.hasil-item.no-click:hover .hasil-box {
    border-color: var(--border) !important;
    box-shadow: none !important;
}

.hasil-item.no-click .hasil-box {
    cursor: default !important;
}


@media print {
    .modal-overlay {
        display: none !important;
    }

    .hasil-item:hover {
        transform: none !important;
    }

    .hasil-item:hover .hasil-box {
        border-color: var(--border) !important;
        box-shadow: none !important;
    }
}



/* Notifikasi merah untuk kotak dengan modal */
.has-modal-badge .hasil-box {
    position: relative;
}

.has-modal-badge .hasil-box::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background-color: #be123c;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    transition: background-color 0.3s ease;
}

.has-modal-badge.is-read .hasil-box::after {
    background-color: #d1d5db;
    /* abu muda / gray-300 */
}



@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Subtle hover on box only */
.hasil-item {
    transition: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.stagger-item {
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

/* Hapus shine effect */
.hasil-box {
    position: relative;
    overflow: hidden;
}

.hasil-box::before {
    display: none;
}

/* ══ INTERPRETATION MODAL ══ */
#interpretation-modal, #hint-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 420px;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 1rem 1.25rem;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
    line-height: 1.7;
    color: #334155;
    font-size: 0.95rem;
}

/* Editor Typography in Modal */
.modal-body h2 { font-size: 1.4rem; margin: 1.2rem 0 0.6rem; color: var(--text-main); font-weight: 700; line-height: 1.3; }
.modal-body h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; color: var(--text-main); font-weight: 700; }
.modal-body h4 { font-size: 1.05rem; margin: 0.8rem 0 0.4rem; color: var(--text-main); font-weight: 700; }
.modal-body p { margin-bottom: 1rem; }
.modal-body a { color: var(--primary); text-decoration: underline; font-weight: 600; }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.modal-body b, .modal-body strong { font-weight: 700; color: var(--text-main); }

.modal-body ol, .modal-body ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
}

.modal-body li {
    margin-bottom: 0.35rem;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
}

.btn-edit-ext {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-close-modal {
    padding: 0.5rem 1.25rem;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- PROFILING GRID INTERACTIVE --- */
#pg-fisik-total-2, #pg-mental-total-2, #pg-emosi-total-2, #pg-intuisi-total-2 {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.profiling-grid-table th,
.profiling-grid-table td {
    border-color: #ffffff !important;
}

#pg-fisik-total-2[style*="cursor: pointer"]:hover,
#pg-mental-total-2[style*="cursor: pointer"]:hover,
#pg-emosi-total-2[style*="cursor: pointer"]:hover,
#pg-intuisi-total-2[style*="cursor: pointer"]:hover {
    background-color: rgba(91, 33, 182, 0.15) !important;
    color: #5b21b6 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.1);
}

/* Profiling Grid Interactive - Dominant (Green) */
#pg-fisik-total-1[style*="cursor: pointer"]:hover,
#pg-mental-total-1[style*="cursor: pointer"]:hover,
#pg-emosi-total-1[style*="cursor: pointer"]:hover,
#pg-intuisi-total-1[style*="cursor: pointer"]:hover {
    background-color: rgba(22, 163, 74, 0.15) !important;
    color: #16a34a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}


/* Ensure result boxes in other tabs also look premium */
.tab-pane .hasil-box {
    transition: all 0.2s ease;
}

.tab-pane .hasil-box:hover:not(.no-click) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    filter: brightness(1.02);
}

.tab-pane .hasil-box.no-click {
    cursor: default;
}

/* Responsive Table Fixes */
.pane-rumus table {
    min-width: 450px;
}

.pane-rumus div {
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

/* Particle Pop Animation */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    animation: particleOut 0.6s ease-out forwards;
}

@keyframes particleOut {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translate(var(--tx), var(--ty)) scale(0); 
        opacity: 0; 
    }
}

/* ══ FLOATING ACTION BUTTON (FAB) & PREVIEW MODALS ══════════════ */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    z-index: 9999;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

/* MAIN BUTTON PURE CSS IDLE FLOATING ANIMATION */
.fab-main-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--primary) 0%, #15803d 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.35), 0 8px 10px -6px rgba(22, 163, 74, 0.35);
    animation: fabFloat 3s ease-in-out infinite, fabPulse 3s ease-in-out infinite;
}

.fab-main-btn svg {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Pause idle float animation when hovered or active */
.fab-container:hover .fab-main-btn,
.fab-container.active .fab-main-btn {
    animation-play-state: paused;
}

.fab-container.active .fab-main-btn {
    transform: rotate(135deg) scale(0.95);
    background: linear-gradient(135deg, #be123c 0%, #9f1239 100%);
    box-shadow: 0 10px 25px -5px rgba(190, 18, 60, 0.35), 0 8px 10px -6px rgba(190, 18, 60, 0.35);
}

/* RADIAL SUBMENU ITEMS - Positioned exactly behind/inside main button at default */
.fab-submenu {
    position: absolute;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}

.fab-sub-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 48px;
    height: 48px;
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: scale(0.4) rotate(0deg);
    pointer-events: none;
    color: white;
}

/* RADIAL FAN-OUT POSITIONS (PURE CSS TRANSITIONS) ON ACTIVE */
/* Staggered radial translations with custom bezier curves & rotational spin */

/* Button 1: Simpan Gambar - Spreads straight UP (90 degrees) */
.fab-container.active #fabSaveImage {
    transform: translate(0, -90px) scale(1) rotate(360deg);
    opacity: 1;
    pointer-events: auto;
}
#fabSaveImage {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.05s;
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.35);
}
#fabSaveImage:hover {
    background: linear-gradient(135deg, #3730a3 0%, #1e1b4b 100%);
    transform: translate(0, -90px) scale(1.12) rotate(360deg);
    box-shadow: 0 8px 20px rgba(67, 56, 202, 0.5);
}

/* Button 2: Kirim ke WhatsApp - Spreads diagonally UP-LEFT (135 degrees) */
.fab-container.active #fabWhatsApp {
    transform: translate(-64px, -64px) scale(1) rotate(360deg);
    opacity: 1;
    pointer-events: auto;
}
#fabWhatsApp {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}
#fabWhatsApp:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translate(-64px, -64px) scale(1.12) rotate(360deg);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.5);
}

/* Button 3: Cetak Laporan - Spreads straight LEFT (180 degrees) */
.fab-container.active #fabPrint {
    transform: translate(-90px, 0) scale(1) rotate(360deg);
    opacity: 1;
    pointer-events: auto;
}
#fabPrint {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.15s;
    background: linear-gradient(135deg, #5b21b6 0%, #3b0764 100%);
    box-shadow: 0 6px 16px rgba(91, 33, 182, 0.35);
}
#fabPrint:hover {
    background: linear-gradient(135deg, #4c1d95 0%, #2e0854 100%);
    transform: translate(-90px, 0) scale(1.12) rotate(360deg);
    box-shadow: 0 8px 20px rgba(91, 33, 182, 0.5);
}

/* PURE CSS IDLE KEYFRAMES */
@keyframes fabFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

@keyframes fabPulse {
    0% {
        box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.35), 0 8px 10px -6px rgba(22, 163, 74, 0.35);
    }
    50% {
        box-shadow: 0 20px 35px -5px rgba(22, 163, 74, 0.55), 0 12px 18px -6px rgba(22, 163, 74, 0.55);
    }
    100% {
        box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.35), 0 8px 10px -6px rgba(22, 163, 74, 0.35);
    }
}

/* FAB Tooltips adjusted for radial layout */
.fab-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 10000;
}

/* Tooltip position for Simpan Gambar (Straight UP) -> Shows on LEFT */
#fabSaveImage .fab-tooltip {
    right: 58px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
}
#fabSaveImage:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Tooltip position for Kirim WhatsApp (Diagonal UP-LEFT) -> Shows on LEFT slanted */
#fabWhatsApp .fab-tooltip {
    right: 58px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
}
#fabWhatsApp:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Tooltip position for Cetak Laporan (Straight LEFT) -> Shows on TOP */
#fabPrint .fab-tooltip {
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
}
#fabPrint:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* PREVIEW MODAL SPECIFIC STYLING */
.fab-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-modal.show {
    opacity: 1;
    visibility: visible;
}

.fab-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    display: flex;
    flex-direction: column;
}

.fab-modal.show .fab-modal-content {
    transform: scale(1) translateY(0);
}

.fab-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fab-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fab-modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.fab-modal-close:hover {
    color: #be123c;
}

.fab-modal-body {
    padding: 1.5rem;
    max-height: 65vh;
    overflow-y: auto;
}

.fab-preview-card {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    position: relative;
    overflow: hidden;
}

.fab-preview-img-container {
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: white;
    display: none;
}

.fab-preview-img-container img {
    width: 100%;
    height: auto;
    display: block;
}

.fab-preview-placeholder {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fab-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

/* MOCK INTERFACES inside Modal */
.fab-form-group {
    margin-bottom: 1.25rem;
}

.fab-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fab-input-text {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-main);
    background: white;
    outline: none;
    transition: all 0.2s;
}

.fab-input-text:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.fab-btn-action {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fab-btn-action.secondary {
    background: #e2e8f0;
    color: #475569;
}

.fab-btn-action.secondary:hover {
    background: #cbd5e1;
}

.fab-btn-action.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.fab-btn-action.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}

/* Spinner */
.fab-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin-bottom: 0.75rem;
}

/* Print configuration styles */
.print-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Responsive FAB */
@media (max-width: 768px) {
    .fab-container {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .fab-btn {
        width: 50px;
        height: 50px;
    }
    
    .fab-sub-btn {
        width: 44px;
        height: 44px;
    }
    
    .fab-tooltip {
        display: none !important; /* Hide tooltips on touch devices */
    }
}

/* Daily Energy Card Styling */
.daily-energy-card {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: #f8fafc;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.daily-energy-card:hover {
    border-color: rgba(22, 163, 74, 0.25);
    background: #f1f5f9;
}

.daily-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.daily-header svg {
    color: var(--daily-accent, var(--primary));
    width: 14px;
    height: 14px;
}

.daily-body {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.daily-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--daily-accent, var(--primary));
    color: var(--daily-accent, var(--primary));
    font-size: 1.45rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.daily-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
}

.daily-content h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.daily-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* === COSMIC DARK MODE === */
body[data-theme="dark"] {
    --bg: #090d16;
    --surface: rgba(17, 24, 39, 0.7);
    --surface-solid: #111827;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(51, 65, 85, 0.4);
    --border-light: rgba(30, 41, 59, 0.4);
    
    /* Custom colors on dark background */
    --c-angka: #e63946;
    --c-karakter: #38b000;
    --c-fase: #f77f00;
    --c-nama: #7209b7;
    --c-elemen: #00b4d8;
    --c-profiling: #4361ee;
    --c-amber: #ffa600;
    --c-lime: #80b918;
    
    --focus-ring: rgba(0, 119, 182, 0.3);
    --radius: 6px;
}

body[data-theme="dark"] .kolom-kiri,
body[data-theme="dark"] .kolom-tengah,
body[data-theme="dark"] .kolom-kanan {
    background: rgba(17, 24, 39, 0.75);
    border-color: rgba(51, 65, 85, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .hasil-box {
    background-color: #1e293b;
    border-color: rgba(71, 85, 105, 0.4);
    color: #f1f5f9;
}

body[data-theme="dark"] .tab-item:hover {
    color: #ffffff;
}

body[data-theme="dark"] .tab-indicator {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] .tabs {
    background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .input-text {
    background-color: #1e293b;
    border-color: rgba(71, 85, 105, 0.4);
    color: #f8fafc;
}

body[data-theme="dark"] .input-text:focus {
    border-color: var(--primary);
}

body[data-theme="dark"] .daily-number-badge {
    background: #1e293b;
}

body[data-theme="dark"] .diagram-card {
    background: rgba(17, 24, 39, 0.5) !important;
    border-color: rgba(51, 65, 85, 0.4) !important;
}

body[data-theme="dark"] .modal-content {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

body[data-theme="dark"] .modal-body {
    color: #cbd5e1;
}

body[data-theme="dark"] .btn-close-modal {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .btn-close-modal:hover {
    background: #334155;
}

body[data-theme="dark"] #history-dropdown {
    background: #111827;
    border-color: rgba(51, 65, 85, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .dropdown-item {
    color: #cbd5e1;
    border-bottom-color: rgba(51, 65, 85, 0.4);
}

body[data-theme="dark"] .dropdown-item:hover {
    background-color: #1e293b;
}

body[data-theme="dark"] .profiling-grid-table th {
    color: #94a3b8;
}

body[data-theme="dark"] .profiling-grid-table td {
    color: #cbd5e1;
}

body[data-theme="dark"] .profiling-grid-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* === FLOATING THEME BUTTON === */
.floating-theme-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.floating-theme-btn:hover {
    transform: scale(1.1) rotate(15deg);
    color: var(--primary);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.floating-theme-btn:active {
    transform: scale(0.95);
}

body[data-theme="dark"] .floating-theme-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #fde047;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Sun/Moon visibility depending on active theme */
.floating-theme-btn .moon-icon { display: block; }
.floating-theme-btn .sun-icon { display: none; }

body[data-theme="dark"] .floating-theme-btn .moon-icon { display: none; }
body[data-theme="dark"] .floating-theme-btn .sun-icon { display: block; }

/* === STAGGERED FADE-IN ANIMATION === */
@keyframes fadeInUpStagger {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stagger-item {
    opacity: 0;
    animation: fadeInUpStagger 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* === TACTILE press down feedback === */
.hasil-item:active {
    transform: translateY(-2px) scale(0.97) !important;
    transition: transform 0.08s ease-out;
}

/* === SPOTLIGHT MOUSE GLOW === */
.hasil-box {
    position: relative;
}

.hasil-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        80px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
        rgba(91, 33, 182, 0.06),
        transparent 80%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

body[data-theme="dark"] .hasil-box::before {
    background: radial-gradient(
        85px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
        rgba(255, 255, 255, 0.08),
        transparent 80%
    );
}

.hasil-box:hover::before {
    opacity: 1;
}

/* Mobile adjustments for floating button positioning */
@media (max-width: 768px) {
    .floating-theme-btn {
        bottom: 1.5rem;
        right: 10.5rem; /* Avoid overlap with FAB container and role button */
        width: 44px;
        height: 44px;
    }
}

/* === LOGIN OVERLAY === */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45); /* dark translucent overlay */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100000; /* overlay everything */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    visibility: visible;
}
.login-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.login-card {
    background: rgba(30, 41, 59, 0.7); /* dark theme slate */
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    width: 90%;
    max-width: 680px;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: scaleUpLogin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleUpLogin {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
/* Light mode adjustments for login card */
body[data-theme="light"] .login-overlay {
    background: rgba(241, 245, 249, 0.5);
}
body[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 25px 50px -12px rgba(100, 116, 139, 0.2);
}
.login-brand h2 {
    font-size: 1.75rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.05em;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
body[data-theme="light"] .login-brand h2 {
    color: #1e293b;
}
.login-brand h2 span {
    color: #0077b6;
}
.login-brand p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
}
body[data-theme="light"] .login-brand p {
    color: #64748b;
}
.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(0, 119, 182, 0.15);
    color: #00b4d8;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    animation: rotateLogo 12s linear infinite;
}
@keyframes rotateLogo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.role-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .role-selector-grid {
        grid-template-columns: 1fr;
    }
}
.role-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}
body[data-theme="light"] .role-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.05);
}
.role-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 180, 216, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 180, 216, 0.15);
}
.role-card.pro:hover {
    border-color: rgba(114, 9, 183, 0.4);
    box-shadow: 0 10px 25px -5px rgba(114, 9, 183, 0.15);
}
.role-badge {
    position: absolute;
    top: -10px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.05em;
}
.role-badge.green {
    background: #38b000;
    color: white;
}
.role-badge.purple {
    background: #7209b7;
    color: white;
}
.role-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.25rem;
}
body[data-theme="light"] .role-icon {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
}
.role-card h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}
body[data-theme="light"] .role-card h3 {
    color: #1e293b;
}
.role-card p {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
    min-height: 48px;
}
body[data-theme="light"] .role-card p {
    color: #64748b;
}
.btn-role-action {
    width: 100%;
    border: none;
    border-radius: var(--radius);
    padding: 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-role-action.select-newbie {
    background: rgba(56, 176, 0, 0.1);
    color: #38b000;
    border: 1px solid rgba(56, 176, 0, 0.2);
}
.btn-role-action.select-newbie:hover {
    background: #38b000;
    color: white;
}
.btn-role-action.select-pro {
    background: rgba(114, 9, 183, 0.1);
    color: #7209b7;
    border: 1px solid rgba(114, 9, 183, 0.2);
}
.btn-role-action.select-pro:hover {
    background: #7209b7;
    color: white;
}
.passcode-field-wrapper {
    width: 100%;
    margin-top: 0.5rem;
    animation: scaleUpLogin 0.3s ease;
}
.passcode-field-wrapper input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: white;
    font-size: 0.85rem;
    text-align: center;
}
.passcode-field-wrapper input:focus {
    border-color: #7209b7;
    outline: none;
}
body[data-theme="light"] .passcode-field-wrapper input {
    background: white;
    border-color: #cbd5e1;
    color: #1e293b;
}
.login-footer p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}
/* Shaking animation for incorrect passcode */
.shake-animation {
    animation: shakeCard 0.4s ease;
}
@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* === LOCKING & BLURRING === */
.locked-section {
    position: relative;
    pointer-events: none !important;
    user-select: none !important;
}
.locked-section > :not(.lock-badge) {
    filter: blur(5px) !important;
    opacity: 0.35 !important;
}
.locked-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.04);
    z-index: 10;
    border-radius: var(--radius);
}
body[data-theme="dark"] .locked-section::after {
    background: rgba(15, 23, 42, 0.25);
}
.lock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    color: #64748b; /* Sleek slate color */
    pointer-events: auto !important; /* Allow clicking! */
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.lock-badge:hover {
    color: #0077b6; /* Vibrant Blue */
    transform: translate(-50%, -50%) scale(1.18); /* Enlarge on hover */
}
body[data-theme="dark"] .lock-badge {
    color: #94a3b8;
}
body[data-theme="dark"] .lock-badge:hover {
    color: #00b4d8; /* Teal */
}

/* === FLOATING ROLE BUTTON === */
.floating-role-btn {
    position: fixed;
    bottom: 2rem;
    right: 6.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.floating-role-btn:hover {
    transform: scale(1.1);
    color: #0077b6;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.floating-role-btn:active {
    transform: scale(0.95);
}
body[data-theme="dark"] .floating-role-btn {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
body[data-theme="dark"] .floating-role-btn:hover {
    color: #00b4d8;
}

/* Adjustments for theme toggle button to accommodate role button */
.floating-theme-btn {
    position: fixed;
    bottom: 2rem;
    right: 11rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
@media (max-width: 768px) {
    .floating-role-btn {
        bottom: 1.5rem;
        right: 6.5rem;
        width: 44px;
        height: 44px;
    }
    .floating-theme-btn {
        bottom: 1.5rem;
        right: 10.5rem;
        width: 44px;
        height: 44px;
    }
}

/* === ACTION TOAST === */
.action-toast {
    position: fixed;
    bottom: 2.2rem;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}
.action-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
body[data-theme="light"] .action-toast {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e293b;
    box-shadow: 0 10px 25px rgba(100, 116, 139, 0.15);
}
body.no-scroll {
    overflow: hidden !important;
}

/* Wiggle shake animation for standalone lock icon */
@keyframes shakeIcon {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    15%, 45%, 75% { transform: translate(-54%, -50%) rotate(-10deg); }
    30%, 60%, 90% { transform: translate(-46%, -50%) rotate(10deg); }
}
.shake-icon-animation {
    animation: shakeIcon 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* === MOBILE BOTTOM NAV === */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom)) !important;
    }
    
    .floating-role-btn {
        display: none !important;
    }
    
    .floating-theme-btn {
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        right: 16px !important;
        z-index: 998 !important;
    }
    
    .fab-container {
        bottom: calc(136px + env(safe-area-inset-bottom)) !important;
        right: 16px !important;
        z-index: 998 !important;
    }
    
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(226, 232, 240, 0.6);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
        transition: all 0.3s ease;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
    }
    
    body[data-theme="dark"] .mobile-bottom-nav {
        background: rgba(15, 23, 42, 0.75);
        border-top: 1px solid rgba(51, 65, 85, 0.6);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #64748b;
        cursor: pointer;
        padding: 4px;
        flex: 1;
        height: 100%;
        transition: all 0.2s ease;
        gap: 4px;
    }
    
    body[data-theme="dark"] .nav-item {
        color: #94a3b8;
    }
    
    .nav-item:active {
        transform: scale(0.92);
    }
    
    .nav-item svg {
        transition: transform 0.2s ease, color 0.2s ease;
        color: inherit;
    }
    
    .nav-item:hover svg {
        transform: translateY(-2px);
    }
    
    .nav-item.active {
        color: var(--theme-color, var(--primary)) !important;
        font-weight: 700;
    }
    
    .nav-item.active svg {
        transform: translateY(-2px) scale(1.05);
        color: var(--theme-color, var(--primary)) !important;
    }
    
    .nav-label {
        font-size: 0.52rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        text-transform: uppercase;
        color: inherit;
    }
    
    /* Theme icon visibility mapping */
    .theme-icon-container {
        position: relative;
        width: 20px;
        height: 20px;
    }
    
    .theme-icon-container svg {
        position: absolute;
        top: 0;
        left: 0;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    
    body[data-theme="light"] .theme-icon-container .sun-icon { opacity: 0; transform: scale(0.5); }
    body[data-theme="light"] .theme-icon-container .moon-icon { opacity: 1; transform: scale(1); }
    body[data-theme="dark"] .theme-icon-container .sun-icon { opacity: 1; transform: scale(1); }
    body[data-theme="dark"] .theme-icon-container .moon-icon { opacity: 0; transform: scale(0.5); }
}

