:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 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);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.flash-message {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-success {
    background-color: var(--success-color);
    color: white;
}

.flash-error {
    background-color: var(--error-color);
    color: white;
}

.flash-warning {
    background-color: var(--warning-color);
    color: white;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    margin-left: 12px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.flash-close:hover {
    opacity: 1;
}

/* Auth Pages */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
    text-align: center;
    color: white;
}

.welcome-section {
    margin-bottom: 48px;
}

.welcome-section h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.95;
}

.description {
    font-size: 18px;
    opacity: 0.85;
}

.auth-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 64px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-secondary);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    max-width: 900px;
    width: 100%;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.feature p {
    opacity: 0.9;
    font-size: 14px;
}

/* Auth Forms */
.auth-form-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
    padding: 20px;
}

.auth-form-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
}

.auth-form-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 14px;
}

.auth-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-link {
    text-align: center;
    margin-top: 16px;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: var(--primary-dark);
}

/* Todo App */
.app-header {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.app-header h1 {
    font-size: 32px;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.user-email {
    color: var(--text-secondary);
    font-weight: 500;
}

.todos-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

@media (max-width: 968px) {
    .todos-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.todo-form {
    display: flex;
    flex-direction: column;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.todos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.todos-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.todo-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.todos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.todo-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.todo-item.completed {
    opacity: 0.7;
    border-left-color: var(--success-color);
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.todo-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.todo-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.todo-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.todo-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit {
    background: var(--primary-color);
    color: white;
}

.btn-edit:hover {
    background: var(--primary-dark);
}

.btn-delete {
    background: var(--error-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

.btn-complete {
    background: var(--success-color);
    color: white;
}

.btn-complete:hover {
    background: #059669;
}

.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Modal */
.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;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-section h1 {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 20px;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .btn {
        width: 100%;
    }
    
    .auth-form-card {
        padding: 24px;
    }
    
    .todos-container {
        grid-template-columns: 1fr;
    }
    
    .todo-item {
        flex-direction: column;
    }
    
    .todo-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
