/* ===========================================
   SCRIPT TIMER CALCULATOR - STYLES
   Matching SpeakWorth visual design
   =========================================== */

/* ----- Brand Colors ----- */
:root {
  /* Primary Accent Colors */
  --color-pink: #D32A6A;
  --color-purple: #a855f7;
  --color-purple-dark: #7c3aed;
  
  /* Status Colors */
  --color-green: #10B981;
  --color-yellow: #F59E0B;
  --color-red: #EF4444;
  --color-blue: #3B82F6;
  --color-gray: #6B7280;
  
  /* Background */
  --bg-dark: #0c0c14;
  --bg-card: rgba(255, 255, 255, 0.03);
  
  /* Text Colors */
  --text-white: #ffffff;
  --text-light: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-faint: rgba(255, 255, 255, 0.4);
  
  /* Card Colors */
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-hover-border: rgba(168, 85, 247, 0.4);
}

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

/* ----- Typography ----- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-white);
  background: #151511;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Purple/Pink glow effect in corner */
body::before {
  content: '';
  position: fixed;
  bottom: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, rgba(192, 132, 252, 0.15) 30%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ----- Layout ----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
}

/* ----- Animations ----- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Header ----- */
.header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeIn 0.5s ease-out;
}

.header-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.header h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-white);
}

.header h1 .highlight {
  color: #D32A6A
}

.header p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
}

.hint-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 16px;
  background: transparent;
  font-size: 13px;
  color: var(--text-muted);
}

.hint-badge span:first-child {
  color: #facc15;
}

/* ----- Cards ----- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease-out;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--card-hover-border);
  background: rgba(255, 255, 255, 0.03);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  margin-top: -10px;
}

.year-badge {
  background: #D32A6A
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 8px;
}

/* Gradient Border Card */
.gradient-card {
  background: linear-gradient(135deg, var(--color-purple-dark) 0%, var(--color-pink) 100%);
  padding: 2px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.gradient-card-inner {
  background: var(--bg-dark);
  border-radius: 14px;
  padding: 24px;
}

/* ----- Textarea ----- */
.textarea-wrapper {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 160px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-white);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: #D32A6A
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

textarea::placeholder {
  color: var(--text-faint);
}

/* ----- Buttons ----- */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: inherit;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #D32A6A
  color: var(--text-light);
}

.btn-secondary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-primary {
  background: #D32A6A
  color: var(--text-white);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 50px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.35);
}

/* ----- Preset Buttons ----- */
.preset-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.preset-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-family: inherit;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(168, 85, 247, 0.3);
}

.preset-btn.active {
  background: #D32A6A
  border-color: transparent;
  color: var(--text-white);
}

.preset-emoji {
  font-size: 20px;
  margin-bottom: 4px;
}

.preset-label {
  font-weight: 600;
  font-size: 12px;
}

.preset-wpm {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

/* ----- Slider ----- */
.slider-container {
  padding: 8px 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

.slider-header span:first-child,
.slider-header span:last-child {
  color: var(--text-faint);
}

.slider-value {
  font-size: 15px;
  font-weight: 700;
  color: #D32A6A
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #D32A6A
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #D32A6A
  cursor: pointer;
  border: none;
}

/* ----- Results Display ----- */
.results-title {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.time-display {
  text-align: center;
  margin-bottom: 24px;
}

.time-number {
  font-size: clamp(40px, 10vw, 52px);
  font-weight: 800;
  color: #D32A6A
  line-height: 1;
}

.time-text {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-value.pink { color: #D32A6A}
.stat-value.purple { color: #D32A6A }

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ----- Platform Cards ----- */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.platform-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 12px;
  transition: all 0.3s ease;
  text-align: center;
}

.platform-card:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.platform-card.perfect {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.platform-card.overlimit {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}

.platform-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.platform-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-light);
}

.platform-limit {
  font-size: 9px;
  color: var(--text-faint);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.platform-recommended {
  font-size: 10px;
  color: var(--color-green);
  font-weight: 600;
  margin-bottom: 8px;
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-block;
}

.platform-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.platform-detail {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.3;
}

.status-green { color: var(--color-green); }
.status-yellow { color: var(--color-yellow); }
.status-red { color: var(--color-red); }
.status-gray { color: var(--color-gray); }

/* ----- Badges ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-yellow); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--color-red); }

/* ----- Suggestions ----- */
.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suggestion-card {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  padding: 14px;
  border-left: 3px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.suggestion-card.success { 
  border-color: var(--color-green); 
  background: rgba(16, 185, 129, 0.06); 
}
.suggestion-card.warning { 
  border-color: var(--color-yellow); 
  background: rgba(245, 158, 11, 0.06); 
}
.suggestion-card.info { 
  border-color: var(--color-blue); 
  background: rgba(59, 130, 246, 0.06); 
}
.suggestion-card.tip { 
  border-color: #D32A6A 
  background: rgba(168, 85, 247, 0.08); 
}

.suggestion-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.suggestion-text {
  flex: 1;
  line-height: 1.5;
  font-size: 13px;
  color: var(--text-light);
}

.suggestion-text strong {
  color: var(--text-white);
}

.suggestion-platform {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* ----- Content Breakdown ----- */
.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.breakdown-item {
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px solid var(--card-border);
}

.breakdown-value {
  font-size: 24px;
  font-weight: 700;
}

.breakdown-value.pink { color: #D32A6A}
.breakdown-value.purple { color: #D32A6A }

.breakdown-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.readability-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.readability-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-gray);
}

#readabilityLevel {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-gray);
}

.readability-note {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ----- History ----- */
.history-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-faint);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.history-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.history-empty-hint {
  font-size: 11px;
  margin-top: 6px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--card-hover-border);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.history-preview {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
  margin-right: 10px;
  color: var(--text-light);
}

.history-wpm {
  font-size: 10px;
  color: var(--text-faint);
}

.history-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.clear-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: color 0.3s ease;
}

.clear-link:hover {
  color: #D32A6A
}

/* ----- Tips Card ----- */
.tips-card {
  background: rgba(168, 85, 247, 0.05);
  border-color: rgba(168, 85, 247, 0.15);
}

.tips-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
}

.tips-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.9;
}

.tips-card li strong {
  color: #D32A6A
}

/* ----- Footer ----- */
.footer {
  text-align: center;
  margin-top: 60px;
  padding: 30px 20px;
}

.footer p {
  color: var(--text-muted);
  font-size: 13px;
}

.footer .copyright {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 8px;
}

.footer a {
  color: #D32A6A
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #D32A6A
}

/* ----- Toast Notification ----- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #D32A6A
  color: var(--text-white);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.3);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ----- Mobile Responsive ----- */
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  
  .right-column {
    order: -1;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 15px;
  }
  
  .preset-row {
    flex-direction: column;
  }
  
  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .btn-row {
    flex-direction: column;
  }
  
  .btn {
    justify-content: center;
  }
  
  .card {
    padding: 18px;
  }
  
  .header h1 {
    font-size: 26px;
  }
  
  .time-number {
    font-size: 38px;
  }
}
