/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* 
.title-flip {
  perspective: 1000px;
  display: inline-block;
}

.title-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.title-flip:hover .title-flip-inner {
  transform: rotateY(180deg);
}

.title-flip-front, .title-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 1.1rem;
} */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    transition: all 0.3s ease;
}

/* ===== DARK MODE STYLES ===== */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

body.dark-mode .container {
    background: rgba(26, 26, 46, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.5));
    }

    to {
        filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8));
    }
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

body.dark-mode .subtitle {
    color: #ccc;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ===== STATS DASHBOARD ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    transform: translateY(0);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:nth-child(2) {
    background: linear-gradient(45deg, #a8edea, #fed6e3);
}

.stat-card:nth-child(3) {
    background: linear-gradient(45deg, #ffecd2, #fcb69f);
}

.stat-card:nth-child(4) {
    background: linear-gradient(45deg, #c3cfe2, #c3cfe2);
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== INPUT SECTION ===== */
.input-section {
    background: rgba(255, 255, 255, 0.8);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.dark-mode .input-section {
    background: rgba(26, 26, 46, 0.8);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.todo-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.todo-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

body.dark-mode .todo-input {
    background: #2a2a3e;
    border-color: #444;
    color: #fff;
}

.add-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.add-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.add-btn:hover::before {
    left: 100%;
}

/* ===== OPTIONS ROW ===== */
.options-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.select-group label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

body.dark-mode .select-group label {
    color: #ccc;
}

.select-group select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-group select:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

body.dark-mode .select-group select {
    background: #2a2a3e;
    border-color: #444;
    color: #fff;
}

/* ===== CONTROLS ===== */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

body.dark-mode .search-box {
    background: #2a2a3e;
    border-color: #444;
    color: #fff;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

body.dark-mode .filter-btn {
    background: #2a2a3e;
    border-color: #444;
    color: #fff;
}

/* ===== TODO LIST ===== */
.todo-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.todo-list::-webkit-scrollbar {
    width: 8px;
}

.todo-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
}

.todo-item {
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

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

.todo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

body.dark-mode .todo-item {
    background: rgba(42, 42, 62, 0.9);
}

.todo-item.completed {
    opacity: 0.7;
    transform: scale(0.98);
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #999;
}

/* ===== CHECKBOX ===== */
.todo-checkbox {
    width: 25px;
    height: 25px;
    border: 3px solid #ddd;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.todo-checkbox:hover {
    border-color: #667eea;
    transform: scale(1.1);
}

.todo-checkbox.checked {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: #667eea;
}

.todo-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* ===== TODO CONTENT ===== */
.todo-content {
    flex: 1;
}

.todo-text {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.todo-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.priority-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: linear-gradient(45deg, #ff6b6b, #ffa8a8);
    color: white;
}

.priority-medium {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: white;
}

.priority-low {
    background: linear-gradient(45deg, #48dbfb, #0abde3);
    color: white;
}

.category-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.todo-date {
    font-size: 0.8rem;
    color: #999;
}

/* ===== ACTION BUTTONS ===== */
.todo-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999;
}

.action-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: scale(1.1);
}

.action-btn.delete:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.action-btn.star {
    color: #feca57;
}

.action-btn.star.active {
    color: #ff9ff3;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

/* ===== FLOATING ELEMENTS ===== */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.floating-circle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-circle:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.floating-circle:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(120deg);
    }

    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }

    .title {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .controls {
        flex-direction: column;
    }

    .search-box {
        min-width: 100%;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== LOADING ANIMATION ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}