* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #bb3d35;
    --secondary-red: #c93f35;
    --dark-red: #d7493d;
    --light-red: #ff6b88;
    --red-gradient: linear-gradient(135deg, #bb3d35, #c93f35, #ff6b88);
    --red-gradient-dark: linear-gradient(135deg, #c44569, #ff2d5f, #ff4757);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--red-gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-primary);
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animated particles background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: floatParticle 20s infinite linear;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 20s;
}

.particle:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 30s;
}

.particle:nth-child(4) {
    left: 70%;
    animation-delay: 6s;
    animation-duration: 22s;
}

.particle:nth-child(5) {
    left: 80%;
    animation-delay: 8s;
    animation-duration: 28s;
}

.particle:nth-child(6) {
    left: 90%;
    animation-delay: 10s;
    animation-duration: 26s;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px 30px;
    box-shadow: var(--shadow);
    animation: slideInDown 0.8s ease-out;
}

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

.logo i {
    font-size: 2.5rem;
    color: var(--text-primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #fff, #ffccd5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    transform: translateY(-10px);
}

.stats {
    display: flex;
    gap: 25px;
}

.stat-item {
    text-align: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Input section */
.input-section {
    margin-bottom: 25px;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.input-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    background: rgba(255, 235, 238, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.input-group {
    position: relative;
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
    z-index: 2;
    transition: color 0.3s ease;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

select option {
    background: #c93f35;
    color: #ffffff;
    padding: 10px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.input-group input:focus + .input-icon,
.input-group select:focus + .input-icon {
    color: var(--text-primary);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.priority-group {
    min-width: 150px;
}

.add-btn {
    background: var(--red-gradient-dark);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    min-width: 140px;
    justify-content: center;
}

.add-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    background: var(--red-gradient);
}

.add-btn:active {
    transform: translateY(-1px);
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(255, 235, 238, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 25px;
    box-shadow: var(--shadow);
    animation: slideInLeft 0.8s ease-out 0.4s both;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 2;
}

#searchInput {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

#searchInput::placeholder {
    color: var(--text-secondary);
}

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

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--red-gradient-dark);
    color: var(--text-primary);
    border-color: transparent;
    transform: translateY(-2px);
}

.clear-btn {
    background: rgba(255, 77, 77, 0.2);
    color: #6b0000;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background: rgba(255, 77, 77, 0.3);
    transform: translateY(-2px);
}

/* Task sections */
.todo-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.priority-section {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: slideInRight 0.8s ease-out 0.6s both;
}

.priority-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header h2,
.stat-label {color: #ffdede;}

.section-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title i {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.section-title h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.task-count {
    background: var(--red-gradient-dark);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.collapse-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.task-container {
    padding: 20px;
    min-height: 100px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) transparent;
}

.task-container::-webkit-scrollbar {
    width: 6px;
}

.task-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.task-container::-webkit-scrollbar-thumb {
    background: var(--red-gradient-dark);
    border-radius: 3px;
}

/* Task items */
.todo-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    animation: taskSlideIn 0.5s ease-out;
}

@keyframes taskSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.todo-item.completed {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.02);
}

.todo-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    position: relative;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.todo-item input[type="checkbox"]:checked {
    background: var(--red-gradient-dark);
    border-color: transparent;
}

.todo-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.todo-item label {
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.todo-item.completed label {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-deadline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 10px;
}

.task-deadline.overdue {
    background: rgba(255, 77, 77, 0.3);
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

.delete-button {
    background: rgba(255, 77, 77, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.delete-button:hover {
    background: rgba(255, 77, 77, 0.4);
    transform: scale(1.05);
}

.delete-button i {
    font-size: 12px;
}

/* Progress section */
.progress-section {
    background: rgba(255, 249, 249, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    animation: slideInUp 0.8s ease-out 0.8s both;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--red-gradient);
    border-radius: 6px;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    animation: toastSlideIn 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.warning {
    border-left: 4px solid #ff9800;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .stats {
        justify-content: center;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .input-group {
        min-width: auto;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        max-width: none;
        width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .todo-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .todo-item label {
        order: 1;
        flex-basis: 100%;
    }
    
    .todo-item input[type="checkbox"] {
        order: 2;
    }
    
    .task-deadline {
        order: 3;
        margin-left: 0;
    }
    
    .delete-button {
        order: 4;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .stats {
        gap: 15px;
    }
}

.filter-btn[data-filter="all"].active {
    background: linear-gradient(135deg, #ff5e62, #ff5500);
}
.filter-btn[data-filter="pending"].active {
    background: linear-gradient(135deg, #ff7f4c, #ff0000);
}
.filter-btn[data-filter="completed"].active {
    background: linear-gradient(135deg, #6b73ff, #6bb8ff);
}

.high-priority-section .section-title i {
    color: #ff0004;
}
.low-priority-section .section-title i {
    color: #6bb8ff;
}

.high-priority-section .todo-item {
    border-left: 3px solid #3e1718;
}
.low-priority-section .todo-item {
    border-left: 3px solid #6bb8ff;
}

.progress-fill {
    background: linear-gradient(135deg, #ff5e62, #fc6418, #ff0004);
}

.stat-item:nth-child(1):hover {
    background: rgba(255, 94, 98, 0.2);
}
.stat-item:nth-child(2):hover {
    background: rgba(102, 187, 255, 0.2);
}
.stat-item:nth-child(3):hover {
    background: rgba(255, 153, 102, 0.2);
}

.developer-credit {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    color: #e0e0e0;
    opacity: 0.75;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 100;
    transition: all 0.3s ease;
    letter-spacing: 0.4px;
}

.developer-credit:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.015);
    box-shadow: 0 6px 18px rgba(255, 193, 111, 0.35);
}

.explorer-signature {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 500;
    font-size: 1.2rem;
    color: #f3f3f3;
    letter-spacing: 0.5px;
}

.eccentric {
    font-weight: 700;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(90deg, #01ff0d, #7a0101, #833ab4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    background-size: 200% auto;
    animation: shimmerText 4s ease infinite;
}

@keyframes shimmerText {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}