/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a2e1a;
  background: #f5faf5;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== Nav ===== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #1a2e1a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 1.3rem; font-weight: 700; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: #aaa; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #a5d6a7; }

.nav-auth-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.lang-select {
  padding: .25rem .4rem;
  border-radius: 6px;
  border: 1px solid #4caf50;
  background: #f1f8e9;
  color: #1b5e20;
  font-size: .8rem;
  cursor: pointer;
  outline: none;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: linear-gradient(135deg, #1a2e1a, #1e3a1e, #1b5e20);
  color: #fff;
}
.hero h1 { font-size: 2.6rem; margin-bottom: .75rem; }
.hero p { font-size: 1.1rem; color: #b0bec5; }
.btn-hero-recommend {
  margin-top: 1.2rem;
  padding: .9rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #76c843, #1b5e20);
  color: #fff;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 15px rgba(118, 200, 67, .4);
}
.btn-hero-recommend:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(118, 200, 67, .5);
}

/* ===== Section ===== */
.section { padding: 2.5rem 2rem; max-width: 1280px; margin: 0 auto; }
.section-alt {
  background: #e8f0e8;
  max-width: 100%;
  padding: 2.5rem 2rem;
}
.section-alt > h2,
.section-alt > p,
.section-alt > .compare-area {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}
.section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 1rem; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

#search {
  flex: 1 1 280px;
  padding: .7rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
#search:focus { border-color: #1b5e20; }

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.filter-group select {
  padding: .6rem .8rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
  cursor: pointer;
  outline: none;
}
.filter-group select:focus { border-color: #1b5e20; }

.result-count {
  font-size: .9rem;
  color: #666;
  margin-bottom: 1rem;
}

/* ===== String Card Grid ===== */
.string-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.string-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  position: relative;
}
.string-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.card-header h3 {
  font-size: 1.15rem;
  color: #1a2e1a;
}
.card-brand {
  font-size: .85rem;
  color: #666;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-poly { background: #e8f5e9; color: #2e7d32; }
.badge-multi { background: #f3e5f5; color: #6a1b9a; }
.badge-gut { background: #fff3e0; color: #e65100; }
.badge-nylon { background: #e8f5e9; color: #2e7d32; }
.badge-stiff { background: #fce4ec; color: #c62828; }
.badge-medium { background: #fff9c4; color: #f57f17; }
.badge-soft { background: #e0f7fa; color: #00695c; }

/* Rating bars */
.rating-bars { margin-bottom: .75rem; }

.rating-row {
  display: flex;
  align-items: center;
  margin-bottom: .35rem;
  font-size: .8rem;
}

.rating-label {
  width: 52px;
  color: #555;
  flex-shrink: 0;
}

.rating-track {
  flex: 1;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin: 0 .5rem;
}

.rating-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

.rating-value {
  width: 16px;
  text-align: right;
  color: #333;
  font-weight: 600;
}

.fill-1 { width: 20%; background: #ef5350; }
.fill-2 { width: 40%; background: #ff9800; }
.fill-3 { width: 60%; background: #fdd835; }
.fill-4 { width: 80%; background: #66bb6a; }
.fill-5 { width: 100%; background: #26a69a; }

/* Card actions */
.card-social {
  padding-top: .75rem;
  border-top: 1px solid #f0f0f0;
  margin-bottom: .5rem;
}

.card-social-actions {
  display: flex;
  gap: .5rem;
  margin-bottom: .35rem;
}

.card-like-btn, .card-comment-btn {
  background: none;
  border: none;
  font-size: .95rem;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 6px;
  transition: all .15s;
  line-height: 1;
  color: #555;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card-like-btn:hover { color: #e53935; }
.card-comment-btn:hover { color: #1b5e20; }

.card-like-btn .like-icon,
.card-comment-btn .comment-icon {
  font-size: 1.2rem;
}

.card-like-btn .count,
.card-comment-btn .count {
  font-size: .8rem;
  font-weight: 600;
}

.card-like-btn.liked {
  color: #e53935;
}
.card-like-btn.liked .like-icon {
  animation: likePop .3s ease;
}
@keyframes likePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.card-actions {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}

.btn {
  padding: .4rem .8rem;
  border: none;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-detail {
  background: #e8f5e9;
  color: #2e7d32;
}
.btn-detail:hover { background: #c8e6c9; }

.btn-compare {
  background: #e0f2f1;
  color: #00695c;
}
.btn-compare:hover { background: #b2dfdb; }
.btn-compare.active {
  background: #00695c;
  color: #fff;
}

/* ===== Compare Section ===== */
.compare-hint {
  text-align: center;
  color: #666;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}

.compare-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  min-height: 100px;
}

.compare-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  padding: 2rem;
  border: 2px dashed #ccc;
  border-radius: 12px;
}

.compare-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: relative;
}

.compare-card h3 {
  font-size: 1.1rem;
  margin-bottom: .25rem;
}

.compare-card .card-brand {
  margin-bottom: .75rem;
}

.compare-remove {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 24px;
  height: 24px;
  border: none;
  background: #eee;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 24px;
  text-align: center;
  color: #666;
}
.compare-remove:hover { background: #ef5350; color: #fff; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #eee; }

.modal h2 { font-size: 1.5rem; margin-bottom: .25rem; text-align: left; }
.modal .card-brand { margin-bottom: 1rem; }

.modal .detail-section {
  margin-bottom: 1.25rem;
}
.modal .detail-section h4 {
  font-size: .95rem;
  color: #1b5e20;
  margin-bottom: .5rem;
  border-bottom: 2px solid #e8f5e9;
  padding-bottom: .25rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
  font-size: .9rem;
  border-bottom: 1px solid #f5f5f5;
}
.detail-row:last-child { border-bottom: none; }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}

.modal .description {
  font-size: .9rem;
  color: #444;
  line-height: 1.6;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 1.5rem;
  background: #1a2e1a;
  color: #777;
  font-size: .9rem;
}

/* ===== Nav Auth ===== */

.nav-username {
  color: #a5d6a7;
  font-weight: 600;
  font-size: .9rem;
}

.btn-nav {
  padding: .4rem 1rem;
  border: 1px solid #555;
  border-radius: 6px;
  background: transparent;
  color: #ccc;
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-nav:hover { background: #333; color: #fff; }

.hidden { display: none !important; }

/* ===== Auth Modal ===== */
.auth-modal {
  max-width: 380px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
}

.auth-tab {
  flex: 1;
  padding: .75rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.auth-tab.active {
  color: #1b5e20;
  border-bottom-color: #1b5e20;
}

#auth-form input,
#auth-form select {
  width: 100%;
  padding: .75rem 1rem;
  margin-bottom: .75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
  background: #fff;
  color: #333;
  -webkit-appearance: none;
  appearance: none;
}
#auth-form input:focus,
#auth-form select:focus { border-color: #1b5e20; }

#auth-form select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

#auth-form input[type="date"] {
  color: #333;
}
#auth-form input[type="date"]:invalid {
  color: #999;
}

.region-row {
  display: flex;
  gap: .5rem;
}
.region-row select {
  flex: 1;
  margin-bottom: .75rem;
}
.region-row select:disabled {
  background: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
}

.auth-error {
  color: #c62828;
  font-size: .85rem;
  margin-bottom: .75rem;
}

.btn-auth {
  width: 100%;
  padding: .75rem;
  border: none;
  border-radius: 8px;
  background: #1b5e20;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-auth:hover { background: #1a237e; }

/* ===== Like Button ===== */
.like-section {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-like .like-icon { font-size: 1.1rem; }
.btn-like:hover { border-color: #e53935; color: #e53935; }
.btn-like.liked {
  border-color: #e53935;
  background: #ffebee;
  color: #c62828;
}

.like-count {
  font-size: .85rem;
  color: #666;
}

/* ===== Reviews ===== */
.reviews-section {
  margin-top: 1.5rem;
}

.reviews-section h4 {
  font-size: .95rem;
  color: #1b5e20;
  margin-bottom: .75rem;
  border-bottom: 2px solid #e8f5e9;
  padding-bottom: .25rem;
}

.review-form {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}

.review-form textarea {
  flex: 1;
  padding: .6rem .8rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  resize: none;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  min-height: 60px;
}
.review-form textarea:focus { border-color: #1b5e20; }

.btn-review-submit {
  padding: .5rem 1rem;
  border: none;
  border-radius: 8px;
  background: #1b5e20;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
}
.btn-review-submit:hover { background: #1a237e; }

.login-prompt {
  color: #999;
  font-size: .85rem;
  padding: .75rem;
  background: #f5f5f5;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 1rem;
}

.login-prompt a {
  color: #1b5e20;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.review-list {
  max-height: 300px;
  overflow-y: auto;
}

.review-item {
  padding: .75rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: .5rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .35rem;
}

.review-user {
  font-weight: 600;
  font-size: .85rem;
  color: #1a2e1a;
}

.review-date {
  font-size: .75rem;
  color: #999;
}

.review-text {
  font-size: .9rem;
  color: #444;
  line-height: 1.5;
}

.review-delete {
  background: none;
  border: none;
  color: #999;
  font-size: .75rem;
  cursor: pointer;
  margin-left: .5rem;
}
.review-delete:hover { color: #c62828; }

.no-reviews {
  color: #999;
  font-size: .85rem;
  text-align: center;
  padding: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* Nav */
  nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: .6rem 1rem;
    gap: .4rem;
  }
  .logo { font-size: 1.1rem; }
  .nav-links {
    gap: .8rem;
    font-size: .85rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-auth-item { gap: .3rem; }
  .btn-nav { padding: .3rem .6rem; font-size: .8rem; }
  .nav-username { font-size: .8rem; }

  /* Hero */
  .hero { padding: 2.5rem 1.2rem 2rem; }
  .hero h1 { font-size: 1.6rem; margin-bottom: .5rem; }
  .hero p { font-size: .9rem; }
  .btn-hero-recommend {
    padding: .75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    max-width: 320px;
  }

  /* Section */
  .section { padding: 1.5rem 1rem; }
  .section h2 { font-size: 1.3rem; }
  .section-alt { padding: 1.5rem 1rem; }

  /* Filter */
  .filter-bar { flex-direction: column; gap: .6rem; }
  #search { flex: 1 1 100%; font-size: .95rem; }
  .filter-group { width: 100%; }
  .filter-group select { flex: 1; font-size: .85rem; padding: .5rem .6rem; }

  /* Card Grid */
  .string-grid { grid-template-columns: 1fr; gap: 1rem; }
  .string-card { padding: 1.2rem; }
  .card-header h3 { font-size: 1.05rem; }

  /* Compare */
  .compare-area { grid-template-columns: 1fr; }
  .compare-card { padding: 1rem; }

  /* Modal */
  .modal {
    width: 95%;
    max-height: 90vh;
    padding: 1.5rem;
    border-radius: 12px;
  }
  .modal h2 { font-size: 1.2rem; }
  .modal-close { top: .6rem; right: .6rem; }

  /* Auth Modal */
  .auth-modal { width: 95%; max-width: none; }
  .auth-tabs { margin-bottom: 1rem; }
  .auth-tab { padding: .6rem; font-size: .9rem; }
  #auth-form input,
  #auth-form select { padding: .65rem .8rem; font-size: .9rem; }
  .region-row { flex-direction: column; gap: 0; }
  .region-row select { margin-bottom: .75rem; }

  /* Quiz Modal */
  .quiz-modal { width: 95%; max-width: none; padding: 1.5rem; }
  .quiz-title { font-size: 1.1rem; margin-bottom: 1rem; }
  .quiz-question { font-size: 1rem; }
  .quiz-opt { padding: .75rem .9rem; font-size: .95rem; }
  .quiz-results { grid-template-columns: 1fr; }
  .quiz-result-card { padding: .8rem; }
  .quiz-result-card h3 { font-size: 1rem; }

  /* Footer */
  footer { padding: 1rem; font-size: .8rem; }

  /* Likes/Reviews section in modal */
  .review-item { padding: .6rem 0; }
  .review-input { font-size: .9rem; }

  /* Touch-friendly social buttons */
  .card-like-btn, .card-comment-btn {
    padding: .5rem .6rem;
    font-size: 1rem;
    min-height: 40px;
  }
  .card-like-btn .like-icon,
  .card-comment-btn .comment-icon { font-size: 1.3rem; }

  /* Card action buttons */
  .btn { padding: .5rem 1rem; font-size: .85rem; min-height: 38px; }

  /* Compare card detail */
  .compare-card .rating-bars { font-size: .75rem; }
}

/* ---- 스트링 추천 퀴즈 ---- */
.quiz-modal {
  max-width: 500px;
}
.quiz-title {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
  color: #1b5e20;
}
.quiz-progress {
  width: 100%;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.quiz-bar {
  height: 100%;
  background: linear-gradient(90deg, #1b5e20, #76c843);
  border-radius: 3px;
  width: 0;
  transition: width .3s ease;
}
.quiz-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: #333;
  text-align: center;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.quiz-opt {
  padding: .85rem 1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
}
.quiz-opt:hover {
  border-color: #1b5e20;
  background: #f0f4ff;
  transform: translateX(4px);
}
.quiz-back {
  margin-top: 1rem;
  padding: .5rem 1rem;
  border: none;
  background: none;
  color: #888;
  cursor: pointer;
  font-size: .9rem;
}
.quiz-back:hover { color: #333; }

.quiz-result-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1b5e20;
}
.quiz-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
  margin-bottom: 1rem;
}
.quiz-result-card {
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all .2s;
}
.quiz-result-card:first-child {
  border-color: #ffd700;
  background: #fffdf0;
}
.quiz-result-card:hover {
  border-color: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.quiz-rank {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .3rem;
  color: #76c843;
}
.quiz-retry {
  display: block;
  width: 100%;
  padding: .75rem;
  border: 2px solid #1b5e20;
  border-radius: 10px;
  background: #fff;
  color: #1b5e20;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.quiz-retry:hover {
  background: #1b5e20;
  color: #fff;
}
