/* ============================================
   PHISHING AWARENESS GAME - ENHANCED STYLES
   ============================================ */

/* Root Variables & Base Styles */
:root {
  /* Color Palette */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --danger-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --warning-color: #ffa502;

  /* Neutral Colors */
  --bg-primary: #0f0f1e;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #a8b2d1;
  --border-color: #2a2a4a;

  /* UI Colors */
  --success-color: #00d9a5;
  --danger-color: #ff5370;
  --info-color: #82aaff;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(0, 217, 165, 0.1) 0%, transparent 50%);
  z-index: -1;
  animation: backgroundShift 15s ease infinite;
}

@keyframes backgroundShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* App Container */
.App {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

.main-container {
  padding: 1.5rem;
  max-width: 100%;
  margin: 0 auto;
}

/* ============================================
   QUESTION PROGRESS INDICATORS
   ============================================ */
.question-boxes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.question-box {
  width: 32px;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.question-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left var(--transition-slow);
}

.question-box.current {
  background: var(--primary-gradient);
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.6);
}

.question-box.current::before {
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.question-box.correct {
  background: var(--success-gradient);
  box-shadow: 0 0 10px rgba(0, 217, 165, 0.4);
}

.question-box.incorrect {
  background: var(--danger-gradient);
  box-shadow: 0 0 10px rgba(255, 83, 112, 0.4);
}

/* ============================================
   PHONE CONTAINER
   ============================================ */
.phone-container {
  background: linear-gradient(145deg, #1e1e1e 0%, #0a0a0a 100%);
  border-radius: 45px;
  padding: 16px;
  margin: 30px auto;
  max-width: 380px;
  width: calc(100% - 40px);
  position: relative;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  transition: transform var(--transition-base);
}

.phone-container:hover {
  transform: translateY(-5px);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.phone-screen {
  background: #fff;
  border-radius: 35px;
  overflow: hidden;
  position: relative;
  min-height: 650px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.phone-notch {
  background: #000;
  height: 28px;
  width: 160px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.phone-notch::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.phone-time {
  position: absolute;
  top: 8px;
  left: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  z-index: 999;
  font-family: var(--font-primary);
}

.phone-icons {
  position: absolute;
  top: 8px;
  right: 24px;
  font-size: 13px;
  color: #000;
  z-index: 999;
  display: flex;
  gap: 4px;
  align-items: center;
}

.phone-content {
  margin-top: 35px;
  height: calc(100% - 35px);
  overflow: hidden;
}

/* ============================================
   EMAIL INTERFACE
   ============================================ */
.email-interface {
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.email-header {
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
  padding: 20px 18px;
  border-bottom: 1px solid #e0e0e0;
}

.email-subject {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #1a1a1a;
  line-height: 1.3;
}

.email-metadata {
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.email-details {
  flex: 1;
  min-width: 0;
}

.email-from {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 3px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.email-date {
  font-size: 12px;
  color: #666;
}

.email-toolbar {
  display: flex;
  justify-content: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.email-toolbar::-webkit-scrollbar {
  display: none;
}

.email-action-button {
  background: none;
  border: 1px solid #ddd;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.email-action-button:hover {
  background: #f0f0f0;
  border-color: #999;
  color: #333;
}

.email-body {
  padding: 20px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: #333;
  flex: 1;
  overflow-y: auto;
}

.email-body a {
  color: #1a73e8;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.email-body a:hover {
  border-bottom-color: #1a73e8;
}

/* ============================================
   WEBSITE INTERFACE
   ============================================ */
.website-interface {
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.browser-bar {
  background: linear-gradient(to bottom, #f5f5f5 0%, #ebebeb 100%);
  padding: 12px;
  border-bottom: 1px solid #d0d0d0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.browser-address {
  background: #fff;
  padding: 10px 14px;
  border-radius: 24px;
  font-size: 13px;
  color: #333;
  border: 1px solid #d0d0d0;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.lock-icon {
  margin-right: 8px;
  font-size: 14px;
  color: #34a853;
  flex-shrink: 0;
}

.url-bar {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.website-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}

.website-content input,
.website-content select,
.website-content textarea {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.website-content input:focus,
.website-content select:focus,
.website-content textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.website-content button {
  cursor: pointer;
  transition: all var(--transition-fast);
}

/* ============================================
   SMS INTERFACE
   ============================================ */
.sms-interface {
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sms-header {
  padding: 18px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
  color: #1a1a1a;
}

.sms-messages {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.sms-container {
  background: linear-gradient(135deg, #e3f9e5 0%, #d4f4dd 100%);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 12px 0;
  max-width: 85%;
  align-self: flex-end;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.sms-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -8px;
  width: 20px;
  height: 20px;
  background: inherit;
  border-bottom-left-radius: 16px;
  clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
}

.sms-message {
  color: #1a1a1a;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}

.sms-from {
  font-weight: 700;
  margin-bottom: 6px;
  color: #555;
  font-size: 13px;
}

.sms-time {
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  text-align: right;
}

.sms-message a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 102, 204, 0.3);
  transition: all var(--transition-fast);
}

.sms-message a:hover {
  border-bottom-color: #0066cc;
}

/* ============================================
   BUTTONS & ACTIONS
   ============================================ */
.btn {
  padding: 12px 24px;
  font-weight: 600;
  font-size: 15px;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-family: var(--font-primary);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.answer-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.answer-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.btn-phishing,
.btn-legitimate {
  flex: 1;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-radius: var(--radius-md);
  color: #fff;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-phishing {
  background: var(--danger-gradient);
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-phishing:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 25px rgba(245, 87, 108, 0.6);
}

.btn-legitimate {
  background: var(--success-gradient);
  box-shadow: 0 4px 15px rgba(0, 217, 165, 0.4);
}

.btn-legitimate:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 25px rgba(0, 217, 165, 0.6);
}

/* ============================================
   ALERTS & FEEDBACK
   ============================================ */
.alert {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 18px;
  font-size: 14px;
  line-height: 1.6;
  max-width: calc(100% - 36px);
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  border: 2px solid;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-md);
}

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

.alert p {
  margin: 8px 0;
  word-break: break-word;
}

.alert strong {
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.alert-success {
  background: linear-gradient(135deg, #d4f4dd 0%, #c3f0d3 100%);
  color: #0d5c2f;
  border-color: #28a745;
}

.alert-danger {
  background: linear-gradient(135deg, #ffe0e0 0%, #ffd0d0 100%);
  color: #721c24;
  border-color: #e31837;
}

/* ============================================
   FINAL SCORE
   ============================================ */
.final-score {
  text-align: center;
  padding: 40px 30px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin: 30px 20px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.final-score h2 {
  font-size: 28px;
  margin-bottom: 24px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 6px solid;
  border-image: var(--primary-gradient) 1;
  margin: 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow:
    0 0 0 8px var(--bg-card),
    0 0 30px rgba(102, 126, 234, 0.5);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow:
      0 0 0 8px var(--bg-card),
      0 0 30px rgba(102, 126, 234, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 8px var(--bg-card),
      0 0 40px rgba(102, 126, 234, 0.8);
  }
}

/* ============================================
   TEST CONTROLS (For Development)
   ============================================ */
.test-controls {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.test-info {
  margin-bottom: 18px;
}

.test-info h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--info-color);
  font-size: 18px;
}

.test-navigation {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: #fff;
  flex: 1;
  padding: 12px 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.btn-secondary:disabled {
  background: linear-gradient(135deg, #adb5bd 0%, #99a0a7 100%);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  margin-top: 50px;
  padding: 30px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.social-links a {
  color: var(--text-secondary);
  transition: all var(--transition-base);
  font-size: 20px;
  text-decoration: none;
}

.social-links a:hover {
  color: var(--info-color);
  transform: translateY(-3px);
}

/* ============================================
   GAME CONTAINER
   ============================================ */
.game-container {
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .main-container {
    padding: 1rem;
  }

  .phone-container {
    max-width: 100%;
    margin: 20px auto;
    border-radius: 35px;
    padding: 12px;
  }

  .phone-screen {
    min-height: 600px;
    border-radius: 28px;
  }

  .answer-buttons {
    flex-direction: column;
  }

  .btn-phishing,
  .btn-legitimate {
    width: 100%;
  }

  .question-boxes {
    padding: 15px;
    gap: 6px;
  }

  .question-box {
    width: 24px;
    height: 8px;
  }

  .final-score {
    margin: 20px 10px;
    padding: 30px 20px;
  }

  .score-circle {
    width: 120px;
    height: 120px;
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .phone-container {
    padding: 10px;
    border-radius: 30px;
  }

  .phone-screen {
    min-height: 550px;
    border-radius: 24px;
  }

  .email-subject {
    font-size: 17px;
  }

  .email-body {
    font-size: 14px;
  }

  .sms-message {
    font-size: 14px;
  }

  .btn-phishing,
  .btn-legitimate {
    font-size: 14px;
    padding: 14px 16px;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--info-color);
  outline-offset: 2px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(102, 126, 234, 0.5) rgba(0, 0, 0, 0.1);
}
