.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; }

.mood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; margin-bottom: 40px; }
.mood-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 20px; padding: 25px 15px; text-align: center; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); user-select: none; }
.mood-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-color: #cbd5e1; }
.mood-card.selected { border-color: var(--mood-color); background: var(--mood-light); }
.mood-card.selected .mood-emoji { transform: scale(1.1); }
.mood-emoji { font-size: 3rem; margin-bottom: 10px; display: block; transition: transform 0.2s; }
.mood-label { font-weight: 700; color: #334155; font-size: 0.95rem; }

.mood-desc-area { background: #fff; padding: 30px; border-radius: 20px; border: 1px solid #e2e8f0; margin-bottom: 30px; display: none; animation: fadeIn 0.4s; }
.mood-desc-area label { font-weight: 600; color: #1e293b; margin-bottom: 10px; display: block; }
.mood-desc-area textarea { width: 100%; border: 2px solid #e2e8f0; border-radius: 12px; padding: 15px; font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s; resize: vertical; min-height: 100px; }
.mood-desc-area textarea:focus { border-color: var(--opac-blue); }

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

/* Result State */
#mood-result-container { display: none; }
.result-banner { padding: 40px; border-radius: 24px; color: white; margin-bottom: 40px; text-align: center; position: relative; overflow: hidden; }
.result-banner::before { content: '"'; position: absolute; font-size: 15rem; font-family: serif; opacity: 0.1; top: -50px; left: 20px; line-height: 1; }
.quote-text { font-size: 1.5rem; font-style: italic; font-weight: 600; margin-bottom: 20px; position: relative; z-index: 1; }
.analysis-text { font-size: 1.05rem; opacity: 0.9; max-width: 800px; margin: 0 auto; line-height: 1.6; }

.section-title { font-size: 1.4rem; font-weight: 700; color: #1e293b; margin: 0 0 20px; display: flex; align-items: center; gap: 10px; }

.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.book-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; text-decoration: none; color: inherit; transition: transform 0.2s; display: flex; flex-direction: column; }
.book-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.book-cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: #f1f5f9; }
.book-info { padding: 15px; flex-grow: 1; }
.book-title { font-weight: 700; font-size: 0.9rem; margin: 0 0 5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-author { font-size: 0.8rem; color: #64748b; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.playlist-card { background: #fff; border-radius: 16px; border: 1px solid #e2e8f0; padding: 25px; height: 100%; }
.playlist-item { display: flex; gap: 15px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #f1f5f9; }
.playlist-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.playlist-number { width: 32px; height: 32px; border-radius: 50%; background: #f1f5f9; color: #475569; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.playlist-content h4 { margin: 0 0 5px; font-size: 1rem; color: #1e293b; }
.playlist-content p { margin: 0; font-size: 0.9rem; color: #64748b; line-height: 1.5; }

.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 #f59e0b; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 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; }
    .mood-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .mood-card { padding: 15px 10px; }
    .mood-emoji { font-size: 2.5rem; }
    .mood-label { font-size: 0.85rem; }
    .btn-ai { font-size: 0.95rem; padding: 12px 20px; }
    .result-banner { padding: 25px 20px; margin-bottom: 30px; }
    .result-banner::before { font-size: 10rem; top: -30px; left: 10px; }
    .quote-text { font-size: 1.2rem; margin-bottom: 15px; }
    .analysis-text { font-size: 0.95rem; }
    .section-title { font-size: 1.2rem; }
    .playlist-card { padding: 20px; }
}
