:root {
  --primary: #8a77eb;
  --secondary: #ed3b49;
  --text: #070616;
  --bg-light: #f8f9fa;
  --bg-dark: #ffffff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  background-color: var(--bg-dark);
  color: var(--text);
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-size: 2.8em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary);
  text-shadow: 2px 2px 4px rgba(138, 119, 235, 0.1);
  letter-spacing: -0.5px;
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.tab-btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: rgba(138, 119, 235, 0.1);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.detector-box, .comparison-box, .history-box {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(138, 119, 235, 0.1);
  transition: transform 0.3s ease;
}

.detector-box:hover {
  transform: translateY(-2px);
}

.text-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
  opacity: 0.7;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  padding: 1.2rem;
  border: 2px solid rgba(138, 119, 235, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
  color: var(--text);
  min-height: 150px;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 119, 235, 0.1);
}

button {
  background-color: var(--primary);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:not(:disabled):hover {
  background-color: #7665d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(138, 119, 235, 0.2);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

button:active {
  transform: translateY(0);
}

.result-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  border: 2px solid rgba(138, 119, 235, 0.1);
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.score-box {
  margin: 1.5rem 0;
}

.score-box p {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.score-box strong {
  color: var(--primary);
  font-size: 1.4rem;
}

.probability-bar {
  height: 24px;
  background: rgba(138, 119, 235, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
}

.probability-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-interpretation {
  background: rgba(138, 119, 235, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.score-interpretation p:first-child {
  font-weight: 600;
  color: var(--primary);
  margin-top: 0;
}

.score-interpretation p:last-child {
  margin-bottom: 0;
  color: var(--text);
  opacity: 0.8;
}

.score-interpretation.high {
  background: rgba(237, 59, 73, 0.05);
}

.score-interpretation.high p:first-child {
  color: var(--secondary);
}

.score-interpretation.medium {
  background: rgba(138, 119, 235, 0.05);
}

.score-interpretation.low,
.score-interpretation.very-low {
  background: rgba(138, 119, 235, 0.05);
}

.indicators {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.indicators li {
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: rgba(138, 119, 235, 0.05);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.indicators li:before {
  content: "•";
  color: var(--primary);
  font-size: 1.5em;
  margin-right: 0.5rem;
}

.indicators li:hover {
  background: rgba(138, 119, 235, 0.1);
  transform: translateX(5px);
}

.warning {
  color: var(--secondary);
  text-align: center;
  margin: 0;
  font-weight: 500;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.detailed-stats {
  background: rgba(138, 119, 235, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.detailed-stats h4 {
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 1rem;
}

.detailed-stats ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detailed-stats li {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.comparison-box {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comparison-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.text-column {
  flex: 1;
}

.similarity-score {
  text-align: center;
  padding: 1.5rem;
  background: rgba(138, 119, 235, 0.05);
  border-radius: 12px;
}

.history-entry {
  background: rgba(138, 119, 235, 0.05);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.history-date {
  color: var(--text);
  opacity: 0.7;
}

.history-score {
  color: var(--primary);
  font-weight: 600;
}

.history-text {
  margin: 1rem 0;
  color: var(--text);
}

.indicator-tag {
  display: inline-block;
  background: rgba(138, 119, 235, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin: 0.2rem;
  color: var(--primary);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .comparison-results {
    grid-template-columns: 1fr;
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tab-btn {
    width: 100%;
  }
  
  h1 {
    font-size: 2.2em;
  }
}