.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; }
.form-section { margin-bottom: 30px; }
.form-section:last-child { margin-bottom: 0; }
.form-label { display: block; font-weight: 700; color: #1e293b; margin-bottom: 15px; font-size: 1.1rem; }
.form-desc { color: #64748b; font-size: 0.9rem; margin-top: -10px; margin-bottom: 15px; }

/* Topic Selection */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 250px; overflow-y: auto; padding: 5px; }
.topic-checkbox { display: none; }
.topic-label { display: block; padding: 10px 15px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; color: #475569; text-align: center; user-select: none; }
.topic-label:hover { background: #f1f5f9; border-color: #cbd5e1; }
.topic-checkbox:checked + .topic-label { background: #ecfdf5; border-color: #10b981; color: #047857; font-weight: 600; box-shadow: 0 2px 4px rgba(16,185,129,0.1); }

/* Radio Selection */
.radio-group { display: flex; gap: 15px; flex-wrap: wrap; }
.radio-input { display: none; }
.radio-label { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer; transition: all 0.2s; font-weight: 500; color: #475569; }
.radio-label:hover { border-color: #cbd5e1; }
.radio-label::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; display: inline-block; transition: all 0.2s; }
.radio-input:checked + .radio-label { border-color: #10b981; background: #ecfdf5; color: #047857; }
.radio-input:checked + .radio-label::before { border-color: #10b981; background: #10b981; box-shadow: inset 0 0 0 3px #ecfdf5; }

.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, #10b981, #059669); width: 100%; max-width: 300px; margin: 0 auto; }
.btn-ai:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(16,185,129,0.3); }

/* Timeline Result */
#rencana-result-container { display: none; }
.summary-card { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-radius: 16px; padding: 30px; margin-bottom: 40px; border: 1px solid #bbf7d0; }
.summary-title { font-size: 1.2rem; font-weight: 700; color: #166534; margin-bottom: 10px; }
.summary-text { color: #15803d; line-height: 1.6; margin: 0; }

.timeline { position: relative; padding-left: 40px; margin-bottom: 40px; }
.timeline::before { content: ''; position: absolute; left: 19px; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.timeline-item { position: relative; margin-bottom: 30px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 25px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker { position: absolute; left: -31px; top: 25px; width: 20px; height: 20px; border-radius: 50%; background: #10b981; border: 4px solid #fff; box-shadow: 0 0 0 2px #e2e8f0; z-index: 1; }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px; }
.timeline-day { font-size: 1.2rem; font-weight: 800; color: #1e293b; margin: 0; display: flex; align-items: center; gap: 10px; }
.timeline-day span { font-size: 0.85rem; font-weight: 600; padding: 3px 10px; background: #f1f5f9; color: #475569; border-radius: 20px; }
.timeline-content { display: flex; gap: 20px; }
@media (max-width: 768px) { .timeline-content { flex-direction: column; } }
.timeline-book { width: 120px; flex-shrink: 0; }
.timeline-book img { width: 100%; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.timeline-details { flex-grow: 1; }
.timeline-task { font-size: 1.1rem; font-weight: 700; color: #334155; margin-bottom: 15px; }
.timeline-meta { display: flex; gap: 15px; margin-bottom: 15px; }
.meta-badge { font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.meta-pages { background: #eff6ff; color: #1d4ed8; }
.meta-time { background: #fef3c7; color: #b45309; }
.timeline-tips { background: #f8fafc; padding: 15px; border-radius: 8px; border-left: 4px solid #f59e0b; margin-bottom: 15px; }
.timeline-tips h5 { margin: 0 0 5px; font-size: 0.9rem; color: #b45309; font-weight: 700; }
.timeline-tips p { margin: 0; font-size: 0.9rem; color: #475569; }
.timeline-quote { font-style: italic; color: #64748b; border-left: 2px solid #cbd5e1; padding-left: 15px; font-size: 0.95rem; }

.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 #10b981; 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-card { padding: 25px 20px; }
    .form-label { font-size: 1rem; }
    .form-desc { font-size: 0.85rem; }
    .topic-label { font-size: 0.85rem; padding: 8px 12px; }
    .radio-label { font-size: 0.9rem; padding: 10px 15px; }
    .btn-ai { font-size: 0.95rem; padding: 12px 20px; }
    .summary-card { padding: 20px; margin-bottom: 30px; }
    .summary-title { font-size: 1.1rem; }
    .timeline-item { padding: 20px; }
    .timeline-day { font-size: 1.1rem; }
    .timeline-task { font-size: 1rem; margin-bottom: 10px; }
    .meta-badge { font-size: 0.75rem; padding: 4px 8px; }
    .timeline-tips h5 { font-size: 0.85rem; }
    .timeline-tips p { font-size: 0.85rem; }
    .timeline-book { width: 100px; }
}

@media print {
    body { background: #fff !important; }
    .no-print, header, footer, .main-header, .main-footer, .mobile-bottom-nav, #rencana-input-container { display: none !important; }
    .ai-page { padding: 0; max-width: 100%; margin: 0; }
    .timeline-item { page-break-inside: avoid; border: 1px solid #ccc; box-shadow: none; margin-bottom: 20px; }
    .summary-card { background: #fff !important; border: 1px solid #ccc !important; color: #000 !important; }
    .summary-title, .summary-text { color: #000 !important; }
}
