:root {
    --bg-dark: #0f111a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8f9fa;
    --text-secondary: #a0aab2;
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #ec4899; /* Pink */
    --success: #10b981;
    --danger: #ef4444;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

.hidden {
    display: none !important;
}

.view-section {
    display: block; /* Ensure it's visible when not hidden */
    animation: fadeIn 0.4s ease forwards;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}

.secondary-btn:hover {
    background: var(--bg-card);
    color: white;
}

.icon-btn {
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

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

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--accent-secondary);
}

/* Tasks Grid */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-glass);
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: grab;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.task-card.done {
    opacity: 0.6;
}

.task-card.done h3 {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Custom Checkbox */
.status-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.status-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 24px;
    width: 24px;
    background-color: var(--bg-card);
    border: 2px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

.status-checkbox-container:hover .status-checkbox ~ .checkmark {
    border-color: var(--accent-primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.status-checkbox:checked ~ .checkmark {
    background-color: var(--success);
    border-color: var(--success);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.status-checkbox:checked ~ .checkmark:after {
    display: block;
}

/* Ensure title next to custom checkbox has spacing */
.task-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}


.task-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.task-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.task-category {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-entertainment { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.cat-food { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.cat-memories { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.cat-religious { background: rgba(99, 102, 241, 0.15); color: #818cf8; }

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

.btn-edit { color: var(--text-secondary); }
.btn-edit:hover { color: var(--accent-primary); }

.btn-delete { color: var(--text-secondary); }
.btn-delete:hover { color: var(--danger); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1e2130;
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-glass);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input, 
.form-group textarea, 
.form-group select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.4);
}

.form-group select option {
    background: #1e2130;
    color: white;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.loader {
    width: 100%;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-style: italic;
    grid-column: 1 / -1;
}

/* Drag overlay */
.task-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--accent-primary);
}

/* === Memories Section Styles === */
:root {
    --mem-pink: #ffb6c1;
    --mem-beige: #f5f5dc;
    --mem-card-bg: rgba(255, 240, 245, 0.05);
    --religious-glow: rgba(255, 235, 150, 0.4);
    --religious-accent: #ffd766;
    --religious-bg-gradient: linear-gradient(135deg, #2c3e50, #1a1a2e, #4b3040);
    --spiritual-green: #d1f2d1;
    --soft-white: #fdfdfd;
    --mem-accent: #ff69b4;
    --mem-success: rgba(16, 185, 129, 0.2);
    --mem-text: #fff0f5;
}

/* Tabs Navigation */
.main-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: white;
    background: var(--border-glass);
}

.tab-btn.active {
    background: var(--border-glass);
    color: white;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

#tab-memories.active {
    border-color: var(--mem-accent);
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3);
}

/* View Sections */
.view-section {
    /* Base styles now at the top */
}

.view-section.hidden {
    display: none !important;
}

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

/* Memories Header & Progress */
.memories-header {
    border-bottom: 1px solid rgba(255, 105, 180, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.memories-title {
    background: linear-gradient(135deg, var(--mem-pink), var(--mem-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.memories-progress-container {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 105, 180, 0.2);
    margin-bottom: 1rem;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--mem-text);
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mem-pink), var(--mem-accent));
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Memories Controls */
.memory-add-btn {
    background: linear-gradient(135deg, var(--mem-accent) 0%, #db2777 100%);
    box-shadow: 0 4px 14px rgba(219, 39, 119, 0.3);
}
.memory-add-btn:hover {
    box-shadow: 0 6px 20px rgba(219, 39, 119, 0.4);
    transform: translateY(-2px);
}

.memories-filters .filter-btn.mem-active {
    background: rgba(255, 105, 180, 0.1);
    color: white;
    border-color: var(--mem-accent);
}

/* Memory Cards */
.memories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.memory-card {
    background: var(--mem-card-bg);
    border: 1px solid rgba(255, 105, 180, 0.15);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.5s ease backwards;
}

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

.memory-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 24px rgba(255, 105, 180, 0.15);
    border-color: rgba(255, 105, 180, 0.4);
}

.memory-card.discussed {
    background: var(--mem-success);
    border-color: var(--success);
}

.memory-category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    background: rgba(255, 105, 180, 0.2);
    color: var(--mem-pink);
    font-weight: 600;
}

.memory-card.discussed .memory-category-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.memory-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--mem-text);
    margin-top: 1rem;
    flex-grow: 1;
}

.memory-card.discussed h3 {
    text-decoration: line-through;
    opacity: 0.7;
}

.memory-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.discuss-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--mem-accent);
    background: transparent;
    color: var(--mem-pink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.discuss-btn.discussed-active {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.discuss-btn:hover:not(.discussed-active) {
    background: rgba(255, 105, 180, 0.1);
    transform: scale(1.05);
}

.mem-del-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    border: none;
    font-size: 1.2rem;
}
.mem-del-btn:hover {
    color: var(--danger);
}

/* Modal tweaks */
.memory-modal-content {
    border-color: rgba(255, 105, 180, 0.3);
}

/* ==========================================================================
   Religious / Spiritual Section
   ========================================================================== */

#view-religious {
    background: var(--religious-bg-gradient);
    border-radius: 24px;
    padding: 2rem;
    min-height: 80vh;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    margin-top: 1rem;
}

.religious-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.religious-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--soft-white);
    text-shadow: 0 0 20px var(--religious-glow);
    letter-spacing: 1px;
}

.religious-progress-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spiritual-progress {
    background: linear-gradient(90deg, #ffd766, #ffac33) !important;
    box-shadow: 0 0 15px rgba(255, 215, 102, 0.5);
}

.filters.spiritual-filters {
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.filters.spiritual-filters .filter-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--soft-white);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filters.spiritual-filters .filter-btn.rel-active {
    background: var(--religious-accent);
    color: #1a1a2e;
    box-shadow: 0 0 20px var(--religious-glow);
    font-weight: 600;
}

.spiritual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.spiritual-card {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    animation: fadeInUp 0.6s ease-out backwards;
}

.spiritual-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--religious-accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 30px var(--religious-glow);
}

.spiritual-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--religious-accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.spiritual-card:hover::before {
    opacity: 1;
}

.spiritual-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 5px var(--religious-glow));
}

.spiritual-card h3 {
    margin: 0;
    color: var(--soft-white);
    line-height: 1.6;
    font-size: 1.3rem;
    font-weight: 500;
}

.spiritual-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.spiritual-btn {
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spiritual-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--soft-white);
}

.spiritual-btn.active-discussed {
    background: var(--spiritual-green) !important;
    color: #2e7d32 !important;
    border-color: #2e7d32;
    box-shadow: 0 0 15px rgba(46, 125, 50, 0.3);
}

.spiritual-btn.active-fav {
    background: #ffebee !important;
    color: #c62828 !important;
    border-color: #c62828;
    box-shadow: 0 0 15px rgba(198, 40, 40, 0.3);
}

.spiritual-card.discussed {
    border-color: rgba(46, 125, 50, 0.5);
    background: rgba(46, 125, 50, 0.05);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

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