/* --- Dynamic Color Variables --- */
:root {
    --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --accent: #3498db;
    --success: #10b981;
    --success-bg: #ecfdf5; 
    --border-radius: 12px;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15); 
    --shadow: 0 4px 15px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* --- SCROLL LAYOUT LOGIC --- */
body { 
    background: var(--bg-gradient); color: var(--text-main); 
    height: 100dvh; overflow: hidden; 
    transition: background 0.4s ease, color 0.4s ease; 
}

.app-container { max-width: 800px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; }

.top-panel { 
    padding: 15px 20px 10px 20px; flex-shrink: 0; z-index: 10; 
    background: var(--bg-gradient);
    box-shadow: 0 10px 15px -10px rgba(0,0,0,0.1);
    transition: background 0.4s ease;
    display: flex; flex-direction: column; gap: 10px; /* Even spacing */
}

.scrollable-area {
    flex: 1; overflow-y: auto; padding: 15px 20px 40px 20px;
    scrollbar-width: thin; 
}
.scrollable-area::-webkit-scrollbar { width: 6px; }
.scrollable-area::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; opacity: 0.5; }

/* Theme & Header */
header { text-align: center; position: relative; margin-bottom: 5px;}
.theme-btn { position: absolute; right: 0; top: 0; background: var(--card-bg); border: none; font-size: 1.1rem; cursor: pointer; padding: 6px; border-radius: 50%; box-shadow: var(--shadow); transition: transform 0.2s; }
.theme-btn:active { transform: scale(0.9); }
header h1 { font-weight: 600; font-size: 1.4rem; letter-spacing: -0.5px; transition: color 0.4s; }
header p { color: var(--text-muted); font-size: 0.85rem; }

/* Progress Board */
.progress-board { background: var(--card-bg); padding: 12px 15px; border-radius: var(--border-radius); box-shadow: var(--shadow); transition: background 0.4s; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.badge { background: var(--accent); color: white; padding: 3px 8px; border-radius: 20px; font-size: 0.75rem; transition: background 0.3s, box-shadow 0.3s; }
.progress-bar-container { background: rgba(127, 140, 141, 0.2); height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 5px; }
.progress-fill { height: 100%; background-color: var(--success); width: 0%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent); background-size: 1rem 1rem; }
.progress-fill.active { animation: progress-stripes 1s linear infinite; }
.progress-fill.complete { background-image: none; box-shadow: 0 0 15px var(--success); animation: pulse-glow 2s infinite; }
@keyframes progress-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }
@keyframes pulse-glow { 0% { box-shadow: 0 0 8px var(--success); } 50% { box-shadow: 0 0 15px var(--success); } 100% { box-shadow: 0 0 8px var(--success); } }
.motivation { font-size: 0.75rem; color: var(--text-muted); text-align: center; font-style: italic;}

/* --- COMPACT INSURANCE CARD --- */
.insurance-card { background: var(--card-bg); padding: 10px; border-radius: var(--border-radius); box-shadow: var(--shadow); transition: background 0.4s; }
.insurance-card h3 { font-size: 0.8rem; margin-bottom: 8px; text-align: center; color: var(--text-main);}
.currency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; }
.currency-item { background: rgba(127, 140, 141, 0.05); padding: 5px; border-radius: 6px; text-align: center; font-size: 0.8rem; color: var(--text-main);}
.currency-label { font-size: 0.65rem; color: var(--text-muted); margin-bottom: 2px;}
.currency-value { font-weight: 600; font-size: 0.85rem;}

/* --- THE NEW BRIEFCASE ACCORDION --- */
.briefcase-container { background: var(--success-bg); border: 1px solid var(--success); border-radius: var(--border-radius); overflow: hidden; transition: background 0.4s; }
.briefcase-header { padding: 10px 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--success); font-weight: 600; font-size: 0.9rem; user-select: none; }
.briefcase-title-group { display: flex; align-items: center; gap: 8px; }
.arrow { font-size: 0.7rem; transition: transform 0.3s ease; }
.briefcase-header.open .arrow { transform: rotate(180deg); }
.briefcase-content { max-height: 0; overflow-y: auto; opacity: 0; transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease; }
.briefcase-content.open { max-height: 35vh; opacity: 1; padding: 0 10px 10px 10px; }
.briefcase-content::-webkit-scrollbar { width: 4px; }
.briefcase-content::-webkit-scrollbar-thumb { background: var(--success); border-radius: 10px; opacity: 0.5; }

/* Checklist Base Styles */
.category-section { margin-bottom: 20px; }
.category-title { font-size: 1.05rem; margin-bottom: 12px; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 3px; color: var(--text-main); }

/* --- THE FLYING ANIMATION --- */
.check-item { background: var(--card-bg); padding: 10px 15px; border-radius: 8px; margin-bottom: 8px; display: flex; align-items: center; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, background 0.3s; opacity: 1; transform: scale(1) translateY(0); }
.check-item:active { transform: scale(0.98); }
.check-item.animating-up { opacity: 0; transform: scale(0.8) translateY(-40px); pointer-events: none; }
.check-item.animating-down { opacity: 0; transform: scale(0.8) translateY(40px); pointer-events: none; }
.check-item.completed { background: rgba(16, 185, 129, 0.05); box-shadow: none; border: 1px solid rgba(16, 185, 129, 0.2); }
.check-item.completed .doc-name { text-decoration: line-through; color: var(--text-muted); }

/* Checkboxes */
.check-item input[type="checkbox"] { display: none; }
.custom-checkbox { width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 5px; margin-right: 12px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.check-item input:checked + .custom-checkbox { background: var(--success); border-color: var(--success); animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.check-item input:checked + .custom-checkbox::after { content: '✓'; color: white; font-size: 12px; font-weight: bold; }

/* Text */
.doc-text-wrapper { display: flex; flex-direction: column; justify-content: center; }
.doc-name { font-weight: 500; font-size: 0.9rem; transition: color 0.2s; color: var(--text-main);}
.doc-desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; font-style: italic; transition: color 0.2s; }
.check-item.completed .doc-desc { text-decoration: line-through; opacity: 0.6; }