/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.75rem;
    color: #4F46E5;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #374151;
}

.signout-btn {
    background: #EF4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.signout-btn:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

/* Auth Section */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

.auth-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    color: #4F46E5;
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.auth-header p {
    color: #6B7280;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 1rem;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: white;
    color: #4F46E5;
    border: 2px solid #4F46E5;
}

.btn-secondary:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dashboard Section */
.dashboard-section {
    animation: fadeIn 0.5s ease-in;
}

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

.welcome-banner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.current-date {
    color: #6B7280;
    font-size: 0.95rem;
}

.stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-item i {
    font-size: 1.5rem;
    color: #4F46E5;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: #6B7280;
}

/* Add Todo Section */
.add-todo-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.todo-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.todo-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-with-icon {
    position: relative;
    flex: 1;
}

.input-with-icon input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.time-input-group,
.priority-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.time-input-group label,
.priority-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.time-input-group input,
.priority-group select {
    padding: 0.75rem;
    border: 2px solid #E5E7EB;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: white;
}

.time-input-group input:focus,
.priority-group select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.add-btn {
    align-self: flex-start;
    min-width: 150px;
}

/* Todos Section */
.todos-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: #4F46E5;
    color: white;
    border-color: #4F46E5;
}

/* Todo Items */
.todos-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-item {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.todo-item:hover {
    border-color: #4F46E5;
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.1);
}

.todo-item.completed {
    opacity: 0.7;
    background: #F9FAFB;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #D1D5DB;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.todo-checkbox.checked {
    background: #4F46E5;
    border-color: #4F46E5;
}

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

.todo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.todo-task {
    font-size: 1rem;
    font-weight: 500;
    color: #1a202c;
}

.todo-item.completed .todo-task {
    text-decoration: line-through;
    color: #9CA3AF;
}

.todo-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6B7280;
}

.todo-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-high {
    background: #FEE2E2;
    color: #DC2626;
}

.priority-medium {
    background: #FEF3C7;
    color: #D97706;
}

.priority-low {
    background: #D1FAE5;
    color: #059669;
}

.todo-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.delete-btn {
    background: #FEE2E2;
    color: #DC2626;
}

.delete-btn:hover {
    background: #FECACA;
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #D1D5DB;
}

.empty-state h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

/* Message Styles */
.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.message.info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* Loading Animations */
.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Enhanced Mobile Optimization */
@media (max-width: 1024px) {
    .header-content {
        padding: 1rem 1.5rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .user-menu {
        gap: 0.75rem;
    }
    
    .signout-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .header-content {
        padding: 0.75rem 1rem;
        min-height: 60px;
    }
    
    .logo {
        gap: 0.5rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .logo h1 {
        font-size: 1.125rem;
    }
    
    .user-info {
        font-size: 0.875rem;
    }
    
    .signout-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .signout-btn i {
        display: none;
    }
    
    /* Auth Section Mobile */
    .auth-container {
        padding: 1.5rem;
        margin: 0.75rem;
        max-width: 400px;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .input-group input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
        font-size: 0.95rem;
    }
    
    .input-icon {
        left: 0.875rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    /* Dashboard Mobile */
    .welcome-banner {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
        padding: 1.5rem;
    }
    
    .welcome-content h2 {
        font-size: 1.25rem;
    }
    
    .current-date {
        font-size: 0.9rem;
    }
    
    .stats {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .stat-item {
        gap: 0.5rem;
    }
    
    .stat-item i {
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Add Todo Section Mobile */
    .add-todo-section {
        padding: 1.5rem;
    }
    
    .input-with-icon input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
        font-size: 0.95rem;
    }
    
    .time-inputs {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
    
    .time-input-group label,
    .priority-group label {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .time-input-group input,
    .priority-group select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .add-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
    
    /* Todos Section Mobile */
    .todos-section {
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .section-header h3 {
        font-size: 1.125rem;
        text-align: center;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
    /* Todo Items Mobile */
    .todo-item {
        padding: 1.25rem;
        gap: 0.875rem;
        flex-direction: row;
        align-items: flex-start;
    }
    
    .todo-checkbox {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        flex-shrink: 0;
    }
    
    .todo-content {
        flex: 1;
        min-width: 0;
    }
    
    .todo-task {
        font-size: 0.95rem;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .todo-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        margin-top: 0.5rem;
    }
    
    .todo-time {
        font-size: 0.8rem;
    }
    
    .priority-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .todo-actions {
        flex-shrink: 0;
        margin-top: 2px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    /* Empty State Mobile */
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state i {
        font-size: 2.5rem;
    }
    
    .empty-state h4 {
        font-size: 1.125rem;
    }
    
    .empty-state p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .header-content {
        padding: 0.75rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .user-info {
        font-size: 0.8rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .signout-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Compact Auth */
    .auth-container {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    .auth-header {
        margin-bottom: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.375rem;
    }
    
    .auth-buttons {
        gap: 0.75rem;
    }
    
    /* Compact Dashboard */
    .welcome-banner,
    .add-todo-section,
    .todos-section {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .welcome-content h2 {
        font-size: 1.125rem;
    }
    
    .stats {
        gap: 1.25rem;
    }
    
    /* Compact Todo Form */
    .time-inputs {
        gap: 0.75rem;
    }
    
    .time-input-group label,
    .priority-group label {
        font-size: 0.75rem;
    }
    
    /* Ultra Compact Todo Items */
    .todo-item {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .todo-task {
        font-size: 0.9rem;
    }
    
    .todo-time {
        font-size: 0.75rem;
    }
    
    .priority-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    /* Message Mobile */
    .message {
        padding: 0.875rem;
        font-size: 0.9rem;
        margin-bottom: 0.875rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .filter-btn,
    .action-btn,
    .todo-checkbox {
        min-height: 44px;
        min-width: 44px;
    }
    
    .signout-btn {
        min-height: 40px;
    }
    
    .todo-checkbox {
        width: 22px;
        height: 22px;
    }
    
    .input-group input,
    .input-with-icon input,
    .time-input-group input,
    .priority-group select {
        min-height: 44px;
    }
}