/* ========== Biến màu chủ đạo ========== */
:root {
    --primary-color: #B8641A;
    --primary-dark: #8B4513;
    --primary-light: #D2691E;
    --secondary-color: #F5E6D3;
    --accent-color: #FF8C42;
    --text-primary: #2C2416;
    --text-secondary: #6B5D4F;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9F6F2;
    --bg-tertiary: #FEF9F3;
    --border-color: #E8DCC8;
    --shadow-sm: 0 2px 8px rgba(255,140,66,0.08);
    --shadow-md: 0 6px 32px rgba(255,140,66,0.10);
    --shadow-lg: 0 12px 40px rgba(255,140,66,0.13);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --success-color: #28A745;
    --danger-color: #DC3545;
    --warning-color: #FFC107;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.7;
    font-size: 17px;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.18s;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    background: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== Header/Navigation ========== */
header {
    background: var(--bg-primary);
    border-bottom: 1.5px solid var(--border-color);
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo-image {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

nav a {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 0;
    position: relative;
    border-radius: var(--radius-sm);
    transition: background 0.18s, color 0.18s;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    background: var(--secondary-color);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ========== Button Styles ========== */
.btn {
    padding: 13px 0;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 17px;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 8px;
    border: none;
    outline: none;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.2px;
}

.btn.primary {
    background: linear-gradient(90deg, #ff8c42 60%, #ffb366 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,140,66,0.10);
}

.btn.primary:hover {
    background: linear-gradient(90deg, #ff7f2a 80%, #ff9e4d 100%);
    transform: translateY(-2px) scale(1.03);
}

.btn.secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 1.5px solid var(--border-color);
    width: auto;
}

.btn.secondary:hover {
    background: var(--border-color);
    color: var(--primary-dark);
}

.btn.vip-btn {
    background: var(--accent-color);
    color: #fff;
    margin-left: 18px;
    font-weight: 800;
    padding: 10px 22px;
    width: auto;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.18);
    border-radius: var(--radius-md);
    font-size: 16px;
}

.btn.vip-btn:hover {
    background: #ff7f2a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.22);
}

/* ========== Form/Card Styles ========== */
.form-card, .settings-card, .payment-card, .task-list-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 38px 32px 32px 32px;
    margin: 0 auto 32px auto;
    border: 1.5px solid var(--border-color);
    max-width: 440px;
}

.form-card h2, .settings-card h2, .payment-card h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 26px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], textarea, select {
    width: 100%;
    padding: 13px 16px;
    margin-bottom: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border 0.18s, box-shadow 0.18s;
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border: 1.5px solid var(--primary-color);
    box-shadow: 0 0 0 2px #ffe0c2;
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    cursor: pointer;
    font-weight: 600;
    background: var(--bg-tertiary);
}

.form-group label {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 7px;
    display: block;
}

.auth-switch-text {
    margin-top: 18px;
    text-align: center;
    color: #888;
    font-size: 15px;
}

/* ========== Dashboard & Calendar ========== */
.welcome-message {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 32px;
    font-size: 2rem;
    font-weight: 800;
}

.dashboard-grid {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.add-task-section {
    flex: 1;
    background: var(--bg-primary);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
    min-width: 320px;
}

.add-task-section h3 {
    color: var(--primary-dark);
    margin-bottom: 22px;
    font-size: 1.2rem;
    font-weight: 700;
}

.calendar-management-section {
    flex: 3;
    min-width: 0;
}

.calendar-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.view-switcher-group {
    display: flex;
    gap: 10px;
}

.view-switcher {
    padding: 9px 18px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: none;
    color: var(--primary-color);
    transition: background 0.18s, color 0.18s;
}

.view-switcher.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.calendar-view {
    display: grid;
    gap: 10px;
    background: var(--bg-primary);
    padding: 18px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--border-color);
    min-height: 220px;
}

#repeat-tasks-list {
    margin-top: 18px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

#repeat-tasks-list h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 700;
}

#repeat-tasks-list ul {
    list-style: none;
    padding-left: 0;
}

#repeat-tasks-list li {
    margin-bottom: 7px;
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 600;
}

/* Calendar cell */
.calendar-cell {
    position: relative;
    padding: 12px 10px 10px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    min-height: 90px;
    cursor: pointer;
    transition: background 0.18s, border 0.18s, transform 0.18s;
    box-shadow: var(--shadow-sm);
}

.calendar-cell:hover {
    background: var(--secondary-color);
    border-color: var(--primary-light);
    transform: translateY(-2px) scale(1.01);
}

.cell-date {
    position: absolute;
    top: 7px;
    right: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.cell-task-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 18px;
}

.task-count-badge {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 7px;
    font-weight: 800;
}

.cell-task-completed {
    background: var(--success-color);
}

/* ========== Modal Styles ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(44,36,22,0.18);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-primary);
    padding: 36px 28px 28px 28px;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 96vw;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 800;
}

.close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.18s;
}

.close-btn:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

#task-detail-body p {
    margin-bottom: 12px;
    font-size: 16px;
}

#task-detail-body strong {
    color: var(--primary-dark);
}

/* ========== Flash Messages ========== */
.flashes {
    list-style: none;
    padding: 20px 0;
    margin: 20px auto;
    max-width: 1200px;
}

.flashes li {
    padding: 15px 22px;
    margin-bottom: 13px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 1.5px solid;
    font-size: 1rem;
}

.flashes .success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.flashes .danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.flashes .warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* ========== Footer ========== */
footer {
    background: var(--bg-primary);
    border-top: 1.5px solid var(--border-color);
    padding: 28px 0 18px 0;
    margin-top: 48px;
    box-shadow: var(--shadow-sm);
}

.footer-copy-container {
    max-width: 1200px;
    margin: 0 auto;
}

footer p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

/* ========== Utilities ========== */
.text-center {
    text-align: center;
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .dashboard-grid {
        flex-direction: column;
        gap: 28px;
    }
    .add-task-section, .calendar-management-section {
        width: 100%;
        min-width: unset;
    }
    .form-card, .settings-card, .payment-card, .task-list-section {
        max-width: 98vw;
        padding: 24px 8px 18px 8px;
    }
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 0 8px;
        gap: 8px;
    }
    .logo-container {
        justify-content: center;
        width: 100%;
    }
    nav {
        width: 100%;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    .dashboard-grid {
        gap: 16px;
    }
    .calendar-header-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 8px;
    }
    .calendar-view {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 8px;
    }
    .calendar-cell {
        min-height: 80px;
        padding: 8px 6px 6px 6px;
    }
    .form-card, .settings-card, .payment-card, .task-list-section {
        padding: 14px 2vw 12px 2vw;
        border-radius: var(--radius-md);
    }
    .modal-content {
        padding: 18px 6px 12px 6px;
        border-radius: var(--radius-md);
        max-width: 98vw;
    }
    .btn, .btn.primary, .btn.secondary, .btn.vip-btn {
        font-size: 15px;
        padding: 10px 0;
    }
    input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], textarea, select {
        font-size: 0.98rem;
        padding: 10px 10px;
        border-radius: 8px;
    }
    .welcome-message {
        font-size: 1.2rem;
        padding: 0 2vw;
    }
    .add-task-section h3, .calendar-header-controls h3 {
        font-size: 1rem;
    }
    #repeat-tasks-list h4 {
        font-size: 1rem;
    }
    .task-item {
        padding: 12px 8px;
        font-size: 0.98rem;
    }
    .footer-copy-container, footer p {
        font-size: 13px;
        padding: 0 2vw;
    }
}

/* ========== Task List Section (VIP) ========== */
.task-list-section {
    max-width: 900px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 38px 32px 32px 32px;
    margin: 0 auto 32px auto;
    border: 1.5px solid var(--border-color);
}

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 18px 22px;
    margin-bottom: 18px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.18s, transform 0.18s;
}

.task-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) scale(1.01);
}

.task-details h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.task-details .description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 6px;
}

.task-details .due-date {
    color: var(--primary-dark);
    font-size: 0.98rem;
    font-weight: 600;
}

.no-tasks {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.1rem;
    margin: 30px 0;
}