/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 50%, #f8faff 100%);
  color: #2c3e50;
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Screens Management */
.screen {
  display: block;
}

.screen.hidden {
  display: none;
}

/* Screen Header */
.screen-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 0;
  border-bottom: none;
}

.screen-header h2 {
  display: none;
}

.back-btn {
  background: none;
  border: none;
  color: #1e3a8a;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.back-btn:hover {
  background: #f1f5f9;
}

/* Mode Selection Screen */
.mode-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
}

.logo-section {
  text-align: center;
  margin-bottom: 20px;
}

.logo-section h1 {
  font-size: 72px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 8px;
  letter-spacing: -2px;
}

.logo-section .tagline {
  font-size: 18px;
  color: #64748b;
  font-weight: 500;
}

.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 600px;
}

.btn-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 24px;
  height: auto;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.btn-large:active {
  transform: scale(0.95);
}

.btn-icon {
  font-size: 48px;
  line-height: 1;
}

.btn-text {
  font-size: 16px;
  font-weight: 600;
}

.btn-desc {
  font-size: 13px;
  opacity: 0.8;
}

.import-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  padding-top: 20px;
  border-top: 1px solid rgba(30, 58, 138, 0.1);
}

.btn-import {
  width: 100%;
  padding: 14px 20px;
  background: #f1f5f9;
  color: #1e3a8a;
  border: 2px dashed #1e3a8a;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}

.btn-import:hover {
  background: #e0e7ff;
  border-color: #1e3a8a;
  transform: translateY(-2px);
}

.import-icon {
  font-size: 18px;
}

.import-status {
  font-size: 13px;
  min-height: 20px;
  text-align: center;
  transition: all 0.3s;
}

.import-status.success {
  color: #10b981;
  font-weight: 500;
}

.import-status.error {
  color: #ef4444;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #1e3a8a;
  color: white;
}

.btn-primary:hover {
  background: #1e3a8a;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
  background: #f1f5f9;
  color: #1e3a8a;
  border: 2px solid #1e3a8a;
}

.btn-secondary:hover {
  background: #1e3a8a;
  color: white;
  transform: translateY(-2px);
}

/* Add Words Screen */
.add-form {
  background: linear-gradient(135deg, #f0f4ff 0%, #f8faff 100%);
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 40px;
  border: 2px solid #e0e7ff;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.form-actions .btn {
  flex: 1;
}

.words-list {
  margin-top: 40px;
}

.words-list h3 {
  color: #1e3a8a;
  margin-bottom: 20px;
  font-size: 18px;
}

.words-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.word-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  position: relative;
}

.word-card-greek {
  font-weight: 600;
  font-size: 18px;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.word-card-russian {
  font-size: 14px;
  color: #64748b;
}

.delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  background: #fee;
  border: none;
  border-radius: 4px;
  color: #c00;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.delete-btn:hover {
  background: #fcc;
}

#editScreen .word-card {
  padding: 16px 16px 16px 16px;
}

#editScreen .delete-btn {
  display: flex;
}

/* Test Screen */
.test-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 3px;
}

#progress {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #1e3a8a;
}

.prompt {
  font-size: 44px;
  font-weight: 700;
  text-align: center;
  padding: 40px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8faff 100%);
  border-radius: 12px;
  color: #1e3a8a;
  border: 2px solid #e0e7ff;
  word-break: break-word;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  color: #2c3e50;
  transition: all 0.3s;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}

.card:hover:not(.right):not(.wrong) {
  border-color: #1e3a8a;
  box-shadow: 0 8px 16px rgba(30, 58, 138, 0.15);
  transform: translateY(-2px);
}

.card.right {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.card.wrong {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.2);
}

/* Result Screen */
.result-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.result-content {
  background: linear-gradient(135deg, #f0f4ff 0%, #f8faff 100%);
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  max-width: 500px;
}

.result-content h2 {
  font-size: 28px;
  color: #1e3a8a;
  margin-bottom: 30px;
}

.result-score {
  font-size: 60px;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 20px;
}

.result-message {
  font-size: 18px;
  color: #2c3e50;
  margin-bottom: 40px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-actions .btn {
  padding: 14px 28px;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 10px;
    min-height: auto;
  }

  .logo-section h1 {
    font-size: 56px;
  }

  .buttons-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .btn-large {
    padding: 24px 20px;
  }

  .header h1 {
    font-size: 24px;
  }

  .prompt {
    font-size: 32px;
    padding: 30px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .screen-header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    text-align: left;
  }

  .screen-header h2 {
    text-align: left;
  }

  .words-container {
    grid-template-columns: 1fr;
  }

  .result-content {
    padding: 40px 20px;
  }

  .result-score {
    font-size: 48px;
  }
}

.hidden {
  display: none;
}
