/* ===== 기본 초기화 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f4f0;
  color: #2d3436;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== 화면 전환 ===== */
.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ===== 버튼 공통 ===== */
.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #27ae60;
  color: white;
}

.btn-primary:hover {
  background: #219a52;
}

.btn-primary:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #ecf0f1;
  color: #2d3436;
}

.btn-secondary:hover {
  background: #dfe6e9;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-back {
  background: none;
  color: #27ae60;
  padding: 8px 0;
  font-size: 15px;
}

.btn-full {
  width: 100%;
  margin-top: 24px;
}

/* ===== 로그인 화면 ===== */
#loginScreen {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 50%, #1abc9c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.app-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.login-card h1 {
  font-size: 24px;
  color: #2d3436;
  margin-bottom: 8px;
}

.subtitle {
  color: #636e72;
  font-size: 14px;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form label {
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #2d3436;
}

.login-form input {
  padding: 14px 16px;
  border: 2px solid #dfe6e9;
  border-radius: 12px;
  font-size: 18px;
  text-align: center;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: #27ae60;
}

/* ===== 대시보드 ===== */
#dashboardScreen {
  background: #f0f4f0;
}

.dashboard-header {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-header h1 {
  font-size: 18px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

/* ===== 깜박이는 텍스트 ===== */
.blink-text {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #27ae60;
  margin-bottom: 28px;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ===== 업로드 카드 (2컬럼) ===== */
.upload-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.upload-card {
  background: white;
  border-radius: 20px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.upload-card:hover {
  border-color: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(39, 174, 96, 0.15);
}

.upload-card:active {
  transform: scale(0.97);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-card p {
  font-size: 15px;
  font-weight: 700;
  color: #2d3436;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 12px;
  color: #b2bec3;
}

/* ===== 미리보기 ===== */
.preview-section {
  background: white;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.preview-section img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  margin-bottom: 16px;
  object-fit: contain;
}

.preview-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.preview-actions .btn {
  flex: 1;
}

/* ===== 로딩 ===== */
.loading-section {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #e0e0e0;
  border-top: 5px solid #27ae60;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-section p {
  color: #636e72;
  font-size: 16px;
  font-weight: 500;
}

/* ===== 결과 화면 ===== */
#resultScreen {
  background: #f0f4f0;
}

.result-header {
  margin-bottom: 20px;
}

.result-header h1 {
  font-size: 22px;
  color: #2d3436;
  margin-top: 8px;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 상태 배지 */
.status-badge {
  text-align: center;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
}

.status-badge.healthy {
  background: #d4edda;
  color: #155724;
}

.status-badge.diseased {
  background: #f8d7da;
  color: #721c24;
}

.status-badge.not-plant {
  background: #fff3cd;
  color: #856404;
}

/* 결과 카드 */
.result-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.photo-card {
  text-align: center;
  padding: 12px;
}

.photo-card img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  object-fit: contain;
}

.card-label {
  font-size: 14px;
  font-weight: 700;
  color: #27ae60;
  margin-bottom: 8px;
}

.card-value {
  font-size: 15px;
  line-height: 1.7;
  color: #2d3436;
  white-space: pre-wrap;
}

/* ===== 반응형 ===== */
@media (max-width: 400px) {
  .container {
    padding: 12px;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .upload-columns {
    gap: 10px;
  }

  .card-icon {
    font-size: 36px;
  }
}
