:root {
    --brand: #4f46e5;
    --brand-light: #818cf8;
    --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --bg-app: #f8fafc;
    --surface: #ffffff;
    --surface-secondary: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --border: rgba(0, 0, 0, 0.05);
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body.dark-theme {
    --bg-app: #0f172a;
    --surface: #1e293b;
    --surface-secondary: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* Header & Navigation */
header {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    margin: 0; /* Reset margin */
}

nav { display: flex; justify-content: center; gap: 12px; }
nav button {
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    background: var(--surface-secondary);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
nav button.active { background: var(--text-main); color: var(--surface); transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

/* Responsive Header */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    .header-brand {
        justify-content: space-between;
    }
    .header-nav {
        justify-content: space-between;
    }
    header {
        padding: 1rem 0;
    }
    nav {
        flex-grow: 1;
    }
    nav button {
        flex-grow: 1;
        text-align: center;
        padding: 10px 12px;
    }
    .filter-bar {
        flex-wrap: wrap;
    }
}


/* Sections */
section { padding: 3rem 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.section-header h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; }
.hidden { display: none !important; }

/* Filter Bar */
.filter-bar {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 2rem;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand) transparent;
}
.filter-bar::-webkit-scrollbar { height: 4px; display: block; }
.filter-bar::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 10px; }
.filter-tag {
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.filter-tag.active { background: var(--brand); color: white; border-color: var(--brand); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }

/* Buttons */
.btn-primary { 
    background: var(--brand-gradient); 
    color: white; 
    border: none; 
    padding: 12px 28px; 
    border-radius: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 25px -5px rgba(79, 70, 229, 0.5); }

.btn-block { 
    width: 100%; 
    padding: 18px; 
    background: var(--brand-gradient); 
    color: white; 
    border: none; 
    border-radius: 18px; 
    font-weight: 600; 
    font-size: 1rem;
    cursor: pointer; 
    margin-top: 24px; 
    transition: all 0.3s;
    box-shadow: 0 8px 20px -5px rgba(79, 70, 229, 0.3);
}
.btn-block:hover { transform: translateY(-2px); box-shadow: 0 12px 25px -5px rgba(79, 70, 229, 0.4); }

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    width: 100%;
}
.management-header {
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.management-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
#general-actions { 
    margin-top: 0; 
    display: flex;
    flex-direction: column;
    width: 100%;
}
.btn-success { background: var(--success); color: white; border: none; padding: 14px 20px; border-radius: 14px; font-weight: 600; cursor: pointer; flex: 1; transition: all 0.3s; box-shadow: 0 8px 20px -5px rgba(5, 150, 105, 0.2); font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-danger { background: rgba(220, 38, 38, 0.08); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.12); padding: 14px 20px; border-radius: 14px; font-weight: 600; cursor: pointer; flex: 1; transition: all 0.3s; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-outline { background: var(--surface); color: var(--brand); border: 2px solid var(--brand); padding: 14px 20px; border-radius: 14px; font-weight: 600; cursor: pointer; flex: 1; transition: all 0.3s; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: none; }
.btn-outline:hover { background: var(--surface-secondary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 12px 25px -5px rgba(5, 150, 105, 0.4); background: #047857; }
.btn-danger:hover { transform: translateY(-2px); background: rgba(220, 38, 38, 0.15); border-color: var(--danger); }

/* Challenge Cards */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.challenge-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-image {
    height: 160px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to top, var(--surface), transparent);
}

.card-body {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.challenge-card:hover { 
    transform: translateY(-10px); 
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-light);
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-top h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-main); }
.tag { font-size: 0.7rem; padding: 4px 12px; border-radius: 8px; background: var(--surface-secondary); color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.short-desc { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.5; flex: 1; }

/* Hero Section */
.discover-hero {
    background: var(--brand-gradient);
    border-radius: 32px;
    padding: 4rem 2rem;
    color: white;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
}

.discover-hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.hero-content h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; color: white; -webkit-text-fill-color: initial; background: none; }
.hero-content h1 span { opacity: 0.8; font-weight: 400; }
.hero-content p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2.5rem; }

.search-wrapper {
    position: relative;
    max-width: 450px;
    margin: 0 auto;
}
.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand);
    z-index: 2;
}
#challenge-search {
    padding: 18px 20px 18px 55px;
    border-radius: 20px;
    border: none;
    background: white;
    color: #0f172a;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
#challenge-search:focus {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Footer Styling */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 3rem;
}
.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; }
.footer-credits strong { color: var(--brand); font-weight: 700; }
.footer-links { display: flex; gap: 20px; margin-top: 15px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.2s; }
.footer-links a:hover { color: var(--brand); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Scrollbar adjustment for dark theme */
body.dark-theme #challenge-search { background: #1e293b; color: white; }
body.dark-theme .card-image::after { background: linear-gradient(to top, var(--surface), transparent); }

/* Progress Info */
.progress-container { 
    height: 8px; 
    background: var(--surface-secondary); 
    border-radius: 999px; 
    overflow: hidden; 
    margin-bottom: 4px;
    display: flex;
    width: 100%;
}
.progress-bar { 
    height: 100%; 
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-bar-success {
    background: var(--success);
}
.progress-bar-failed {
    background: var(--danger);
}
.progress-info small { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; }

/* Form Styling */
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
input, textarea, select {
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    border: 2px solid var(--border);
    background: var(--surface-secondary);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Matrix Refinement */
.matrix-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface-secondary);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--surface);
    color: var(--brand);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.matrix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}
.matrix-box {
    aspect-ratio: 1;
    border-radius: 14px;
    background: var(--surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    cursor: pointer;
}
.matrix-box svg {
    display: block;
    flex-shrink: 0;
}
.matrix-box:hover { background: var(--border); transform: translateY(-2px); }
.matrix-box.selected { border-color: var(--brand); background: var(--surface); color: var(--brand); z-index: 10; transform: scale(1.1); box-shadow: 0 5px 15px rgba(79, 70, 229, 0.2); }
.matrix-box.done { background: var(--success); color: white; border-color: transparent; }
.matrix-box.failed { background: var(--danger); color: white; border-color: transparent; opacity: 0.8; }
.matrix-box.today { border-color: var(--brand); border-style: dashed; }

.details-short-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.guide-expand-btn {
    display: none;
}
.guide-content {
    line-height: 1.7;
    color: var(--text-main);
}
.guide-content h4 {
    color: var(--brand);
    font-size: 1.1rem;
}
.guide-content ul, .guide-content ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}
.guide-content li {
    margin-bottom: 0.5rem;
}
.guide-content strong {
    color: var(--brand-light);
}

/* Modal Refinement */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal.active { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 550px;
    border-radius: 40px 40px 0 0;
    padding: 3rem;
    max-height: 95vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -15px 50px rgba(0,0,0,0.15);
}
@media (min-width: 600px) {
    .modal { align-items: center; padding: 20px; }
    .modal-content { border-radius: 32px; transform: scale(0.9) translateY(40px); }
    .modal.active .modal-content { transform: scale(1) translateY(0); }
}
.modal.active .modal-content { transform: translateY(0); }

.close-modal { 
    position: absolute; 
    right: 1.5rem; 
    top: 1.5rem; 
    width: 32px; 
    height: 32px; 
    background: var(--surface-secondary); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--text-muted); 
    cursor: pointer; 
    transition: all 0.2s ease; 
}
.close-modal:hover { 
    background: var(--brand); 
    color: white;
    transform: scale(1.1); 
}

/* Dashboard Hero */
.dashboard-hero {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 3px dashed var(--border);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero-icon { font-size: 5rem; margin-bottom: 1.5rem; display: block; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); }
.dashboard-hero h3 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-main); }
.dashboard-hero p { color: var(--text-muted); margin-bottom: 2rem; max-width: 400px; }

/* Custom Confirm Modal */
.confirm-content {
    text-align: center;
    padding: 3rem !important;
}
.confirm-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
}
.confirm-content h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}
.confirm-content p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Details View */
.guide-container { background: var(--surface-secondary); padding: 2rem; border-radius: 24px; border: 1px solid var(--border); margin: 2rem 0; }
.guide-container h4 { margin: 1rem auto 0; font-weight: 600; font-size: 1.1rem; }
#details-guide { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 50px;}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--surface);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 4px solid var(--brand);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out forwards;
    min-width: 250px;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Form Refinement */
.form-group input, .form-group textarea, .form-group select {
    background: var(--surface);
    border: 2px solid var(--border);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.form-group label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* View Details Button in Grid */
.btn-view-details {
    margin-top: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--surface-secondary);
    color: var(--brand);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
body.dark-theme .btn-view-details {
    color: var(--brand-light);
    border-color: rgba(255,255,255,0.1);
}
.btn-view-details:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

/* Card Actions Refinement */
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.5rem;
}
.btn-view {
    flex: 1;
    padding: 12px;
    background: var(--brand-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.btn-settings {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}
.btn-settings svg { transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.btn-settings:hover { background: var(--border); color: var(--text-main); }
.btn-settings:hover svg { transform: rotate(90deg); }

/* Schedule Info */
.schedule-info {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Day Selector */
.day-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.day-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.day-btn.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

/* Switch Styling */
.switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--surface-secondary);
    border-radius: 16px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--brand); }
input:checked + .slider:before { transform: translateX(20px); }

/* New UI Elements */
.btn-icon {
    background: var(--surface-secondary);
    border: none;
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover { background: var(--border); transform: scale(1.05); }

.heart-btn {
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
}
.heart-btn.active { color: #ef4444; transform: scale(1.2); }

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 5px;
    align-self: center;
}

.archive-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}
.archive-btn:hover { transform: scale(1.1); opacity: 1; color: var(--danger); }

.restore-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.restore-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2); }

.btn-favorite {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-favorite.active {
    color: #ef4444;
    background: white;
}

.btn-favorite:hover {
    transform: scale(1.1);
    background: white;
}

.btn-favorite svg {
    width: 22px;
    height: 22px;
}

.changelog-date {
    display: none;
}

body.dark-theme .sun-icon { display: none; }
body.dark-theme .moon-icon { display: block; color: #fbbf24; }

/* Responsive */
@media (max-width: 600px) {
    .challenges-grid { grid-template-columns: 1fr; }
    .container { padding: 0 20px; }
    .modal-content { padding: 2.5rem 1.5rem; }
    .section-header h2 { font-size: 1.5rem; }
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f2d74e;
    top: -10px;
    z-index: 9999;
    pointer-events: none;
    border-radius: 2px;
    animation: fall linear forwards;
}
@keyframes fall {
    to { transform: translateY(100vh) rotate(720deg); }
}

/* Streak Badge */
.streak-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white !important;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: streakBounce 2s infinite;
}

@keyframes streakBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Export/Import */
.data-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}


/* Completed Challenge Styles */
.challenge-card.card-completed {
    border: 2px solid #ffc107; /* Brighter gold */
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

.challenge-card.card-completed .card-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(30, 30, 30, 0.5), transparent);
    opacity: 0.8;
}

.completed-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(145deg, #ffd700, #ffb300);
    color: #422d00;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 2;
    border: 2px solid rgba(255,255,255,0.5);
}
