:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #8b5cf6;
    --accent-hover: #7c3aed;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --font-main: 'Outfit', sans-serif;
    --danger: #ef4444;
    --success: #10b981;
    --cat-personal: #3b82f6;
    --cat-work: #a855f7;
    --cat-urgent: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-blob {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    animation: float 20s infinite ease-in-out;
}

.blob-2 {
    top: auto;
    bottom: -10%;
    left: auto;
    right: -10%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50px, 30px);
    }
}

.hidden {
    display: none !important;
}

/* Auth Container */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 0.5rem;
}

.auth-card .input-wrapper {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    height: 56px;
}

.auth-card .input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.auth-card input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    outline: none;
    padding: 0;
}

.auth-card input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin: 20px;
    transition: transform 0.3s ease;
}

/* Header */
.app-header {
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-badge-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.user-badge {
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 4px;
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: transparent;
    transition: all 0.2s;
}

.user-badge-btn:hover .user-badge {
    text-decoration-color: var(--accent-color);
}

.app-header h1 {
    font-weight: 700;
    font-size: 2rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}


.date-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Search Section */
.search-section {
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.search-icon {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

#searchInput {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    outline: none;
}

/* Input Group */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 2rem;
}

.input-wrapper.main-input {
    flex: 1 1 100%;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.extras-wrapper {
    flex: 1;
    display: flex;
    gap: 8px;
}

.date-input,
.category-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0 12px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    outline: none;
    height: 52px;
    cursor: pointer;
    flex: 1;
}

.date-input:focus,
.category-input:focus {
    border-color: var(--accent-color);
}

#taskInput {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
}

#taskInput::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

#addTaskBtn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

#addTaskBtn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

#addTaskBtn:active {
    transform: translateY(0);
}

/* Filters */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.4);
    padding: 4px;
    border-radius: 12px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Task List */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: transparent;
}

.task-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.task-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.task-checkbox-wrapper {
    position: relative;
    width: 22px;
    height: 22px;
}

.task-checkbox {
    appearance: none;
    width: 100%;
    height: 100%;
    border: 2px solid var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-checkbox:checked {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 14px;
}

.task-checkbox:checked+.checkbox-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* Task Content Structure */
.task-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.task-text {
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    word-break: break-all;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.task-date {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: capitalize;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
}

.badge-personal {
    color: var(--cat-personal);
    background: rgba(59, 130, 246, 0.1);
}

.badge-work {
    color: var(--cat-work);
    background: rgba(168, 85, 247, 0.1);
}

.badge-urgent {
    color: var(--cat-urgent);
    background: rgba(239, 68, 68, 0.1);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 4px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    opacity: 0.6;
}

.empty-state.hidden {
    display: none;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 1.5rem;
        margin: 10px;
        width: calc(100% - 20px);
    }

    .app-header h1 {
        font-size: 1.75rem;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-input {
    width: 100%;
    padding: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.modal-input:focus {
    border-color: var(--accent-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.full-width {
    width: 100%;
    margin-top: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Large Modal for Dashboard */
.large-modal {
    max-width: 600px;
    width: 95%;
}

.users-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.users-table th {
    background: rgba(15, 23, 42, 0.4);
    font-weight: 600;
    color: var(--text-secondary);
}

.users-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
}

.tag.admin {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-color);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* User Form in Admin Panel */
.create-user-form {
    background: rgba(15, 23, 42, 0.4);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideIn 0.2s ease;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.small-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Profile Modal */
.divider {
    height: 1px;
    background: var(--card-border);
    margin: 8px 0;
}

.input-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: -8px;
    margin-left: 4px;
}

/* Categories Modal */
.add-category-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.categories-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.category-list-item {
    background: rgba(15, 23, 42, 0.4);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--card-border);
}

.cat-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Dynamic Badge Colors */
.badge-blue {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.badge-purple {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.badge-red {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.badge-green {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.badge-orange {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.badge-pink {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
}

/* Dot Colors */
.dot-blue {
    background-color: #3b82f6;
}

.dot-purple {
    background-color: #a855f7;
}

.dot-red {
    background-color: #ef4444;
}

.dot-green {
    background-color: #10b981;
}

.dot-orange {
    background-color: #f97316;
}

.dot-pink {
    background-color: #ec4899;
}