/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --priority-low: #10b981;
    --priority-medium: #f59e0b;
    --priority-high: #ef4444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== AUTH PAGE ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-header h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(.loading) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
    padding: 12px 24px;
    background: var(--border-color);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
}

.form-footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

.auth-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.auth-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.auth-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--light-bg);
    padding: 4px;
    border-radius: 8px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-method-form {
    display: none;
}

.auth-method-form.active {
    display: block;
}

.auth-note {
    margin-top: 12px;
    padding: 12px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: start;
    gap: 8px;
    line-height: 1.5;
}

.auth-note i {
    margin-top: 2px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Google Button */
.btn-google {
    width: 100%;
    padding: 14px;
    background: white;
    color: #444;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-google:hover:not(.loading) {
    border-color: #4285f4;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.btn-google:active:not(.loading) {
    transform: translateY(0px);
}

.btn-google i {
    font-size: 20px;
    color: #4285f4;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 16px;
    font-weight: 600;
}

/* OTP Verification Screen */
.otp-header {
    text-align: center;
    margin-bottom: 24px;
}

.otp-header i {
    display: none;
}

.otp-header h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.otp-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.resend-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-color);
    text-align: center;
}

.resend-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.resend-text i {
    color: var(--warning-color);
}

.btn-resend {
    width: 100%;
    padding: 12px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-resend:hover:not(.loading) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-resend:active:not(.loading) {
    transform: translateY(0);
}

.btn-resend i {
    font-size: 16px;
    transition: transform 0.3s;
}

.btn-resend:hover i {
    transform: rotate(15deg);
}

.otp-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.otp-note i {
    font-size: 16px;
    color: var(--warning-color);
}

/* OTP Input Styling */
#otpCode {
    font-size: 16px;
    letter-spacing: 4px;
    text-align: center;
    font-weight: 500;
    font-family: inherit;
}

#otpCode::placeholder {
    font-size: 14px;
    letter-spacing: normal;
    font-weight: normal;
}

/* ===== DASHBOARD LAYOUT ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary-color);
}

.sidebar-header h2 {
    font-size: 24px;
    flex: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
}

    .sidebar-footer {
        padding: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.user-info i {
    font-size: 24px;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    background: var(--card-bg);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
    margin-bottom: 24px;
}

/* Tasks header with search bar */
.tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.tasks-header h1 {
    margin: 0;
    flex-shrink: 0;
}

/* Search bar in tasks view */
#tasksView .search-bar {
    max-width: 400px;
    width: 100%;
    margin-bottom: 0;
    flex-shrink: 1;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.top-bar .btn-primary {
    width: auto;
    padding: 12px 24px;
}

/* ===== VIEWS ===== */
.view {
    display: none !important;
    padding: 40px;
}

.view.active {
    display: block !important;
}

/* Ensure calendar view is completely hidden when not active */
#calendarView:not(.active) {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.view h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-info h3 {
    font-size: 32px;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== CHARTS ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-container.chart-full-width {
    width: 100%;
    height: 400px;
    margin-bottom: 40px;
}

.chart-container h2 {
    margin-bottom: 16px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chart-container h2 i {
    color: var(--primary-color);
    font-size: 16px;
}

.chart-container canvas {
    flex: 1;
    max-height: 260px;
}

.chart-container.chart-full-width canvas {
    max-height: 320px;
}

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.filter-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-group input[type="date"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
    font-family: inherit;
}

.filter-group input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ===== TASKS LIST ===== */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--border-color);
    transition: all 0.3s;
    cursor: move;
}

.task-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.task-item.priority-low {
    border-left-color: var(--priority-low);
}

.task-item.priority-medium {
    border-left-color: var(--priority-medium);
}

.task-item.priority-high {
    border-left-color: var(--priority-high);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.task-header {
    display: flex;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-top: 2px;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.task-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.task-badge i {
    font-size: 12px;
}

.badge-deadline {
    background: #dbeafe;
    color: #1e40af;
}

.badge-deadline.overdue {
    background: #fee2e2;
    color: #991b1b;
}

.badge-category {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-priority {
    color: white;
}

.badge-priority.low {
    background: var(--priority-low);
}

.badge-priority.medium {
    background: var(--priority-medium);
}

.badge-priority.high {
    background: var(--priority-high);
}

.badge-recurring {
    background: #fef3c7;
    color: #92400e;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--light-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover:not(.loading) {
    background: var(--border-color);
    transform: scale(1.05);
}

.btn-icon:active:not(.loading) {
    transform: scale(0.95);
}

.btn-icon.edit:hover:not(.loading) {
    background: #dbeafe;
    color: #2563eb;
}

.btn-icon.delete:hover:not(.loading) {
    background: #fee2e2;
    color: #dc2626;
}

.btn-icon.archive:hover:not(.loading) {
    background: #fef3c7;
    color: #d97706;
}

/* ===== CALENDAR ===== */
#calendarView {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 800px;
}

.calendar-header-wrapper {
    flex-shrink: 0;
    margin-bottom: 16px;
}

.calendar-content-wrapper {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    overflow: visible;
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 0;
}

.calendar-controls h2 {
    font-size: 20px;
    min-width: 180px;
    text-align: center;
}

.calendar-grid {
    background: var(--card-bg);
    padding: 24px 24px 48px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 750px;
    overflow: visible;
    box-sizing: border-box;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 10px 4px;
    font-size: 13px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 8px;
    flex: 1;
    min-height: 650px;
    margin-bottom: 0;
    padding-bottom: 0;
    overflow: visible;
}

.calendar-day {
    width: 100%;
    height: 100%;
    padding: 12px 6px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    min-height: 90px;
}

.calendar-day:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.02);
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.calendar-day.today {
    border-color: var(--secondary-color);
    border-width: 2px;
    font-weight: 700;
}

.calendar-day.other-month {
    color: var(--text-secondary);
    opacity: 0.4;
}

.calendar-day.has-tasks::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
}

.calendar-day.selected.has-tasks::after {
    background: white;
}

.calendar-tasks {
    background: var(--card-bg);
    padding: 16px;
    padding-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
    box-sizing: border-box;
}

.calendar-tasks h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 16px;
    flex-shrink: 0;
}

.calendar-tasks .task-item {
    padding: 12px;
}

.calendar-tasks .task-title {
    font-size: 15px;
}

.calendar-tasks .task-description {
    font-size: 13px;
}

.calendar-tasks .task-badge {
    font-size: 11px;
    padding: 3px 8px;
}

.calendar-tasks .btn-icon {
    width: 30px;
    height: 30px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

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

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.close-modal:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-content h2 {
    margin-bottom: 24px;
    font-size: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== REMINDER MODAL ===== */
.reminder-modal {
    max-width: 500px;
}

.reminder-header {
    text-align: center;
    margin-bottom: 24px;
}

.reminder-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.reminder-header h2 {
    font-size: 24px;
    margin: 0;
}

.reminder-content {
    max-height: 400px;
    overflow-y: auto;
}

.reminder-task {
    padding: 16px;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid var(--border-color);
}

.reminder-task.high {
    border-left-color: var(--priority-high);
}

.reminder-task.medium {
    border-left-color: var(--priority-medium);
}

.reminder-task.low {
    border-left-color: var(--priority-low);
}

.reminder-task h4 {
    margin-bottom: 8px;
    font-size: 16px;
}

.reminder-task p {
    font-size: 13px;
    color: var(--text-secondary);
}

.reminder-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.reminder-empty i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===== DRAG AND DROP ===== */
.sortable-ghost {
    opacity: 0.4;
    background: var(--light-bg);
}

.sortable-chosen {
    cursor: grabbing !important;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
}

/* ===== MOBILE MENU TOGGLE ===== */
.btn-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: var(--light-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

.btn-menu-toggle:hover {
    background: var(--border-color);
}

.btn-close-sidebar {
    display: none;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
}

.btn-close-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-header {
    position: relative;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }

    /* Auth Page Mobile Fixes */
    .auth-page {
        padding: 12px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .auth-container {
        width: 100%;
        max-width: 100%;
    }

    .auth-box {
        padding: 24px 20px;
        max-width: 100%;
        border-radius: 12px;
        margin: 0 auto;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-header i {
        font-size: 36px;
        margin-bottom: 8px;
    }

    .auth-header h1 {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .auth-form h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }

    .form-group small {
        font-size: 11px;
        margin-top: 4px;
        line-height: 1.4;
    }

    .btn-primary,
    .btn-google {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px; /* Better touch target */
    }

    .btn-google {
        margin-bottom: 16px;
    }

    .divider {
        margin: 20px 0;
        font-size: 13px;
    }

    .divider span {
        padding: 0 12px;
    }

    .auth-tabs {
        margin-bottom: 20px;
        gap: 6px;
        padding: 3px;
    }

    .auth-tab {
        padding: 10px 8px;
        font-size: 13px;
        gap: 6px;
    }

    .auth-tab i {
        font-size: 14px;
    }

    .auth-note {
        padding: 10px 12px;
        font-size: 12px;
        margin-top: 10px;
    }

    .auth-note i {
        font-size: 14px;
    }

    .otp-header {
        margin-bottom: 20px;
    }

    .otp-header h3 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .otp-header p {
        font-size: 13px;
    }

    #otpCode {
        font-size: 20px; /* Larger for mobile */
        letter-spacing: 6px;
        padding: 14px;
        min-height: 56px;
    }

    .resend-section {
        margin-top: 16px;
        padding-top: 16px;
    }

    .resend-text {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .btn-resend {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }

    .otp-note {
        margin-top: 12px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .form-footer {
        margin-top: 16px;
    }

    .form-footer p {
        font-size: 13px;
    }

    .auth-message {
        margin-top: 16px;
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Sidebar Mobile */
    .btn-menu-toggle {
        display: flex;
        min-width: 44px;
        min-height: 44px;
    }

    .btn-close-sidebar {
        display: flex;
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-header {
        padding: 20px;
        flex-wrap: wrap;
    }

    .sidebar-header h2 {
        font-size: 20px;
        flex: 1;
        min-width: 0;
    }

    .sidebar-header i {
        font-size: 24px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        width: 280px;
        max-width: 85vw;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-footer {
        padding: 16px 20px;
    }

    .user-info {
        padding: 10px;
        margin-bottom: 12px;
    }

    .user-info i {
        font-size: 20px;
    }

    .user-info span {
        font-size: 14px;
    }

    .btn-logout {
        padding: 10px;
        font-size: 13px;
        min-height: 44px;
    }

    /* Sidebar overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        backdrop-filter: blur(2px);
        -webkit-tap-highlight-color: transparent;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Prevent body scroll when sidebar is open on mobile */
    body.sidebar-open {
        overflow: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    /* Top Bar Mobile */
    .top-bar {
        padding: 12px 16px;
        justify-content: space-between;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .top-bar .btn-primary {
        flex: 1;
        max-width: none;
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        white-space: nowrap;
    }

    .top-bar .btn-primary i {
        margin-right: 6px;
    }

    /* Views Mobile */
    .view {
        padding: 16px 12px;
    }

    .view h1 {
        font-size: 22px;
        margin-bottom: 16px;
        line-height: 1.3;
    }

    /* Dashboard Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .stat-card {
        padding: 16px;
        gap: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
        flex-shrink: 0;
    }

    .stat-info h3 {
        font-size: 26px;
        margin-bottom: 2px;
    }

    .stat-info p {
        font-size: 13px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .chart-container {
        height: 280px;
        padding: 16px;
    }

    .chart-container h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .chart-container h2 i {
        font-size: 14px;
    }

    .chart-container.chart-full-width {
        height: 300px;
        margin-bottom: 24px;
    }

    .chart-container.chart-full-width canvas {
        max-height: 240px;
    }

    /* Tasks View Mobile */
    .tasks-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .tasks-header h1 {
        margin-bottom: 0;
        font-size: 22px;
    }

    #tasksView .search-bar {
        max-width: 100%;
        margin-bottom: 0;
        width: 100%;
    }

    .search-bar input {
        padding: 12px 16px 12px 40px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .filters {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .filter-group {
        min-width: 100%;
        width: 100%;
    }

    .filter-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .filter-group select,
    .filter-group input[type="date"] {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }

    .task-item {
        padding: 14px;
        border-radius: 10px;
    }

    .task-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
    }

    .task-checkbox {
        width: 22px;
        height: 22px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    .task-content {
        flex: 1;
        min-width: 0;
    }

    .task-title {
        font-size: 16px;
        margin-bottom: 6px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
    }

    .task-description {
        font-size: 13px;
        margin-bottom: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.5;
    }

    .task-meta {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
    }

    .task-badge {
        font-size: 11px;
        padding: 4px 10px;
        white-space: nowrap;
    }

    .task-badge i {
        font-size: 11px;
    }

    .task-actions {
        flex-wrap: nowrap;
        gap: 6px;
        flex-shrink: 0;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 14px;
        -webkit-tap-highlight-color: transparent;
    }

    /* Calendar Mobile */
    #calendarView {
        height: auto;
        min-height: auto;
        padding: 16px 12px;
    }

    .calendar-header-wrapper {
        margin-bottom: 16px;
    }

    .calendar-header-wrapper > div {
        flex-direction: column;
        gap: 12px;
        align-items: stretch !important;
    }

    .calendar-header-wrapper h1 {
        font-size: 22px !important;
        margin: 0 !important;
    }

    .calendar-controls {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }

    .calendar-controls .btn-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .calendar-controls h2 {
        font-size: 16px;
        min-width: auto;
        flex: 1;
        text-align: center;
        padding: 0 8px;
    }

    .calendar-content-wrapper {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calendar-grid {
        padding: 12px 6px;
        min-height: auto;
        border-radius: 10px;
    }

    .calendar-weekdays {
        gap: 3px;
        margin-bottom: 3px;
    }

    .calendar-weekday {
        font-size: 11px;
        padding: 8px 2px;
        font-weight: 600;
    }

    .calendar-days {
        gap: 3px;
        min-height: auto;
    }

    .calendar-day {
        font-size: 13px;
        padding: 8px 3px;
        min-height: 65px;
        border-radius: 6px;
    }

    .calendar-tasks {
        height: auto;
        max-height: 450px;
        min-height: 350px;
        padding: 14px;
        border-radius: 10px;
    }

    .calendar-tasks h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .calendar-tasks .task-item {
        padding: 12px;
        margin-bottom: 8px;
    }

    .calendar-tasks .task-title {
        font-size: 15px;
    }

    .calendar-tasks .task-description {
        font-size: 12px;
    }

    .calendar-tasks .task-meta {
        gap: 6px;
    }

    .calendar-tasks .task-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .calendar-tasks .btn-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    /* Modal Mobile */
    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        padding: 24px 18px;
        margin: 0;
        border-radius: 12px;
        max-height: 90vh;
    }

    .close-modal {
        right: 16px;
        top: 16px;
        font-size: 24px;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-content h2 {
        font-size: 20px;
        margin-bottom: 20px;
        padding-right: 32px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }

    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
        margin-top: 20px;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        min-height: 48px;
        padding: 14px 16px;
    }

    /* Reminder Modal Mobile */
    .reminder-modal {
        width: 100%;
        max-width: 100%;
        padding: 24px 18px;
    }

    .reminder-header {
        margin-bottom: 20px;
    }

    .reminder-header i {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .reminder-header h2 {
        font-size: 20px;
    }

    .reminder-content {
        max-height: 50vh;
    }

    .reminder-task {
        padding: 14px;
        margin-bottom: 10px;
    }

    .reminder-task h4 {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .reminder-task p {
        font-size: 12px;
    }

    .reminder-empty {
        padding: 30px 20px;
    }

    .reminder-empty i {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .reminder-empty h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .reminder-empty p {
        font-size: 14px;
    }

    /* Empty State Mobile */
    .empty-state {
        padding: 40px 20px;
    }

    .empty-state i {
        font-size: 60px;
        margin-bottom: 16px;
    }

    .empty-state h3 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .empty-state p {
        font-size: 14px;
    }

    /* Archive View Mobile */
    #archiveView h1 {
        font-size: 22px;
        margin-bottom: 16px;
    }
}

/* Additional mobile fixes for very small screens */
@media (max-width: 480px) {
    /* Auth Page Extra Small */
    .auth-page {
        padding: 8px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .auth-box {
        padding: 20px 16px;
        border-radius: 10px;
    }

    .auth-header i {
        font-size: 32px;
    }

    .auth-header h1 {
        font-size: 22px;
    }

    .auth-header p {
        font-size: 12px;
    }

    .auth-form h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px 12px;
        font-size: 16px; /* Keep 16px to prevent iOS zoom */
    }

    .btn-primary,
    .btn-google {
        padding: 12px 14px;
        font-size: 14px;
        min-height: 44px;
    }

    .auth-tab {
        padding: 8px 6px;
        font-size: 12px;
    }

    .auth-tab i {
        font-size: 12px;
    }

    #otpCode {
        font-size: 18px;
        letter-spacing: 4px;
        padding: 12px;
        min-height: 52px;
    }

    /* Views Extra Small */
    .view {
        padding: 12px 10px;
    }

    .view h1 {
        font-size: 20px;
        margin-bottom: 14px;
    }

    /* Top Bar Extra Small */
    .top-bar {
        padding: 10px 12px;
        gap: 8px;
    }

    .top-bar .btn-primary {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }

    .top-bar .btn-primary i {
        font-size: 14px;
        margin-right: 4px;
    }

    /* Dashboard Extra Small */
    .stats-grid {
        gap: 10px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .stat-info h3 {
        font-size: 24px;
    }

    .stat-info p {
        font-size: 12px;
    }

    .charts-grid {
        gap: 12px;
        margin-bottom: 16px;
    }

    .chart-container {
        height: 260px;
        padding: 14px;
    }

    .chart-container h2 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .chart-container.chart-full-width {
        height: 280px;
        margin-bottom: 20px;
    }

    .chart-container.chart-full-width canvas {
        max-height: 220px;
    }

    /* Tasks View Extra Small */
    .tasks-header {
        gap: 10px;
        margin-bottom: 14px;
    }

    .tasks-header h1 {
        font-size: 20px;
    }

    .filters {
        gap: 10px;
        margin-bottom: 16px;
    }

    .filter-group label {
        font-size: 12px;
    }

    .filter-group select,
    .filter-group input[type="date"] {
        padding: 11px 12px;
        font-size: 16px; /* Keep 16px to prevent iOS zoom */
        min-height: 44px;
    }

    .task-item {
        padding: 12px;
    }

    .task-title {
        font-size: 15px;
    }

    .task-description {
        font-size: 12px;
    }

    .task-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 13px;
    }

    /* Calendar Extra Small */
    .calendar-header-wrapper h1 {
        font-size: 20px !important;
    }

    .calendar-controls h2 {
        font-size: 14px;
    }

    .calendar-controls .btn-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .calendar-grid {
        padding: 10px 4px;
    }

    .calendar-weekday {
        font-size: 10px;
        padding: 6px 1px;
    }

    .calendar-day {
        font-size: 12px;
        padding: 6px 2px;
        min-height: 55px;
    }

    .calendar-tasks {
        padding: 12px;
        min-height: 300px;
        max-height: 400px;
    }

    .calendar-tasks h3 {
        font-size: 15px;
    }

    .calendar-tasks .task-item {
        padding: 10px;
    }

    .calendar-tasks .task-title {
        font-size: 14px;
    }

    .calendar-tasks .task-description {
        font-size: 11px;
    }

    .calendar-tasks .btn-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    /* Modal Extra Small */
    .modal {
        padding: 8px;
    }

    .modal-content {
        padding: 20px 14px;
        border-radius: 10px;
    }

    .close-modal {
        right: 12px;
        top: 12px;
        font-size: 22px;
        width: 28px;
        height: 28px;
    }

    .modal-content h2 {
        font-size: 18px;
        margin-bottom: 16px;
        padding-right: 28px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 11px 12px;
        font-size: 16px; /* Keep 16px to prevent iOS zoom */
        min-height: 44px;
    }

    .form-group textarea {
        min-height: 90px;
    }

    .form-actions {
        gap: 8px;
        margin-top: 16px;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        padding: 12px 14px;
        min-height: 44px;
        font-size: 14px;
    }

    /* Reminder Modal Extra Small */
    .reminder-modal {
        padding: 20px 14px;
    }

    .reminder-header i {
        font-size: 32px;
    }

    .reminder-header h2 {
        font-size: 18px;
    }

    .reminder-task {
        padding: 12px;
    }

    .reminder-task h4 {
        font-size: 14px;
    }

    .reminder-task p {
        font-size: 11px;
    }

    /* Empty State Extra Small */
    .empty-state {
        padding: 30px 16px;
    }

    .empty-state i {
        font-size: 50px;
        margin-bottom: 12px;
    }

    .empty-state h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .empty-state p {
        font-size: 13px;
    }
}

/* ===== BUTTON LOADING STATES ===== */
.btn-primary.loading,
.btn-google.loading,
.btn-resend.loading,
.btn-icon.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-primary.loading i:not(.spinner),
.btn-google.loading i:not(.spinner),
.btn-resend.loading i:not(.spinner) {
    opacity: 0;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn-icon .spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Button disabled state */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

