@charset "UTF-8";

/* 1. 공통 변수 및 초기화 */
:root {
  --primary: #764ba2;
  --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg: #f8fafc;
  --text-main: #334155;
  --text-sub: #64748b;
  --danger: #ef4444;
}

/* [NEW] 모바일 브라우저 특유의 터치 시 파란색/회색 음영 깜빡임 제거 */
* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Noto Sans KR", sans-serif;
  background: var(--bg);
  margin: 0;
  /* [NEW] 최신 스마트폰(아이폰 등)의 하단 노치/홈바 영역을 침범하지 않도록 여백 확보 */
  padding-bottom: calc(50px + env(safe-area-inset-bottom));
  color: var(--text-main);
  line-height: 1.6;
}

/* [NEW] 버튼이나 텍스트를 실수로 길게 눌렀을 때 텍스트가 블록 지정(선택)되는 현상 방지 */
.btn-submit,
.btn-modal,
.upload-trigger,
.year-btn,
.btn-del {
  user-select: none;
  -webkit-user-select: none;
}

/* 2. 레이아웃 & 헤더 */
.header {
  background: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-back {
  text-decoration: none;
  color: var(--text-sub);
  font-size: 20px;
  margin-right: 15px;
}

.header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

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

/* 3. 업로드 현황 카드 */
.status-card {
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.progress-container {
  width: 100%;
  background: #f1f5f9;
  height: 10px;
  border-radius: 5px;
  margin: 10px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--grad);
  transition: width 0.5s ease;
}

.upload-trigger {
  background: var(--grad);
  color: white;
  border: none;
  width: 100%;
  padding: 15px;
  border-radius: 15px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.2s;
}

.upload-trigger:active {
  transform: scale(0.98);
}

.upload-trigger:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* 4. 사진 그리드 & 카드 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.photo-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.photo-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}

.photo-info {
  padding: 10px;
  background: white;
}

.photo-age {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  background: #f3f0ff;
  padding: 2px 6px;
  border-radius: 4px;
}

.photo-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 5. 모달 (Modal) */
#cropModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 90%;
  max-width: 400px;
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-sizing: border-box;
}

.crop-area {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #eee;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 5px;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-sizing: border-box;
  font-size: 14px;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-modal {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* --- studio_ai.php 전용 스타일 (추가분) --- */

/* 연도 선택기 바둑판 컨테이너 */
.year-grid-container {
  background: #f8fafc;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid #e2e8f0;
}

/* 4열 바둑판 배열 */
.year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;

  /* [NEW] 연도 선택 스크롤 영역의 기본 스크롤바 숨기기 */
  -ms-overflow-style: none; /* IE, Edge */
  scrollbar-width: none; /* Firefox */
}
/* [NEW] 크롬, 사파리 등 스크롤바 숨기기 */
.year-grid::-webkit-scrollbar {
  display: none;
}

/* 연도 버튼 (어르신용 큰 사이즈) */
.year-btn {
  padding: 15px 5px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: white;
  font-size: 16px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* 활성화된 연도 */
.year-btn.active {
  background: var(--grad);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
}

/* AI 결과물 카드 */
.studio-card {
  background: white;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

/* 사진 및 영상 박스 */
.media-box {
  width: 100%;
  background: #f1f5f9;
  border-radius: 16px;
  overflow: hidden;
  margin-top: 15px;
}

.photo-res {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}
.video-res {
  width: 100%;
  aspect-ratio: 9/16;
  background: #000;
  display: block;
}

/* 공통 버튼 추가 스타일 */
.btn-submit {
  background: var(--grad);
  color: white;
  border: none;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.btn-icon {
  text-decoration: none;
  font-size: 13px;
  color: var(--primary);
  background: #f3f0ff;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: bold;
}
