/* Advanced Modal Styles */

/* Enhanced Modal */
.modal {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  visibility: hidden;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.modal-content {
  background: var(--glass-background);
  margin: 5% auto;
  padding: 3rem;
  width: 90%;
  max-width: 900px;
  border-radius: 20px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.modal.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2rem;
  color: var(--gray-color);
  cursor: pointer;
  transition: all 0.3s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.close-modal:hover {
  color: var(--light-color);
  background: rgba(255, 26, 140, 0.2);
  transform: rotate(90deg);
}

.term-details h2 {
  color: var(--primary-color);
  font-size: 3rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
  position: relative;
}

.term-description {
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.usage-scenarios,
.dialogue-examples {
  margin-bottom: 3rem;
}

.usage-scenarios h3,
.dialogue-examples h3 {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  position: relative;
  display: inline-block;
}

.usage-scenarios h3::after,
.dialogue-examples h3::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 4px;
  background: var(--secondary-color);
  bottom: -10px;
  left: 0;
  border-radius: 2px;
  opacity: 0.5;
}

.usage-list,
.dialogue-list {
  list-style: none;
}

/* Enhanced usage scenarios */
.usage-list li {
  margin-bottom: 1.5rem;
  background: rgba(30, 30, 30, 0.5);
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.usage-list li::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--secondary-gradient);
}

.usage-list li:hover {
  transform: translateX(5px);
  background: rgba(30, 30, 30, 0.8);
}

.scenario-context {
  font-weight: 500;
  color: var(--accent-color);
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.scenario-example {
  color: var(--light-color);
  font-style: italic;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.7;
}

.scenario-example::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -5px;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Enhanced dialogue examples */
.dialogue-item {
  background: rgba(30, 30, 30, 0.5);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.dialogue-item::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
}

.dialogue-item:hover {
  transform: translateX(-5px);
  background: rgba(30, 30, 30, 0.8);
}

.dialogue-text {
  white-space: pre-line;
  font-family: monospace;
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Enhanced dialogue speaker and content */
.dialogue-line {
  margin-bottom: 1.2rem;
  display: flex;
  flex-wrap: wrap;
}

.dialogue-speaker {
  font-weight: bold;
  color: var(--secondary-color);
  min-width: 120px;
  margin-right: 15px;
  position: relative;
}

.dialogue-content {
  flex: 1;
  color: var(--light-color);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .modal-content {
    margin: 10% auto;
    padding: 2rem;
  }

  .term-details h2 {
    font-size: 2.2rem;
  }

  .term-description {
    font-size: 1.1rem;
  }

  .dialogue-line {
    flex-direction: column;
  }

  .dialogue-speaker {
    margin-bottom: 0.5rem;
  }
}
