/* ================================================= */
/* ================= GLOBAL ======================== */
/* ================================================= */

* {
    box-sizing: border-box;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    position: relative;
    overflow-x: hidden;

    background:
        radial-gradient(circle at 15% 10%, rgba(105, 205, 248, 0.8), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(78, 193, 255, 0.9), transparent 45%),
        radial-gradient(circle at 50% 100%, rgba(24, 141, 180, 0.9), transparent 50%),
        linear-gradient(160deg, #2494c0, #69b4ff 60%, #61fff4);

    background-size: cover;
}

/* Ambient Light Layer */
body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.6), transparent 70%);
    opacity: 0.6;
}

/* ================================================= */
/* ================= HEADER ======================== */
/* ================================================= */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;

    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9),
            rgba(240, 249, 255, 0.7));

    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);

    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 20px 50px rgba(186, 230, 253, 0.6);

    border-radius: 20px;
    margin: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.6px;
    background: linear-gradient(90deg, #ff6600, #f49200, #c75e02);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* ================================================= */
/* ================= LOGO ========================== */
/* ================================================= */

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-group img.logo {
    width: 46px;
    height: 46px;
    padding: 8px;
    border-radius: 14px;

    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.9),
            rgba(240, 249, 255, 0.6));

    backdrop-filter: blur(50px) saturate(200%);
    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 12px 30px rgba(56, 189, 248, 0.6);

    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-group img.logo:hover {
    transform: scale(1.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 25px 50px rgba(14, 165, 233, 0.7);
}

img.logo {
    width: 60px !important;
    height: 60px !important;
}

/* ================================================= */
/* ================= BUTTONS ======================= */
/* ================================================= */

.btn-primary,
.btn-secondary,
button {
    padding: 12px 20px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #0f172a;

    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 15px 35px rgba(56, 189, 248, 0.5);

    transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

.btn-primary {
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.9),
            rgba(240, 249, 255, 0.7)),
        linear-gradient(135deg, #38bdf8, #0ea5e9);
}

.btn-secondary,
button {
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 249, 255, 0.7));
}

.btn-primary:hover,
.btn-secondary:hover,
button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 25px 50px rgba(14, 165, 233, 0.8);
}

/* ================================================= */
/* ================= INPUT ========================= */
/* ================================================= */

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    color: #0f172a;
    outline: none;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 249, 255, 0.7));

    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);

    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 10px 25px rgba(186, 230, 253, 0.6);

    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    border: 1px solid rgba(14, 165, 233, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 0 0 3px rgba(56, 189, 248, 0.4),
        0 20px 40px rgba(14, 165, 233, 0.5);
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
    color: rgba(15, 23, 42, 0.5);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ================================================= */
/* ================= GRID ========================== */
/* ================================================= */

.task-container {
    padding: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* ================================================= */
/* ================= CARD ========================== */
/* ================================================= */

.task-card {
    padding: 22px;
    border-radius: 22px;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 249, 255, 0.7));

    backdrop-filter: blur(60px) saturate(200%);
    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 25px 60px rgba(186, 230, 253, 0.6);

    display: flex;
    flex-direction: column;
    gap: 10px;

    transition: all 0.4s cubic-bezier(.4, 0, .2, 1);
}

.task-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 40px 80px rgba(14, 165, 233, 0.6),
        0 0 70px rgba(186, 230, 253, 0.9);
}

/* ================================================= */
/* ================= MODAL ========================= */
/* ================================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(224, 242, 254, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(25px);
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 400px;
    padding: 28px;
    border-radius: 24px;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 249, 255, 0.8));

    backdrop-filter: blur(70px) saturate(200%);
    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 35px 90px rgba(14, 165, 233, 0.6);

    display: flex;
    flex-direction: column;
    gap: 12px;

    animation: fadeInGlass 0.4s ease forwards;
}

@keyframes fadeInGlass {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ================================================= */
/* ================= H-MIN SYSTEM ================== */
/* ================================================= */

.hmin-text {
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    width: fit-content;
    margin-top: 6px;
    backdrop-filter: blur(30px);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.hmin-normal {
    color: #0284c7;
    background: rgba(186, 230, 253, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.8);
}

.hmin-warning {
    color: #0f172a;
    background: linear-gradient(135deg,
            #fde68a,
            #fef3c7);
    box-shadow:
        0 0 20px rgba(253, 224, 71, 0.6),
        0 0 40px rgba(253, 224, 71, 0.4);
}

.hmin-danger,
.hmin-today,
.hmin-late,
.task-card.danger {
    background: linear-gradient(135deg, #bae6fd, #e0f2fe);
    color: #0f172a;
    box-shadow:
        0 0 30px rgba(56, 189, 248, 0.6),
        0 0 60px rgba(14, 165, 233, 0.5);
}

/* ================================================= */
/* ================= ANIMATIONS ==================== */
/* ================================================= */

@keyframes dangerPulse {
    0% {
        box-shadow:
            0 0 20px rgba(56, 189, 248, 0.5),
            0 0 40px rgba(14, 165, 233, 0.4);
    }

    50% {
        box-shadow:
            0 0 50px rgba(56, 189, 248, 0.8),
            0 0 80px rgba(14, 165, 233, 0.7);
    }

    100% {
        box-shadow:
            0 0 20px rgba(56, 189, 248, 0.5),
            0 0 40px rgba(14, 165, 233, 0.4);
    }
}

@keyframes lateShake {
    from {
        transform: translateX(-2px);
    }

    to {
        transform: translateX(2px);
    }
}

/* ================================================= */
/* ================= MOBILE RESPONSIVE ============= */
/* ================================================= */

@media screen and (max-width: 992px) {

    .task-container {
        padding: 28px;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .modal-content {
        width: min(92%, 420px);
        max-height: 90dvh;
    }
}


/* ================================================= */
/* ================= TABLET ======================== */
/* ================================================= */

@media screen and (max-width: 768px) {

    .header,
    .task-card,
    .modal-content,
    .logo-group img.logo,
    button,
    input,
    textarea,
    select {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    html,
    body {
        min-height: 100dvh;
    }

    body {
        background-attachment: scroll;
        background-size: cover;
        overflow-x: hidden;
    }

    /* ===== header stack ===== */
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px;
        margin: 14px;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .header-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .header-right button,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .header-left h1 {
        font-size: 20px;
        margin-right: 20px;
    }

    /* ===== logo ===== */
    .logo-group img.logo {
        width: 40px;
        height: 40px;
    }

    img.logo {
        width: 48px !important;
        height: 48px !important;
    }

    /* ===== grid ===== */
    .task-container {
        padding: 18px;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* ===== card ===== */
    .task-card {
        padding: 18px;
        border-radius: 18px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .task-card:hover {
        transform: none;
    }

    /* ===== modal ===== */
    .modal {
        padding: 18px;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        width: 100%;
        max-width: 420px;
        padding: 22px;
        border-radius: 22px;

        transform: translateY(30px) scale(0.96);
        opacity: 0;
        transition:
            transform 0.45s cubic-bezier(.16, 1, .3, 1),
            opacity 0.35s ease;
    }


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

    /* ===== input ===== */
    input,
    textarea,
    select {
        font-size: 16px;
    }

    /* ===== button ===== */
    .btn-primary,
    .btn-secondary,
    button {
        padding: 14px;
        font-size: 14px;
        margin: 5px;
    }
}


/* ================================================= */
/* ================= SMALL PHONE =================== */
/* ================================================= */

@media screen and (max-width: 480px) {

    .header {
        padding: 16px;
        margin: 12px;
        border-radius: 16px;
    }

    .task-container {
        padding: 16px;
        gap: 14px;
    }

    .modal {
        padding: 14px;
    }

    .modal-content {
        padding: 18px;
        border-radius: 20px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .hmin-text {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ================================================= */
/* ============ REMOVE DEFAULT BLUE EFFECT ========= */
/* ================================================= */

button,
input,
select,
textarea,
a {
    outline: none !important;

    -webkit-tap-highlight-color: transparent;
}

/* hilangkan focus & active bawaan browser */
button:focus,
button:active,
input:focus,
input:active,
select:focus,
select:active,
textarea:focus,
textarea:active,
a:focus,
a:active {
    outline: none !important;
}

/* hilangkan inner border khusus firefox */
button::-moz-focus-inner {
    border: 0;
}

/* ================================================= */
/* ================= FOOTER ======================== */
/* ================================================= */

.footer {
    margin-top: 80px;
    padding: 50px 60px;

    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);

    border-top: 1px solid rgba(186, 230, 253, 0.6);
}

.footer-content {
    max-width: 1200px;
    margin: auto;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 50px;
}

/* ================= LEFT ================= */

.footer-left h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.5px;
}

.footer-left p {
    margin-top: 10px;
    font-size: 14px;
    color: #334155;
    opacity: 0.8;
    max-width: 280px;
}

/* ================= RIGHT ================= */

.footer-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.footer-right p {
    margin: 0;
    font-size: 14px;
    color: #475569;
}

/* ================= LINKS ================= */

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    font-weight: 600;

    color: #0ea5e9;
    text-decoration: none;

    transition: all 0.2s ease;
}

.footer-link:hover {
    opacity: 0.7;
    transform: translateY(-1px);
}

/* ================= ICON ================= */

.footer-icon {
    width: 18px;
    height: 18px;
}

/* ================= RESPONSIVE ================= */

@media screen and (max-width: 768px) {

    .footer {
        padding: 40px 20px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .footer-right {
        align-items: center;
        text-align: center;
    }
}

/* ================================================= */
/* ================= STATISTICS ==================== */
/* ================================================= */

.stats-wrapper {
    max-width: 1200px;
    margin: 35px auto 0 auto;
    padding: 0 50px;
}

.stats-bubble {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    padding: 20px 30px;
    border-radius: 30px;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 249, 255, 0.75));

    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);

    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 25px 60px rgba(14, 165, 233, 0.35);

    transition: all 0.3s ease;
}

.stats-bubble:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 35px 70px rgba(14, 165, 233, 0.5);
}

/* ================= ITEM ================= */

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

/* Highlight telat */
.stat-value.danger {
    color: #dc2626;
}

/* Divider */
.stat-divider {
    width: 1px;
    height: 45px;
    background: rgba(148, 163, 184, 0.3);
}

/* ================= RESPONSIVE ================= */

@media screen and (max-width: 768px) {
    .stats-wrapper {
        padding: 0 20px;
    }

    .stats-bubble {
        gap: 20px;
        justify-content: center;
        padding: 22px;
    }

    .stat-divider {
        display: none;
    }
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
    /* biar ga nempel pinggir layar */
    overflow-y: auto;
    /* kalau layar kecil */
}

.modal-content {
    width: 100%;
    max-width: 500px;

    max-height: 90vh;
    /* Biar nggak lebih tinggi dari layar */
    overflow-y: auto;
    /* 🔥 ini bikin bisa discroll */

    border-radius: 20px;
}

#taskDesc {
    min-height: 140px;
    /* ubah jadi 160px / 180px kalau mau lebih gede */
    resize: vertical;
    /* bisa ditarik manual ke bawah */
}

.modal {
    display: none;
}

.modal.show {
    display: flex;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    /* bikin dia jadi boss terakhir */
}

.modal-content {
    position: relative;
    z-index: 10000;
}

/* ================================================= */
/* ================= ULTRA SMOOTH MODE ============ */
/* ================================================= */

/* ===== Global Smooth Transition ===== */
* {
    transition:
        background 0.4s ease,
        background-color 0.4s ease,
        color 0.3s ease,
        box-shadow 0.4s cubic-bezier(.4, 0, .2, 1),
        transform 0.4s cubic-bezier(.4, 0, .2, 1),
        border 0.3s ease,
        opacity 0.4s ease;
}

/* ===== Smooth Scroll Extra ===== */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ===== Remove Hard Movement ===== */
.task-card:hover {
    transform: translateY(-6px) scale(1.015);
}

/* ===== Glass Breathing Effect (Very Subtle) ===== */
@keyframes glassBreath {
    0% {
        backdrop-filter: blur(60px) saturate(200%);
    }

    100% {
        backdrop-filter: blur(65px) saturate(210%);
    }
}

.header,
.task-card,
.modal-content,
.stats-bubble,
.footer {
    animation: glassBreath 6s ease-in-out infinite alternate;
}

/* ===== Smooth Button Press ===== */
button:active,
.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* ===== Modal Super Smooth Entrance ===== */
.modal.show {
    animation: fadeModal 0.35s ease forwards;
}

@keyframes fadeModal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
}

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

/* ===== Ultra Smooth Hover Glow ===== */
.task-card:hover,
.btn-primary:hover,
.btn-secondary:hover {
    filter: brightness(1.03);
}

/* ===== Smooth Input Focus ===== */
input:focus,
textarea:focus,
select:focus {
    transform: scale(1.01);
}

/* ===== Disable Animation on Mobile for Performance ===== */
@media screen and (max-width: 768px) {

    .header,
    .task-card,
    .modal-content,
    .stats-bubble,
    .footer {
        animation: none !important;
    }

    * {
        transition: 0.25s ease;
    }
}

/* ================= DELETE ALERT ================= */

.delete-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 40, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;

    z-index: 9999;
}

.delete-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

.delete-alert-box {
    width: 360px;
    padding: 28px;

    border-radius: 22px;

    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    border: 1px solid rgba(255, 255, 255, 0.25);

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.25),
        inset 0 0 25px rgba(255, 255, 255, 0.15);

    text-align: center;

    transform: scale(0.85);
    opacity: 0;

    transition: all 0.35s cubic-bezier(.22, 1, .36, 1);
}

.delete-alert-overlay.show .delete-alert-box {
    transform: scale(1);
    opacity: 1;
}

.delete-alert-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.delete-alert-box h3 {
    margin: 10px 0 6px 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.delete-alert-box p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 22px;
}

.delete-alert-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.delete-alert-actions button {
    flex: 1;
    padding: 10px 0;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* tombol danger khusus */
.danger-btn {
    background: linear-gradient(135deg, #ff4d6d, #ff1e40);
    color: white;
    border: none;
}

.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 30, 64, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgb(0, 0, 0);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ================= DOWNLOAD BUTTON FIX ================= */

/* ================= DOWNLOAD BUTTON FIX ================= */

/* #downloadBtn {
    color: #000 !important;
}*/

#downloadBtn:hover {
    color: #000 !important;
}

/* ================= DOWNLOAD BUTTON FIX ================= */

/* #cancelTask {
    color: #000 !important;
} */

#cancelTask:hover {
    color: #000 !important;
}

/* ================= SEARCH ================= */

.search-wrapper {
    max-width: 1200px;
    margin: 25px auto 0 auto;
    padding: 0 50px;
}

#searchInput {
    width: 100%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
}

/* responsive */
@media screen and (max-width: 768px) {
    .search-wrapper {
        padding: 0 20px;
    }
}

/* ================= DARK MODE ================= */

body.dark {
    background: #121212;
    color: #f1f1f1;
}

body.dark .task-card {
    background: #1e1e1e;
    color: #f1f1f1;
}

body.dark input,
body.dark textarea,
body.dark select {
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
}

body.dark .modal-content {
    background: #1e1e1e;
}

body.dark .tab {
    background: #2a2a2a;
    color: white;
}

body.dark .tab.active {
    background: #4f46e5;
}

body.dark .search-wrapper input {
    background: #2a2a2a;
    color: white;
}

body.dark button {
    background: #333;
    color: white;
    border: 1px solid #444;
}

/* ===== DARK TOGGLE MINI ===== */

/* ===== FLOATING DARK TOGGLE ===== */

/* ===== FLOATING DARK TOGGLE (ROUNDED SQUARE) ===== */

.dark-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;

    width: 48px;
    height: 48px;

    border-radius: 14px;
    /* ini yang bikin rounded square */

    font-size: 20px;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);

    transition: all 0.3s ease;
    z-index: 999;
}

.dark-toggle:hover {
    transform: translateY(-3px);
}

/* versi dark */
body.dark .dark-toggle {
    background: #1e1e1e;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.dark-toggle:hover {
    transform: scale(1.1);
}

body.dark .dark-toggle {
    background: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark-toggle:hover {
    transform: scale(1.1);
}

body.dark .dark-toggle {
    background: #333;
}

.custom-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 28px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(253, 224, 71, 0.6), 0 0 60px rgba(253, 224, 71, 0.4);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(252, 211, 77, 0.7);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.custom-alert.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0% {
        transform: translateX(-50%) translateY(0);
    }

    25% {
        transform: translateX(-52%) translateY(0);
    }

    50% {
        transform: translateX(-48%) translateY(0);
    }

    75% {
        transform: translateX(-52%) translateY(0);
    }

    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* ================================================= */
/* ================= LOGIN PAGE ==================== */
/* ================================================= */

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    background: inherit;
    animation: glassBreath 6s ease-in-out infinite alternate;
}

.auth-container h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(90deg, #ff6600, #f49200, #c75e02);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-container input,
.auth-container select {
    width: 100%;
    max-width: 360px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 14px;
    font-size: 14px;
    color: #0f172a;
    border: 1px solid rgba(186, 230, 253, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 10px 25px rgba(186, 230, 253, 0.6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.7));
    outline: none;
    transition: all 0.3s ease;
}

.auth-container input:focus {
    border: 1px solid rgba(14, 165, 233, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 0 0 3px rgba(56, 189, 248, 0.4), 0 20px 40px rgba(14, 165, 233, 0.5);
    transform: scale(1.01);
}

.auth-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 360px;
    margin-top: 10px;
}

.auth-actions button {
    flex: 1;
    padding: 14px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    border: 1px solid rgba(186, 230, 253, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 15px 35px rgba(56, 189, 248, 0.5);
    transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

#loginBtn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.7)), linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #0f172a;
}

#registerBtn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 249, 255, 0.7));
    color: #0f172a;
}

.auth-actions button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 25px 50px rgba(14, 165, 233, 0.7);
}

/* ================= RESPONSIVE ================= */

@media screen and (max-width: 768px) {
    .auth-container {
        padding: 24px;
    }

    .auth-container h2 {
        font-size: 24px;
    }

    .auth-container input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .auth-actions button {
        padding: 12px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .auth-container {
        padding: 20px;
    }

    .auth-container h2 {
        font-size: 22px;
    }

    .auth-container input {
        font-size: 13px;
        padding: 10px 12px;
    }

    .auth-actions button {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ================= DARK MODE ================= */

body.dark .auth-container {
    background: #1e1e1e;
    color: #f1f1f1;
}

body.dark .auth-container input {
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
}

body.dark #loginBtn,
body.dark #registerBtn {
    background: #333;
    color: white;
    border: 1px solid #444;
}

/* ================================================= */
/* ================= PROFILE SCREEN ================ */
/* ================================================= */

#profileScreen {
    display: none;
    min-height: 100vh;
    padding: 40px 50px;
}

/* wrapper biar sejajar sama stats & search */
.profile-wrapper {
    max-width: 1000px;
    margin: 40px auto;
}

/* card utama profile */
.profile-card {
    padding: 40px;
    border-radius: 30px;

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.95),
            rgba(240, 249, 255, 0.75));

    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);

    border: 1px solid rgba(186, 230, 253, 0.8);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 30px 70px rgba(14, 165, 233, 0.4);

    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* title */
.profile-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(90deg, #ff6600, #f49200, #c75e02);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* info row */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-value {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

/* sekbid member list */
.sekbid-list {
    margin-top: 10px;
    padding: 20px;
    border-radius: 20px;

    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(186, 230, 253, 0.8);

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sekbid-list li {
    list-style: none;
    padding: 10px 14px;
    border-radius: 14px;

    background: rgba(186, 230, 253, 0.4);
    font-weight: 600;
}

/* back button */
.profile-back {
    align-self: flex-start;
}

/* ================= DARK MODE ================= */

body.dark #profileScreen {
    background: #121212;
}

body.dark .profile-card {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark .profile-value {
    color: #f1f1f1;
}

body.dark .sekbid-list {
    background: #2a2a2a;
    border: 1px solid #333;
}

body.dark .sekbid-list li {
    background: #333;
}

/* ================= RESPONSIVE ================= */

@media screen and (max-width: 768px) {

    #profileScreen {
        padding: 20px;
    }

    .profile-card {
        padding: 25px;
        border-radius: 22px;
    }

    .profile-title {
        font-size: 22px;
    }

    .profile-value {
        font-size: 18px;
    }
}

/* ================= PROFILE ================= */

.profile-card {
    background: var(--card-bg, #ffffff);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 400px;
    margin: auto;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8cff, #6fd3ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    margin: 0 auto 20px auto;
    box-shadow: 0 8px 20px rgba(79, 140, 255, 0.3);
}

.profile-card p {
    margin: 10px 0;
    font-size: 15px;
}

.comment-section {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-input {
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #ccc;
    resize: none;
}

.comment-btn {
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
}

/* ================= COMMENT LIST FIX ================= */

.comment-list {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.comment-item {
    margin-top: 6px;
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;

    /* 🔥 WRAP FIX */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.comment-item strong {
    flex-shrink: 0;
}

.delete-comment-btn {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.comment-item {
    font-size: 13px;
    margin-top: 4px;
}

/* ================= NOTIFICATION POPUP ================= */

.notif-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.notif-popup.show {
    display: flex;
}

.notif-popup-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.notif-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.notif-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
