:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #818cf8;
    --accent-light: #a5b4fc;
    --accent-hover: #6366f1;
    --accent-glow: rgba(129, 140, 248, 0.3);
    --success-light: rgba(16, 185, 129, 0.2);
    --danger-light: rgba(239, 68, 68, 0.2);
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, var(--accent-glow) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 24px;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    animation: slideDown 0.6s ease-out;
}

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

.greeting-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.greeting-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 8px;
}

.greeting-section h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.greeting-section h1:hover {
    transform: scale(1.02);
}

.datetime-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

.datetime-icon {
    font-size: 1rem;
}

.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 52px;
    height: 52px;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

.theme-btn:hover {
    background: var(--accent);
    transform: rotate(20deg) scale(1.05);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.theme-btn:hover .theme-icon {
    filter: brightness(10);
}

.main-content {
    display: grid;
    grid-template-columns: minmax(300px, 340px) 1fr;
    gap: 24px;
    align-items: start;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

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

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 100%);
    border-radius: 12px;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.task-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    margin: 20px 0;
    transition: all 0.3s ease;
    position: relative;
}

.timer-display.running {
    animation: timerGlow 2s infinite;
}

@keyframes timerGlow {
    0%, 100% {
        text-shadow: 0 0 20px var(--accent-glow);
    }
    50% {
        text-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-glow);
    }
}

.timer-separator {
    animation: blink 1s infinite;
    opacity: 1;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.timer-progress {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    margin-bottom: 24px;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--success) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.timer-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 12px;
}

.timer-settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.setting-icon {
    font-size: 1rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timer-settings input {
    width: 50px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.timer-settings input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.input-suffix {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.timer-controls {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.btn-icon {
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-add {
    width: 46px;
    height: 46px;
    padding: 0;
    flex: none;
}

.btn-add span {
    font-size: 1.4rem;
    font-weight: 600;
}

.todo-input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.todo-input-container input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.todo-input-container input::placeholder {
    color: var(--text-muted);
}

.todo-input-container input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
    background: var(--bg-card);
}

.todo-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.todo-list {
    list-style: none;
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    gap: 12px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
    border: 1px solid transparent;
}

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

.todo-item:hover {
    background: var(--bg-card);
    border-color: var(--border);
}

.todo-item.done {
    background: var(--success-light);
    border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .todo-item.done {
    background: rgba(16, 185, 129, 0.1);
}

.todo-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--success);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.todo-item input[type="checkbox"]:hover {
    transform: scale(1.15);
}

.todo-item span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.todo-item.done span {
    color: var(--text-muted);
    text-decoration: line-through;
}

.todo-item.removing {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    to { opacity: 0; transform: translateX(20px); }
}

.task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.task-actions button {
    width: 30px;
    height: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.task-actions button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.task-actions button:first-child:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.task-actions button:last-child:hover {
    background: var(--danger-light);
    border-color: var(--danger);
}

.link-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.link-input-container input {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.link-input-container input::placeholder {
    color: var(--text-muted);
}

.link-input-container input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
    background: var(--bg-card);
}

.link-input-container .btn-add {
    flex-shrink: 0;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 40px;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: popIn 0.3s ease-out backwards;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.quick-link-item:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-2px);
}

.quick-link-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-link-item a:hover {
    color: var(--accent);
}

.quick-link-item .delete-link {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.quick-link-item:hover .delete-link {
    opacity: 0.7;
}

.quick-link-item .delete-link:hover {
    opacity: 1;
    background: var(--danger-light);
}

.footer {
    text-align: center;
    padding: 40px 0 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.heart {
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.hidden { display: none; }

.modal-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 90%;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border: 1px solid var(--border);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.modal-content input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    text-align: center;
}

.modal-content input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: none;
    padding: 14px 28px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 30px 20px;
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

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

.footer {
    text-align: center;
    padding: 40px 0 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.heart {
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

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

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .column {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .links-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px 16px;
    }

    .header {
        margin-bottom: 24px;
    }

    .greeting-section h1 {
        font-size: 1.6rem;
    }

    .greeting-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .timer-display {
        font-size: 3rem;
    }

    .timer-controls {
        flex-wrap: wrap;
    }

    .timer-controls .btn {
        min-width: calc(50% - 5px);
    }

    .column {
        grid-template-columns: 1fr;
    }

    .links-card {
        grid-column: auto;
    }

    .link-input-container {
        flex-direction: column;
    }

    .link-input-container input {
        width: 100%;
    }

    .link-input-container .btn-add {
        width: 100%;
    }

    .modal-content {
        min-width: auto;
        margin: 16px;
        padding: 24px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-buttons .btn {
        width: 100%;
    }
}