
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;600;800&display=swap');

:root {
    --bg1: #0b0510;
    --bg2: #23042e;
    --accent: #8b3cff;
    --accent-2: #6b2dff;
    --glass: rgba(255, 255, 255, 0.04);
}

/* ================= GLOBAL ================= */
* {
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(circle at 10% 10%, rgba(139, 60, 255, 0.12), transparent 10%),
        linear-gradient(180deg, var(--bg2), var(--bg1));
    color: #fff;
    overflow: hidden;
}

/* ================= NAVBAR ================= */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 48px;
}

.nav .logo {
    font-weight: 800;
    letter-spacing: 1px;
}

.nav nav a {
    color: rgba(255, 255, 255, 0.7);
    margin-left: 18px;
    text-decoration: none;
}

/* ================= HERO ================= */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: calc(100% - 80px);
    padding: 20px 60px;
    position: relative;
}

.content {
    max-width: 820px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ================= TITLE ================= */
.title {
    display: flex;
    align-items: flex-end;
    gap: 22px;
}

.title .big {
    font-size: 72px;
    letter-spacing: 6px;
    font-weight: 800;
}

.subtitle {
    margin-top: 8px;
    color: rgba(255,255,255,0.7);
}

/* ================= CARD ================= */
.card {
    margin-top: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    padding: 28px;
    border-radius: 18px;
    width: 520px;
}

/* ================= TIMER ================= */
.timer {
    font-size: 64px;
    font-weight: 800;
    padding: 18px 0;
}

/* ================= CONTROLS ================= */
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border: none;
    color: white;
    padding: 12px 22px;
    border-radius: 28px;
    font-weight: 700;
    cursor: pointer;
}

.btn.secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
}

/* ================= MODES ================= */
.modes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.mode {
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: white;
    cursor: pointer;
}

.mode.active {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ================= ROUND ================= */
.stat-box {
    margin-top: 18px;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: #a29bfe;
}

#roundDisplay {
    font-size: 1.2rem;
    font-weight: bold;
}

/* ================= SETTINGS PANEL ================= */
/* ================= SETTINGS PANEL ================= */
.settings-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(4px);
}

.settings-panel.open {
    display: flex;
}

.settings-content {
    background: #2b213a;
    padding: 24px;
    border-radius: 18px;
    width: 320px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid #4a3b69;
}

/* LABEL + INPUT */
.settings-content label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.settings-content input[type="number"] {
    background-color: #3e3354;
    border: 1px solid #5c4e7a;
    color: white;
    padding: 10px;
    border-radius: 12px;
    width: 70px;
    text-align: center;
    outline: none;
    font-weight: bold;
}

/* ===== HAPUS PANAH NAIK TURUN ===== */
/* Chrome, Edge, Safari */
.settings-content input[type="number"]::-webkit-inner-spin-button,
.settings-content input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.settings-content input[type="number"] {
    -moz-appearance: textfield;
}

/* ================= BUTTON KE TENGAH ================= */
.settings-buttons {
    display: flex;
    justify-content: center;   /* 🔥 KE TENGAH */
    gap: 16px;
    margin-top: 24px;
}

.settings-buttons button {
    padding: 10px 26px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

/* APPLY */
#applyBtn {
    background: linear-gradient(90deg, #8b3cff, #6b2dff);
    color: white;
}

/* CLOSE */
#closeSettings {
    background: transparent;
    border: 2px solid #a29bfe;
    color: #a29bfe;
}

/* ================= TASK PANEL ================= */
.tasks-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.tasks-panel.open {
    display: flex;
}

.tasks-content {
    width: 380px;
    background: #2b213a;
    padding: 20px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ADD TASK (INPUT + RONDE) */
.add-task {
    display: flex;
    gap: 8px;
}

.add-task input[type="text"] {
    flex: 1;
}

.add-task input[type="number"] {
    width: 70px;
    text-align: center;
    font-weight: bold;
}

.add-task input {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #5c4e7a;
    background: #3e3354;
    color: white;
}

.add-task button {
    width: 42px;
    border-radius: 12px;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: white;
}

/* TASK LIST */
.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 260px;
    overflow-y: auto;
}

.task-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.06);
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.task-list button {
    background: transparent;
    border: none;
    color: #ff7675;
    cursor: pointer;
}

/* ================= TASKS DISPLAY (DI BAWAH TIMER) ================= */
.tasks-display {
    margin-top: 30px;
    width: 520px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.1);
}

.tasks-title {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #a29bfe;
    text-align: center;
    font-weight: 600;
}

.active-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.task-item-display {
    background: rgba(255,255,255,0.05);
    padding: 12px 15px;
    border-radius: 12px;
    border-left: 4px solid #8b3cff;
    display: flex;
    align-items: center;
    gap: 15px;
}

.task-name {
    flex: 1;
    font-weight: 500;
    color: white;
    font-size: 0.95rem;
}

.task-rounds {
    display: flex;
    align-items: baseline;
    min-width: 100px;
}

.rounds-left {
    font-weight: 800;
    font-size: 1.2rem;
    color: #8b3cff;
}

.rounds-total {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-right: 5px;
}

.task-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.task-progress-bar {
    width: 100px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b3cff, #6b2dff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Progress Summary */
.progress-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.progress-text {
    font-weight: 800;
    color: #8b3cff;
    font-size: 1.1rem;
}

.overall-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b3cff, #6b2dff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.tasks-count {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.more-tasks {
    text-align: center;
    padding: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    font-style: italic;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-top: 5px;
}

.no-tasks {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.1);
}

/* Responsif */
@media (max-width: 600px) {
    .tasks-display {
        width: 100%;
    }
    
    .task-item-display {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .task-rounds {
        width: 100%;
        justify-content: space-between;
    }
    
    .task-progress-bar {
        width: 100%;
    }
}

/* ================= EDIT TASK MODAL ================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #2b213a;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #4a3b69;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px;
    background: rgba(139, 60, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4a3b69;
}

.modal-header h3 {
    margin: 0;
    color: #d1ccc0;
    font-size: 1.3rem;
}

.close-modal {
    background: none;
    border: none;
    color: #a29bfe;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(162, 155, 254, 0.1);
}

.modal-body {
    padding: 25px 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: 500;
    font-size: 0.95rem;
}

.modal-input {
    width: 100%;
    padding: 12px 15px;
    background: #3e3354;
    border: 1px solid #5c4e7a;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
}

.modal-input:focus {
    border-color: #9c88ff;
    box-shadow: 0 0 0 2px rgba(156, 136, 255, 0.2);
}

.round-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.round-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.round-btn:hover {
    transform: scale(1.1);
}

.round-btn.minus {
    background: linear-gradient(90deg, #ff7675, #d63031);
}

.round-controls input {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.modal-footer {
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #4a3b69;
}

/* ================= TASK ACTIONS ================= */
.task-actions {
    display: flex;
    gap: 8px;
}

.edit-btn, .delete-btn {
    background: transparent;
    border: none;
    color: #a29bfe;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: rgba(139, 60, 255, 0.1);
    color: #8b3cff;
}

.delete-btn {
    color: #ff7675;
}

.delete-btn:hover {
    background: rgba(255, 118, 117, 0.1);
}

.task-actions-display {
    margin-left: 10px;
}

.edit-task-btn {
    background: rgba(139, 60, 255, 0.1);
    border: 1px solid rgba(139, 60, 255, 0.3);
    color: #a29bfe;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.edit-task-btn:hover {
    background: rgba(139, 60, 255, 0.2);
    color: #8b3cff;
    transform: scale(1.1);
}

/* ================= TASK DISPLAY ENHANCEMENT ================= */
.task-text {
    cursor: pointer;
    transition: color 0.2s;
    flex: 1;
}

.task-text:hover {
    color: #a29bfe;
}

/* Responsif untuk modal */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
    }
    
    .modal-footer {
        justify-content: center;
    }
    
    .round-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .round-controls input {
        order: 1;
        margin-bottom: 10px;
    }
    
    .round-btn {
        width: 100%;
        border-radius: 12px;
        height: 45px;
    }
}

/* Hapus panah spinner di input number */
.modal-input::-webkit-inner-spin-button,
.modal-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.modal-input {
    -moz-appearance: textfield;
}

/* ================= HISTORY PANEL ================= */
.history-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.history-panel.open {
    display: flex;
}

.history-content.report-mode {
    width: 500px;
    max-width: 95%;
    background: #2b213a;
    padding: 24px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    border: 1px solid #4a3b69;
    max-height: 85vh;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.total-hours {
    background: rgba(139, 60, 255, 0.2);
    color: #a29bfe;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 10px;
}

.report-header {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    padding: 0 10px 10px 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.report-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}


.date-header {
    margin: 15px 0 8px 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    border-left: 4px solid #8b3cff;
    padding-left: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
}

.report-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.report-row:hover {
    background: rgba(255,255,255,0.03);
}

.col-time {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
}

.col-task {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 10px;
}

.task-name-log {
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-label-log {
    font-size: 0.75rem;
    margin-top: 2px;
}

.lbl-focus { color: #fab1a0; }
.lbl-short { color: #81ecec; }
.lbl-long { color: #74b9ff; }

.col-duration {
    text-align: right;
    font-weight: 700;
    color: #a29bfe;
}

.report-list::-webkit-scrollbar {
    width: 6px;
}
.report-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}