/* Advanced Todo App Styles */
/* Reset and Base Styles */
#advanced-todo-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

#advanced-todo-app * {
    box-sizing: border-box;
}

/* Header Styles */
.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 30px;
}

.todo-header h1 {
    margin: 0;
    color: #1f2937;
    font-size: 28px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

/* Main Layout */
.todo-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .todo-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Sidebar Styles */
.todo-sidebar {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h3 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #3b82f6;
    color: white;
}

.sidebar-menu .count {
    margin-left: auto;
    background: #d1d5db;
    color: #374151;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.sidebar-menu a.active .count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Content Area */
.todo-content {
    background: white;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.content-title {
    margin: 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
}

.add-task-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-task-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Task List Styles */
.task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.task-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.task-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.task-item.completed {
    opacity: 0.7;
    background: #f9fafb;
}

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.task-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
    position: relative;
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.task-content {
    flex-grow: 1;
}

.task-title {
    margin: 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-description {
    margin: 4px 0 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.task-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.task-priority.low {
    background: #dbeafe;
    color: #1d4ed8;
}

.task-priority.medium {
    background: #fef3c7;
    color: #d97706;
}

.task-priority.high {
    background: #fee2e2;
    color: #dc2626;
}

.task-priority.urgent {
    background: #fecaca;
    color: #991b1b;
}

.task-due-date {
    color: #6b7280;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-due-date.overdue {
    color: #dc2626;
    font-weight: 500;
}

.task-project {
    color: #8b5cf6;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.task-action-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.task-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Modal Styles */
.todo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.todo-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
}

.todo-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #374151;
}

/* Form Styles */
.todo-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: #9ca3af;
    font-size: 18px;
    font-weight: 500;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Notifications */
.todo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.todo-notification.show {
    transform: translateX(0);
}

.todo-notification.success {
    background: #10b981;
}

.todo-notification.error {
    background: #ef4444;
}

.todo-notification.info {
    background: #3b82f6;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    margin: 4px 0 0 0;
}

/* Login and Register Forms */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 600;
}

.auth-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .form-input {
    padding: 14px 16px;
    font-size: 16px;
}

.auth-submit {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-submit:hover {
    background: #2563eb;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #advanced-todo-app {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .todo-sidebar {
        background: #374151;
    }
    
    .task-item {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .task-item:hover {
        border-color: #3b82f6;
    }
    
    .modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
}