/* 공통 스타일 포함 */
@import url("common.css");

/* PC 전용 스타일 */
body {
  background: #f8f9fa;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  border: 1px solid #e9ecef;
}

/* 스크린 리더 전용 텍스트 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

header {
  background: #343a40;
  color: white;
  text-align: center;
  padding: 30px 20px;
  margin: 0;
  border-radius: 8px 8px 0 0;
}

h1 {
  font-size: 2em;
  font-weight: 500;
  margin: 0 0 8px 0;
  color: white;
}

.subtitle {
  font-size: 1em;
  opacity: 0.9;
  margin: 0;
  font-weight: 400;
  color: white;
  line-height: 1.4;
}

.calculator-section {
  padding: 40px;
}

.calculator-form {
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: none;
}

legend {
  margin-bottom: 20px;
}

.required {
  color: #e74c3c;
  font-weight: bold;
}

.help-text {
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
  line-height: 1.4;
}

/* 계약 유형별 카드 스타일 */
.contract-types-container {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: stretch;
}

.contract-type-card {
  flex: 1;
  min-width: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.contract-type-card:hover {
  border-color: #adb5bd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.contract-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.contract-header .contract-icon {
  font-size: 1.5em;
  margin-right: 12px;
  opacity: 0.7;
}

.contract-header h3 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 500;
  color: #495057;
}

.contract-inputs {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.input-group {
  display: flex;
  flex-direction: column;
  min-height: 75px;
}

.input-group label {
  font-size: 0.9em;
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
  line-height: 1.3;
}

.after-months {
  font-size: 0.8em;
  color: #6c757d;
  font-weight: 400;
}

.maintenance-months {
  font-size: 0.8em;
  color: #6c757d;
  font-weight: 400;
}

.maintenance-months-price {
  font-size: 0.8em;
  color: #6c757d;
  font-weight: 400;
}

/* 저장 용량 라디오 박스 스타일 */
.storage-options {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.radio-option:hover {
  border-color: #667eea;
  background: #f0f2ff;
}

.radio-option input[type="radio"] {
  margin: 0;
  margin-right: 8px;
  width: 18px;
  height: 18px;
  accent-color: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-label {
  color: #667eea;
  font-weight: 600;
}

.radio-option:has(input[type="radio"]:checked) {
  border-color: #667eea;
  background: #e8f2ff;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.radio-label {
  font-size: 1rem;
  color: #495057;
  transition: all 0.3s ease;
}

/* 가격 정보 버튼 */
.price-info-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

.price-info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.price-info-btn:active {
  transform: translateY(0);
}

/* 가격 정보 팝업 */
.price-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.price-popup {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.price-popup-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-popup-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.price-popup-header .unit-text {
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.8;
}

.price-popup-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.price-popup-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.price-popup-content {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.price-table th,
.price-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.price-table th {
  background: #f8f9fa;
  font-weight: 700;
  color: #495057;
  position: sticky;
  top: 0;
  z-index: 10;
}

.price-table tbody tr:hover {
  background: #f8f9fa;
}

.price-table td:first-child {
  font-weight: 600;
  color: #2c3e50;
}

.price-table td:not(:first-child) {
  text-align: center;
  font-weight: 600;
  color: #667eea;
}

.input-group input,
.input-group select {
  padding: 12px 15px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
  height: 48px;
  box-sizing: border-box;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #6c757d;
  box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.25);
}

/* 콤보박스 옵션 스타일 개선 */
.input-group select option {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: normal;
  word-wrap: break-word;
}

/* 콤보박스 optgroup 스타일 */
.input-group select optgroup {
  font-weight: bold;
  font-size: 13px;
  color: #495057;
  padding: 5px 8px;
  background-color: #f8f9fa;
}

.empty-field {
  width: 100%;
  height: 42px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 12px;
  margin-top: 5px;
}

/* 빈 input-group 스타일 */
.input-group:empty {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 카드 구분을 위한 미묘한 스타일 */
.contract-type-card:nth-child(1) {
  border-left: 3px solid #6c757d;
}

.contract-type-card:nth-child(2) {
  border-left: 3px solid #6c757d;
}

.contract-type-card:nth-child(3) {
  border-left: 3px solid #6c757d;
}

/* 비교 결과 테이블 스타일 - 심플하고 깔끔하게 */
.comparison-table {
  width: 100%;
  margin: 25px 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e1e8ed;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th {
  background: #f8f9fa;
  color: #495057;
  padding: 15px 12px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 2px solid #e9ecef;
}

.comparison-table td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid #f1f3f4;
  vertical-align: middle;
  color: #495057;
  font-size: 1rem;
  font-weight: 500;
}

/* 계산 안내 텍스트 스타일 */
.comparison-table .calculation-note {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 400;
  margin-left: 8px;
}

.comparison-table tr:nth-child(even) {
  background: #fafbfc;
}

.comparison-table tr:hover {
  background: #f8f9fa;
}

.comparison-table tr:last-child td {
  border-bottom: none;
  font-weight: 600;
  background-color: #f8f9fa;
  color: #2c3e50;
}

.comparison-table .highlight-best {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  font-weight: 700;
  font-size: 1.15rem;
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  position: relative;
  animation: pulse-best 2s infinite;
}

@keyframes pulse-best {
  0% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1);
  }
}

.comparison-table .highlight-best::before {
  content: "🏆";
  position: absolute;
  left: 30%;
  top: 16px;
  transform: translateX(-50%);
  font-size: 1.2em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 10;
}

/* 결과 섹션 - 심플하고 깔끔하게 */
#results {
  margin-top: 30px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

#results h2 {
  color: #2c3e50;
  font-weight: 500;
  font-size: 1.4em;
  margin-bottom: 25px;
  text-align: center;
  text-shadow: none;
}

.comparison-table .highlight-good {
  background: #6c757d;
  color: white;
  font-weight: 500;
}

.comparison-table .highlight-normal {
  background: #adb5bd;
  color: white;
  font-weight: 500;
}

.comparison-table .contract-type-header {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 20px 15px;
}

.comparison-table .price-cell {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 20px 15px;
}

.comparison-table .savings-cell {
  font-size: 1.05rem;
  font-weight: 600;
  color: #4caf50;
}

.comparison-summary {
  background: #ffffff;
  color: #2c3e50;
  padding: 25px;
  border-radius: 12px;
  margin: 20px 0;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e1e8ed;
}

.comparison-summary h3 {
  margin-bottom: 20px;
  font-size: 1.3em;
  color: #2c3e50;
  font-weight: 500;
}

.comparison-summary .best-option {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.comparison-summary .savings-info {
  font-size: 1em;
  color: #495057;
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 6px;
  display: inline-block;
  border: 1px solid #e9ecef;
}

.form-group {
  margin-bottom: 25px;
}

.form-row {
  display: flex;
  gap: 25px;
  margin-bottom: 25px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 1.1em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4facfe;
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.calculate-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 172, 254, 0.3);
}

.calculate-btn:active {
  transform: translateY(0);
}

.calculate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.calculate-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn-loading {
  display: none;
}

.calculate-btn:disabled .btn-text {
  display: none;
}

.calculate-btn:disabled .btn-loading {
  display: inline;
}

.result-container {
  background: #f8f9fa;
  padding: 30px;
  border-top: 1px solid #e1e5e9;
}

.result-container h2 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.calculation-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.calculation-table th {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: 600;
}

.calculation-table td {
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid #e1e5e9;
}

.calculation-table tr:last-child td {
  border-bottom: none;
}

.calculation-table .highlight-blue {
  background-color: #e3f2fd;
  font-weight: 600;
  color: #1976d2;
}

.calculation-table .highlight-yellow {
  background-color: #fff3e0;
  font-weight: 700;
  color: #f57c00;
}

.total-section {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  text-align: center;
}

.total-section h3 {
  color: #d84315;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.total-amount {
  font-size: 2em;
  font-weight: 700;
  color: #d84315;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: #4caf50;
}

.toast.error {
  background: #f44336;
}

/* 푸터 스타일 */
footer {
  background: #ffffff !important;
  color: #6c757d !important;
  padding: 30px 0 20px 0;
  margin-top: 40px;
  position: relative;
  border-top: 1px solid #e9ecef;
  color-scheme: light !important;
}

/* 어두운 테마에서도 밝은 테마 강제 적용 */
@media (prefers-color-scheme: dark) {
  footer {
    background: #ffffff !important;
    color: #6c757d !important;
  }

  .footer-content h3 {
    color: #495057 !important;
  }

  .footer-content p {
    color: #6c757d !important;
  }

  .footer-links a {
    color: #6c757d !important;
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
  }

  .footer-links a:hover {
    color: #495057 !important;
    background: #e9ecef !important;
    border-color: #adb5bd !important;
  }

  .copyright {
    color: #6c757d !important;
  }
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #dee2e6, transparent);
}

.footer-content {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 10px 0 5px 0;
}

.footer-content h3 {
  margin-bottom: 16px;
  color: #495057 !important;
  font-size: 1.3em;
  font-weight: 600;
}

.footer-content p {
  margin-bottom: 16px;
  opacity: 0.8;
  line-height: 1.6;
  color: #6c757d !important;
  font-size: 0.95em;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.footer-links {
  margin-bottom: 20px;
}

.footer-links a {
  color: #6c757d !important;
  text-decoration: none;
  margin: 0 15px;
  padding: 8px 16px;
  border-radius: 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9em;
}

.footer-links a:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  color: #495057 !important;
}

.copyright {
  font-size: 0.8em;
  opacity: 0.7;
  margin: 0;
  color: #6c757d !important;
  border-top: 1px solid #e9ecef;
  padding-top: 16px;
  margin-top: 16px;
}

/* 좋아요 및 공유 버튼 스타일 */
.result-actions {
  margin-top: 30px;
  padding: 20px 0;
  border-top: 2px solid #e9ecef;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  background: #ffffff;
  color: #6c757d;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 120px;
  justify-content: center;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-color: #adb5bd;
  color: #495057;
}

.action-btn.like-btn {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.action-btn.like-btn:hover {
  background: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
}

.action-btn.like-btn.liked {
  background: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
}

.action-btn.like-btn.liked:hover {
  background: #ff5252;
  border-color: #ff5252;
}

.action-btn.share-btn {
  border-color: #4ecdc4;
  color: #4ecdc4;
}

.action-btn.share-btn:hover {
  background: #4ecdc4;
  color: white;
  border-color: #4ecdc4;
}

.action-btn.copy-btn {
  border-color: #45b7d1;
  color: #45b7d1;
}

.action-btn.copy-btn:hover {
  background: #45b7d1;
  color: white;
  border-color: #45b7d1;
}

.btn-icon {
  font-size: 1.2em;
}

.btn-text {
  font-weight: 600;
}

.btn-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.action-btn.liked .btn-count {
  background: rgba(255, 255, 255, 0.2);
}

/* 대형 화면 (1400px 이상) */
@media (min-width: 1400px) {
  .container {
    max-width: 1600px;
    margin: 20px auto;
  }

  .calculator-section {
    padding: 50px 60px;
  }

  .contract-types-container {
    gap: 25px;
  }

  .contract-type-card {
    padding: 25px;
  }

  /* PC에서 highlight-best 폰트 컬러 흰색 강제 적용 */
  .comparison-table .highlight-best {
    color: white !important;
  }

  .contract-header h3 {
    font-size: 1.3em;
  }

  .input-group input,
  .input-group select {
    padding: 12px 15px;
    font-size: 16px;
  }

  .input-group label {
    font-size: 1em;
    margin-bottom: 10px;
    line-height: 1.3;
  }

  .form-row {
    gap: 30px;
  }

  .form-group select {
    padding: 12px 15px;
    font-size: 16px;
  }
}

/* PC 화면 (1024px 이상) - highlight-best 폰트 컬러 흰색 적용 */
@media (min-width: 1024px) {
  .comparison-table .highlight-best {
    color: white !important;
  }
}

/* 태블릿 가로 화면 (1200px 이하) */
@media (max-width: 1200px) {
  .container {
    margin: 15px;
    max-width: 95%;
  }

  .contract-types-container {
    gap: 15px;
    flex-wrap: nowrap;
  }

  .contract-type-card {
    min-width: 0;
    padding: 15px;
  }
}

@media (max-width: 1024px) {
  .container {
    margin: 10px;
    max-width: 98%;
  }

  .contract-types-container {
    gap: 12px;
    flex-wrap: nowrap;
  }

  .contract-type-card {
    min-width: 0;
    padding: 12px;
  }

  .contract-header h3 {
    font-size: 1em;
  }

  .input-group input {
    padding: 8px 10px;
    font-size: 12px;
  }

  .input-group label {
    font-size: 0.85em;
    margin-bottom: 6px;
    line-height: 1.3;
  }

  .comparison-table {
    font-size: 12px;
    overflow-x: auto;
  }
}

/* 태블릿 세로 화면 (768px 이하) */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    margin: 0;
    border-radius: 10px;
    max-width: 100%;
  }

  header {
    padding: 20px 15px;
    border-radius: 10px 10px 0 0;
  }

  h1 {
    font-size: 1.8em;
    margin: 0 0 6px 0;
  }

  .subtitle {
    font-size: 0.9em;
  }

  .calculator-section {
    padding: 20px 15px;
  }

  .contract-types-container {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .contract-type-card {
    min-width: 0;
    padding: 12px;
  }

  .contract-header {
    flex-direction: row;
    text-align: left;
    gap: 8px;
    margin-bottom: 12px;
  }

  .contract-header .contract-icon {
    margin-right: 8px;
    margin-bottom: 0;
    font-size: 1.2em;
  }

  .contract-header h3 {
    font-size: 1em;
  }

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

  .input-group label {
    font-size: 0.8em;
    margin-bottom: 3px;
  }

  .input-group input {
    padding: 8px 10px;
    font-size: 12px;
  }

  .calculate-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
  }

  .calculation-table {
    font-size: 11px;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }

  .calculation-table th,
  .calculation-table td {
    padding: 6px 8px;
    white-space: nowrap;
  }

  .comparison-table {
    font-size: 10px;
    overflow-x: auto;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 6px 4px;
    white-space: nowrap;
  }

  .comparison-summary {
    padding: 15px;
  }

  .comparison-summary h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
  }

  .best-option,
  .savings-info {
    font-size: 0.9em;
    margin-bottom: 8px;
  }
}

/* 모바일 가로 화면 (480px 이하) */
@media (max-width: 480px) {
  body {
    padding: 5px;
  }

  .container {
    margin: 0;
    border-radius: 8px;
  }

  header {
    padding: 15px 10px;
    border-radius: 8px 8px 0 0;
  }

  h1 {
    font-size: 1.5em;
    margin: 0 0 5px 0;
  }

  .subtitle {
    font-size: 0.8em;
    line-height: 1.3;
  }

  .calculator-section {
    padding: 15px 10px;
  }

  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .contract-types-container {
    flex-direction: column;
    gap: 10px;
  }

  .contract-type-card {
    padding: 12px;
    min-width: auto;
  }

  .contract-header {
    margin-bottom: 12px;
    flex-direction: column;
    text-align: center;
    gap: 5px;
  }

  .contract-header .contract-icon {
    margin-right: 0;
    margin-bottom: 5px;
    font-size: 1.5em;
  }

  .contract-header h3 {
    font-size: 1.1em;
  }

  .input-group input {
    padding: 8px 10px;
    font-size: 13px;
  }

  .calculate-btn {
    padding: 12px;
    font-size: 15px;
  }

  .comparison-table {
    font-size: 9px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 4px 2px;
  }

  .comparison-summary h3 {
    font-size: 1em;
  }

  .best-option,
  .savings-info {
    font-size: 0.8em;
  }
}

/* 공지 박스 스타일 */
.notice-box {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 10px;
  margin: 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.notice-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-content strong {
  color: #856404;
  font-size: 16px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.notice-content p {
  color: #6c5a00;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.price-notice {
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #1565c0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 댓글 시스템 스타일 */
.comments-section {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.comments-section h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 18px;
  font-weight: 600;
}

.comment-form {
  margin-bottom: 25px;
}

.comment-input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-input-group input,
.comment-input-group textarea {
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.comment-input-group input:focus,
.comment-input-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.comment-input-group input {
  max-width: 300px;
}

.comment-input-group textarea {
  min-height: 80px;
  resize: vertical;
}

.comment-submit-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  align-self: flex-start;
}

.comment-submit-btn:hover {
  background: #0056b3;
}

.comments-list {
  border-top: 1px solid #e9ecef;
  padding-top: 20px;
}

.comment-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  position: relative;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-nickname {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.comment-date {
  color: #6c757d;
  font-size: 12px;
}

.delete-comment-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
  transition: background-color 0.2s ease;
}

.delete-comment-btn:hover {
  background: #c82333;
}

.comment-content {
  color: #495057;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
}

.no-comments {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
}

/* 더보기 버튼 스타일 */
.btn-load-more {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-load-more:active {
  transform: translateY(0);
}

/* Footer 공유 버튼 스타일 */
.footer-share-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 15px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.footer-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.footer-share-btn .btn-icon {
  font-size: 16px;
}

.footer-share-btn .btn-text {
  font-size: 14px;
}

/* 완납가 입력 필드와 토글 버튼 스타일 */
.input-with-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-toggle input {
  flex: 1;
}

.sign-toggle-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 40px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.sign-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.sign-toggle-btn:active {
  transform: translateY(0);
}

/* 코멘트 섹션 스타일 */
.comments-container {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

/* 별점 평가 섹션 스타일 */
.rating-section {
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.rating-stars {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rating-label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.stars {
  display: flex;
  gap: 5px;
}

.stars input[type="radio"] {
  display: none;
}

.stars label.star {
  font-size: 24px;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
}

.stars label.star:hover,
.stars label.star:hover ~ label.star,
.stars input[type="radio"]:checked ~ label.star {
  color: #ffc107;
}

.stars input[type="radio"]:checked + label.star {
  color: #ffc107;
}

.rating-text {
  font-size: 12px;
  color: #666;
  margin-left: 10px;
}

.comments-container h2 {
  color: #343a40;
  margin-bottom: 20px;
  font-size: 1.5em;
  font-weight: 600;
}

.comments-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 20px;
}

.comment-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.comment-input-wrapper textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

.comment-input-wrapper textarea:focus {
  border-color: #667eea;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.comment-submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 60px;
}

.comment-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.comment-submit-btn:active {
  transform: translateY(0);
}

.comment-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.comments-list {
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

.comment-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f1f3f4;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-nickname {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.comment-date {
  color: #6c757d;
  font-size: 12px;
}

.comment-content {
  color: #212529;
  line-height: 1.5;
  font-size: 14px;
}

.no-comments {
  padding: 40px 20px;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* 쿠팡 광고 영역 스타일 (PC) */
.coupang-ad-container {
  margin: 40px auto;
  padding: 25px;
  max-width: 800px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.coupang-ad-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
}

.coupang-ad-container .ad-header {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.coupang-ad-container .ad-header h3 {
  color: white;
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.coupang-ad-container .ad-header small {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  backdrop-filter: blur(10px);
}

.coupang-ad-container .ad-content {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.coupang-ad-container .ad-content iframe {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.coupang-ad-container .ad-content iframe:hover {
  transform: translateY(-2px);
}

.coupang-ad-container .ad-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
}

/* 쿠팡 광고 스크립트가 생성하는 모든 요소의 위치 강제 제어 */
.coupang-ad-container * {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: auto !important;
}

/* iframe 요소 특별 처리 */
.coupang-ad-container iframe {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: auto !important;
  display: block !important;
  margin: 0 auto !important;
}

/* div 요소 특별 처리 */
.coupang-ad-container div {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: auto !important;
}

.coupang-ad-container .ad-disclaimer {
  text-align: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}

.coupang-ad-container .ad-disclaimer small {
  color: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  line-height: 1.5;
  font-weight: 400;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .coupang-ad-container {
    margin: 20px 10px;
    padding: 20px;
    max-width: none;
  }

  .coupang-ad-container .ad-header h3 {
    font-size: 18px;
  }

  .coupang-ad-container .ad-content {
    padding: 15px;
  }

  .coupang-ad-container .ad-disclaimer small {
    font-size: 9px;
    padding: 6px 12px;
  }
}
