/* ===== HOMEWORK SCANNER ===== */
.homework-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* Upload / Camera area */
.hw-upload-card { background: white; border-radius: 24px; padding: 28px; border: 4px solid var(--sky); box-shadow: 0 8px 32px rgba(74,144,217,0.15); text-align: center; }
.hw-upload-title { font-family: 'Baloo 2', cursive; font-size: 1.4rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.hw-upload-sub { font-size: 0.88rem; color: var(--brown); margin-bottom: 24px; }
.hw-drop-zone {
  border: 4px dashed var(--sky); border-radius: 20px; padding: 40px 20px;
  background: linear-gradient(135deg, #f0f8ff, #e8f4ff); cursor: pointer;
  transition: all 0.25s; margin-bottom: 16px;
}
.hw-drop-zone:hover, .hw-drop-zone.drag-over { border-color: var(--blue); background: var(--sky); transform: scale(1.01); }
.hw-drop-icon { font-size: 3.5rem; margin-bottom: 12px; }
.hw-drop-text { font-family: 'Baloo 2', cursive; font-size: 1rem; font-weight: 700; color: var(--dark); }
.hw-drop-sub { font-size: 0.78rem; color: var(--brown); margin-top: 4px; }
.hw-upload-btn { display: none; }
.hw-btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hw-camera-btn { background: linear-gradient(135deg, var(--blue), #357abd); border: none; border-radius: 14px; padding: 12px 22px; font-family: 'Baloo 2', cursive; font-size: 1rem; font-weight: 700; color: white; cursor: pointer; transition: all 0.2s; }
.hw-camera-btn:hover { transform: translateY(-2px); }
.hw-file-btn { background: linear-gradient(135deg, var(--mint), #2ea87a); border: none; border-radius: 14px; padding: 12px 22px; font-family: 'Baloo 2', cursive; font-size: 1rem; font-weight: 700; color: white; cursor: pointer; transition: all 0.2s; }
.hw-file-btn:hover { transform: translateY(-2px); }

/* Image preview */
.hw-preview-wrap { margin-top: 16px; display: none; }
.hw-preview-wrap.show { display: block; }
.hw-preview-img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 14px; border: 3px solid var(--sky); }
.hw-analyze-btn { background: linear-gradient(135deg, var(--purple), #7D3C98); border: none; border-radius: 14px; padding: 14px 28px; font-family: 'Baloo 2', cursive; font-size: 1.1rem; font-weight: 700; color: white; cursor: pointer; width: 100%; margin-top: 14px; transition: all 0.2s; }
.hw-analyze-btn:hover { opacity: 0.9; transform: scale(1.01); }
.hw-analyze-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Loading state */
.hw-loading { text-align: center; padding: 40px 20px; display: none; }
.hw-loading.show { display: block; }
.hw-loading-icon { font-size: 3rem; animation: pulse 1s ease-in-out infinite; }
.hw-loading-text { font-family: 'Baloo 2', cursive; font-size: 1.1rem; font-weight: 700; color: var(--dark); margin-top: 12px; }

/* Analysis results */
.hw-results-card { background: white; border-radius: 24px; padding: 24px; border: 4px solid var(--mint); box-shadow: 0 8px 32px rgba(61,190,138,0.15); }
.hw-results-title { font-family: 'Baloo 2', cursive; font-size: 1.3rem; font-weight: 800; color: var(--dark); margin-bottom: 16px; }
.hw-topics-found { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.hw-topic-tag { background: var(--lavender); color: var(--purple); border-radius: 20px; padding: 4px 12px; font-size: 0.8rem; font-weight: 700; }
.hw-topic-tag.error { background: #FFB5B5; color: var(--red); }
.hw-errors-box { background: #FFF5F5; border: 3px solid #FFB5B5; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.hw-errors-title { font-family: 'Baloo 2', cursive; font-size: 0.95rem; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.hw-error-item { font-size: 0.85rem; color: var(--dark); margin-bottom: 6px; line-height: 1.5; }
.hw-exercises-title { font-family: 'Baloo 2', cursive; font-size: 1.1rem; font-weight: 800; color: var(--dark); margin-bottom: 12px; }
.hw-start-btn { background: linear-gradient(135deg, var(--green), #2ea87a); border: none; border-radius: 14px; padding: 14px 28px; font-family: 'Baloo 2', cursive; font-size: 1.1rem; font-weight: 700; color: white; cursor: pointer; width: 100%; transition: all 0.2s; }
.hw-start-btn:hover { transform: translateY(-2px); }

/* History */
.hw-history { margin-top: 20px; }
.hw-history-title { font-family: 'Baloo 2', cursive; font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 10px; }
.hw-history-item { background: var(--cream); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.hw-history-date { font-size: 0.78rem; font-weight: 700; color: var(--brown); }
.hw-history-summary { font-size: 0.82rem; color: var(--dark); }
.hw-history-badge { background: var(--mint); color: var(--green); border-radius: 20px; padding: 3px 10px; font-size: 0.75rem; font-weight: 700; }

@media (max-width: 700px) {
  .homework-layout { grid-template-columns: 1fr; }
}
