/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&family=Poppins:wght@200;300;400;500;600;700;800;900&display=swap');
:root {
    --primary-light: #6c5ce7;
    --primary-dark: #a66efa;
    --background-light: #f8f9fa;
    --background-dark: #1a1a2e;
    --text-light: #2d3436;
    --text-dark: #e6e6e6;
    --success: #00b894;
    --danger: #ff7675;
    --warning: #fdcb6e;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --base-font-size: 1rem;
    --heading-scale: 1.5;
    --subheading-scale: 1.25;
}

[data-theme="dark"] {
    --background-color: var(--background-dark);
    --text-color: var(--text-dark);
    --primary-color: var(--primary-dark);
    --secondary-color: #2d2d44;
    --input-bg: #2d2d44;
}

[data-theme="light"] {
    --background-color: var(--background-light);
    --text-color: var(--text-light);
    --primary-color: var(--primary-light);
    --secondary-color: #e3e3e3;
    --input-bg: #ffffff;
}

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

body {
    background: var(--background-color);
    color: var(--text-color);
    transition: var(--transition);
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    padding: 2rem;
}

.todo-app {
    max-width: 800px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#input-box, #due-date, #category, button {
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 1rem;
}

#input-box {
    flex: 2;
    background: var(--input-bg);
    color: var(--text-color);
}

#due-date, #category {
    flex: 1;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
}

button {
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.filter-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#search, #filter {
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--input-bg);
    color: var(--text-color);
    width: 100%;
}

.stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

ul {
    list-style: none;
}

ul li {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--input-bg);
    border-radius: 8px;
    transition: var(--transition);
    gap: 1rem;
}

ul li:hover {
    transform: translateX(5px);
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox.checked::after {
    content: "✓";
    color: white;
    font-size: 14px;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.task-content div:first-child {
    font-weight: 500;
}

.task-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.actions i {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: var(--transition);
}

.actions i:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fa-trash { color: var(--danger); }
.fa-edit { color: var(--primary-color); }

/* Completed Task Styling */
ul li.checked {
    background: rgba(0, 184, 148, 0.1);
}

ul li.checked .task-content div:first-child {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Edit Modal */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--input-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 0.8rem 1.5rem;
}

.modal-actions .cancel {
    background: var(--secondary-color);
    color: var(--text-color);
}

/* Alert System */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards, fadeOut 0.3s ease-in 1.7s forwards;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--success);
    border-left: 4px solid #009c7a;
}

.alert-error {
    background: var(--danger);
    border-left: 4px solid #e66868;
}

.alert i {
    font-size: 1.2rem;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .todo-app {
        padding: 1rem;
        margin: 1rem auto;
    }

    .row {
        flex-direction: column;
    }

    #input-box, #due-date, #category, button {
        width: 100%;
    }

    .filter-section {
        flex-direction: column;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .task-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .actions {
        flex-direction: column;
    }
    .app-header h1{
        font-size: 20px;
    }
    .alert {
        width: 90%;
        right: 5%;
    }
}