/* ===== RESET & GENERAL STYLES ===== */

/* Reset buttons */
button, input, select, textarea {
  -webkit-appearance: none; /* Removes default styles in Safari */
  -moz-appearance: none; /* Removes default styles in Firefox */
  appearance: none; /* Removes default styles in all modern browsers */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  background-color: #f9f9f9;
  color: #333;
  line-height: 1.6;
}

/* ===== CONTAINER LAYOUT ===== */
.site,
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== TITLE SECTION ===== */
.title {
  text-align: center;
  margin-bottom: 30px;
  background: #1a3755;
  padding: 30px 0;
  color: #ffffff;
}

.title h1 {
  font-size: 36px;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.title .subtitle {
  font-size: 18px;
  opacity: 0.8;
}

/* ===== TITLE BAR ===== */
.title-bar {
  background-color: #1a3755;
  color: white;
  padding: 25px 20px;
  text-align: center;
  margin-bottom: 20px;
  }
  .title-bar h1 {
  font-size: 28px;
  margin-bottom: 5px;
  }
  .title-bar p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 20px;
  }
  /* Title Bar Controls Container */
  .title-bar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  }
  /* Audio Controls */
  .audio-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  }
  .audio-button {
  background-color: #fff;
  color: #1a3755;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  }
  .audio-button {
  background-color: #f1f1f1;
  transform: translateY(-2px);
  }
  #stop-audio-button {
  color: #e74c3c;
  }
  #stop-audio-button {
  background-color: #ffeeee;
  }
  /* ===== LANGUAGE SELECTOR ===== */
  .language-buttons {
    padding-top: 20px;
    display: flex;
    gap: 5px;
    z-index: 100;
    justify-content: center;
  }
  /* Language buttons in title bar */
  .title .language-buttons .lang-btn {
  padding: 8px 15px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
  }
  .title .language-buttons .lang-btn {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  }
  .title .language-buttons .lang-btn.active {
  background-color: white;
  color: #1a3755;
  border-color: white;
  }

/* Mode Switch Styles */
 .mode-switch-container {
    display: flex;
    justify-content: center;
    margin: -10px auto 5px;
    padding: 0 20px;
  }
  
  .mode-switch {
    position: relative;
    background-color: #f1f1f1;
    border-radius: 30px;
    display: flex;
    width: 100%;
    max-width: 600px;
    height: 60px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
  
  .mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 15px;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s ease;
    font-weight: 600;
    color: #666;
    user-select: none;
  }
  
  .mode-option i {
    margin-right: 8px;
  }
  
  .mode-option.active {
    color: white;
  }
  
  .mode-slider {
    position: absolute;
    left: 33.33%; /* Start at assistive mode */
    width: 33.33%;
    height: 100%;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-radius: 30px;
    transition: left 0.4s ease;
    z-index: 0;
  }
  
  /* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .site, .main-container{
    padding: 10px;
  }

  .mode-switch-container {
    padding: 0 10px;
  }
  
  .mode-option {
    font-size: 16px;
    padding: 12px 8px;
  }
  
  .calculator-container {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .mode-option {
    font-size: 11px;
    padding: 10px 5px;
  }
  
  .mode-switch {
    height: 50px;
    gap: 5px;
  }
  
  button {
    padding: 7px;
    font-size: 14px;
  }
  
  .title h1 {
    font-size: 28px;
  }
}

/* Home Button Styles */
.home-button-container {
  display: flex;
  justify-content: center;
  margin: -20px auto 20px;
  padding: 0 20px;
}

.home-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.home-button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.home-button i {
  margin-right: 8px;
  font-size: 16px;
}

/* Video Tutorial Popup Styles */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tutorial-overlay.active {
  opacity: 1;
  visibility: visible;
}

.tutorial-container {
  position: relative;
  width: 80%;
  max-width: 900px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.tutorial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #3498db;
  color: white;
}

.tutorial-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.tutorial-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.tutorial-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.tutorial-content {
  padding: 0;
  overflow: hidden;
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.tutorial-content iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.tutorial-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tutorial-footer .checkbox-container {
  display: flex;
  align-items: center;
}

.tutorial-footer input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  opacity: 1;
  left: 0;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
  accent-color: #3498db;
}

.tutorial-footer label {
  color: #555;
  font-size: 14px;
}

.tutorial-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tutorial-button:hover {
  background-color: #2980b9;
}

.tutorial-button i {
  font-size: 16px;
}

/* Tutorial Button Styles */
.open-tutorial-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 999;
  transition: all 0.2s ease;
  animation: pulse 2s infinite;
}

.open-tutorial-btn:hover {
  background-color: #2980b9;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  animation: none;
}

.open-tutorial-btn i {
  font-size: 24px;
}

/* Tutorial Tooltip */
.tutorial-tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  white-space: nowrap;
  display: block;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tutorial-tooltip:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* 펄스 애니메이션 추가 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
  }
}

/* Assistive Mode Colors */
.assistive-mode .tutorial-header,
.assistive-mode .tutorial-button,
.assistive-mode .open-tutorial-btn {
  background-color: #3498db;
}

.assistive-mode .tutorial-button:hover,
.assistive-mode .open-tutorial-btn:hover {
  background-color: #2980b9;
}

/* Standard Mode Colors */
.standard-mode .tutorial-header,
.standard-mode .tutorial-button,
.standard-mode .open-tutorial-btn {
  background-color: #3498db;
}

.standard-mode .tutorial-button:hover,
.standard-mode .open-tutorial-btn:hover {
  background-color: #2980b9;
}

/* Advanced Mode Colors */
.advanced-mode .tutorial-header,
.advanced-mode .tutorial-button,
.advanced-mode .open-tutorial-btn {
  background-color: #3498db;
}

.advanced-mode .tutorial-button:hover,
.advanced-mode .open-tutorial-btn:hover {
  background-color: #2980b9;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .tutorial-container {
    width: 95%;
  }
  
  .open-tutorial-btn {
    width: 45px;
    height: 45px;
    bottom: 15px;
    left: 15px;
    padding: 0;
  }
  
  .open-tutorial-btn i {
    font-size: 20px;
  }
  
  .tutorial-tooltip {
    font-size: 10px;
    padding: 5px 5px;
    top: -30px;
  }
  
  .tutorial-header h3 {
    font-size: 16px;
  }
  
  .tutorial-footer {
    flex-direction: column;
    gap: 15px;
  }
  
  .tutorial-footer .checkbox-container {
    order: 2;
  }
  
  .tutorial-button {
    width: 100%;
    justify-content: center;
  }
}