.ai-page { padding: 40px 20px 80px; max-width: 1100px; margin: 0 auto; }
.ai-header { text-align: center; margin-bottom: 50px; }
.ai-header h1 { font-size: 2.2rem; font-weight: 700; color: #16477f; margin-bottom: 15px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.ai-header p { color: #64748b; font-size: 1.1rem; max-width: 600px; margin: 0 auto; line-height: 1.5; }

.form-card { background: #fff; border-radius: 20px; padding: 40px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; margin-bottom: 40px; }

.family-member-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; margin-bottom: 20px; position: relative; }
.btn-remove-member { position: absolute; top: 15px; right: 15px; color: #ef4444; background: #fee2e2; border: none; border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.btn-remove-member:hover { background: #ef4444; color: #fff; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group label { display: block; font-weight: 600; color: #334155; margin-bottom: 8px; font-size: 0.9rem; }
.form-input { width: 100%; padding: 12px 15px; border: 1px solid #cbd5e1; border-radius: 8px; outline: none; transition: border-color 0.2s; font-family: inherit; }
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.btn-add-member { background: #eff6ff; color: #2563eb; border: 2px dashed #93c5fd; padding: 15px; border-radius: 12px; font-weight: 600; cursor: pointer; width: 100%; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 30px; }
.btn-add-member:hover { background: #dbeafe; border-color: #60a5fa; }

.btn-ai { padding: 14px 30px; border-radius: 12px; font-weight: 700; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.2s; font-size: 1rem; color: white; background: linear-gradient(135deg, #3b82f6, #2563eb); width: 100%; max-width: 300px; margin: 0 auto; }
.btn-ai:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(59,130,246,0.3); }

/* Result State */
#literasi-result-container { display: none; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 300px; gap: 30px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.profile-card { background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid #bfdbfe; border-radius: 20px; padding: 30px; margin-bottom: 30px; text-align: center; }
.profile-score { font-size: 3rem; font-weight: 800; color: #1d4ed8; line-height: 1; margin: 15px 0 5px; }
.profile-level { font-size: 1.2rem; font-weight: 700; color: #2563eb; text-transform: uppercase; letter-spacing: 1px; }

.member-recom { background: #fff; border-radius: 16px; border: 1px solid #e2e8f0; padding: 25px; margin-bottom: 25px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.member-recom h3 { font-size: 1.3rem; font-weight: 700; color: #1e293b; margin: 0 0 5px; border-bottom: 2px solid #f1f5f9; padding-bottom: 15px; margin-bottom: 20px; }
.member-target { font-size: 0.9rem; color: #64748b; background: #f8fafc; padding: 5px 12px; border-radius: 20px; display: inline-block; margin-bottom: 15px; }

.books-flex { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; }
.book-mini-card { flex: 0 0 120px; text-decoration: none; color: inherit; }
.book-mini-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 8px; }
.book-mini-title { font-size: 0.8rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sidebar-box { background: #fff; border-radius: 16px; border: 1px solid #e2e8f0; padding: 25px; margin-bottom: 25px; }
.sidebar-box h4 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; font-weight: 700; color: #1e293b; margin: 0 0 20px; }
.activity-item { padding-left: 20px; border-left: 2px solid #e2e8f0; margin-bottom: 20px; position: relative; }
.activity-item::before { content: ''; position: absolute; left: -6px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: #3b82f6; }
.activity-item h5 { font-size: 0.95rem; font-weight: 700; color: #334155; margin: 0 0 5px; }
.activity-item p { font-size: 0.9rem; color: #64748b; margin: 0; }

.challenge-card { background: linear-gradient(135deg, #fef2f2, #fee2e2); border: 1px solid #fecaca; border-radius: 12px; padding: 20px; margin-bottom: 15px; }
.challenge-card h5 { color: #991b1b; margin: 0 0 5px; font-weight: 700; }
.challenge-card p { color: #b91c1c; font-size: 0.9rem; margin: 0 0 10px; }
.challenge-reward { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; font-weight: 600; color: #b45309; background: #fef3c7; padding: 4px 10px; border-radius: 20px; }

.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.9); z-index: 1000; display: none; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 50px; height: 50px; border: 5px solid #f3f3f3; border-top: 5px solid #3b82f6; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .ai-page { padding: 20px 10px 40px; }
    .ai-header h1 { font-size: 1.6rem; }
    .ai-header p { font-size: 0.95rem; }
    .form-container, .setup-box, .stat-box { padding: 20px; }
    .input-group label { font-size: 0.95rem; }
    .input-group select { font-size: 0.95rem; padding: 10px; }
    .member-item { padding: 15px; flex-direction: column; align-items: stretch; gap: 10px; }
    .target-box { padding: 15px; }
    .target-box h3 { font-size: 1.15rem; }
    .stat-number { font-size: 2rem; }
    .stat-label { font-size: 0.85rem; }
    .dashboard-grid { gap: 20px; }
}
