/* =========================
    GLOBAL
========================= */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    background: linear-gradient(135deg, #5959a5, #4e8785);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =========================
    CONTAINER
========================= */
.container {
    width: 600px;
    max-height: 100vh;
    overflow: hidden;
    padding: 25px;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    color: white;
}

h1 {
    text-align: center;
}

/* =========================
    INPUT & FORM
========================= */
.input-section,
.tools {
    display: flex;
    gap: 10px;
}

.input-section {
    padding-bottom: 20px;
}

.tools {
    margin-top: 15px;
}

input {
    flex: 1;
}

input,
select {
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
}

input::placeholder {
    color: rgba(255,255,255,0.6);
}

input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

/* =========================
    BUTTON
========================= */
button {
    padding: 12px 15px;
    border: none;
    border-radius: 10px;
    background: #ffffff33;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: #ffffff55;
}

button:active,
.dropdown-selected:active,
li:active {
    transform: scale(0.96);
}

/* Ripple */
button::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
}

button:active::after {
    transform: scale(2);
    opacity: 1;
    transition: 0.4s;
}

/* =========================
    FILTER ACTIVE
========================= */
.filters button.active {
    background: #ffffff55;
}

/* =========================
    PROGRESS
========================= */
.progress-container {
    height: 10px;
    margin-top: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
}

#progressBar {
    height: 100%;
    width: 0%;
    background: #2ecc71;
    border-radius: 10px;
    transition: 0.3s;
}

/* =========================
    TASK LIST
========================= */
ul {
    list-style: none;
    padding: 0;
}

#taskList {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    mask-image: linear-gradient(to bottom, black 90%, transparent);
}

/* Scrollbar */
#taskList::-webkit-scrollbar {
    width: 6px;
}

#taskList::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 10px;
}

/* Task Item */
li {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;

    background: rgba(255,255,255,0.2);

    animation: taskEnter 0.3s ease;
    transition: all 0.25s ease;
}

li:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    cursor: grab;
}

li.dragging {
    opacity: 0.6;
    transform: scale(0.95);
    cursor: grabbing;
}

/* =========================
    TASK STATE
========================= */
.completed {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-buttons button {
    margin-left: 5px;
}

/* =========================
    PRIORITY
========================= */
.priority {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12px;
    margin-left: 8px;
}

.priority.high { background: #e74c3c; }
.priority.medium { background: #f39c12; }
.priority.low { background: #2ecc71; }

.overdue {
    color: #ff6b6b;
}

/* =========================
    EMPTY STATE
========================= */
.empty-state {
    text-align: center;
    opacity: 0.7;
    padding: 40px 0;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 10px;
}

/* =========================
    MODAL
========================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 320px;
    padding: 25px;
    border-radius: 20px;
    color: white;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(15px);

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

    animation: modalFade 0.3s ease;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
}

/* Modal Buttons */
#btnSave { background: #4e8785; }
#btnSave:hover { background: #3b6f6d; }

#btnReplace { background: #4e8785; }
#btnMerge { background: #5959a5; }

/* =========================
    TOAST
========================= */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    padding: 12px;
    border-radius: 12px;
    color: white;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);

    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);

    animation: toastIn 0.3s ease;
    transition: 0.3s;
}

.toast:hover {
    transform: scale(1.03);
}

.toast.success { border-left: 4px solid #2ecc71; }
.toast.error { border-left: 4px solid #e74c3c; }
.toast.info { border-left: 4px solid #3498db; }

/* =========================
    CUSTOM DROPDOWN
========================= */
.custom-dropdown {
    position: relative;
    width: 150px;
}

.dropdown-selected {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Arrow animation */
.dropdown-selected i {
    transition: transform 0.3s;
}

.custom-dropdown.active .dropdown-selected i {
    transform: rotate(180deg);
}

/* Options */
.dropdown-options {
    position: absolute;
    width: 100%;
    top: 110%;

    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);

    border-radius: 12px;
    overflow: hidden;

    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;

    transition: all 0.25s ease;
    z-index: 100;
}

.custom-dropdown.active .dropdown-options {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-options div {
    padding: 10px;
    cursor: pointer;
}

.dropdown-options div:hover {
    background: rgba(255,255,255,0.2);
}

.dropdown-options div.active {
    background: rgba(255,255,255,0.3);
}

/* =========================
    ANIMATION
========================= */
@keyframes taskEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================
    DARK MODE
========================= */
.dark {
    background: #222;
}

.dark .container,
.dark li,
.dark .modal-content {
    background: rgba(0,0,0,0.3);
}

/* =========================
    RESPONSIVE
========================= */
@media (max-width: 768px) {
    .container { width: 90%; }
}

@media (max-width: 480px) {
    .input-section,
    .tools {
        flex-direction: column;
    }

    li {
        flex-direction: column;
        align-items: flex-start;
    }
}