/* Speaking & Writing — layout only (colors from global.css) */

.sw-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sw-topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.sw-main {
  flex: 1;
  display: flex;
  background: var(--bg);
  overflow: hidden;
}

.sw-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sw-card {
  background: white;
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}

.sw-task-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.sw-task-type {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.sw-task-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
}

.sw-instruction {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--accent-lt);
  border-radius: 12px;
  border-left: 4px solid var(--accent);
}

.sw-prompt-box {
  font-size: 18px;
  color: var(--navy);
  line-height: 1.6;
  margin-bottom: 32px;
}

.sw-timer-container {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.sw-timer-item {
  text-align: center;
  flex: 1;
  padding: 16px;
  background: #f1f5f9;
  border-radius: 16px;
}

.sw-timer-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  font-family: var(--font-m);
}

.sw-timer-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 700;
  margin-top: 4px;
}

.sw-audio-status {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
}

.sw-audio-progress {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

.sw-record-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 100px;
  background: #f1f5f9;
  font-weight: 700;
  font-size: 14px;
}

.sw-record-dot {
  width: 12px;
  height: 12px;
  background: #cbd5e1;
  border-radius: 50%;
}

.sw-record-dot.active {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.sw-response-area {
  width: 100%;
  margin-top: 24px;
}

.sw-textarea {
  width: 100%;
  height: 200px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 16px;
  resize: none;
  line-height: 1.6;
}

.sw-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

/* ── MOBILE RESPONSIVENESS ── */
@media (max-width: 768px) {
  .sw-topbar {
    padding: 0 16px;
    height: 56px;
  }
  
  .sw-content {
    padding: 20px 16px;
  }
  
  .sw-card {
    padding: 24px 16px;
    border-radius: 16px;
  }
  
  .sw-task-title {
    font-size: 20px;
  }
  
  .sw-timer-container {
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .sw-timer-item {
    padding: 12px;
  }
  
  .sw-timer-val {
    font-size: 20px;
  }
  
  .sw-record-indicator {
    padding: 14px 20px;
    font-size: 14px;
  }

  .sw-record-dot {
    width: 16px;
    height: 16px;
  }

  /* Touch-friendly buttons and interactive elements */
  .sw-container .btn-primary,
  .sw-container .btn-secondary,
  #sw-control-buttons button,
  #sw-next-btn {
    min-height: 44px;
    min-width: 44px;
  }

  /* Stack recording controls vertically */
  #sw-control-buttons {
    flex-direction: column !important;
    width: 100%;
  }

  #sw-control-buttons + .btn-primary,
  #sw-next-btn {
    width: 100%;
  }

  /* Readable timer values */
  .sw-timer-val {
    font-size: 22px;
  }

  .sw-timer-label {
    font-size: 12px;
  }

  #stt-feedback-area {
    padding: 16px !important;
    margin-top: 20px !important;
  }
  
  #stt-transcript-text {
    font-size: 16px !important;
  }
  
  .sw-textarea {
    height: 150px;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .sw-task-title {
    font-size: 18px;
  }
  
  .sw-instruction {
    font-size: 14px;
    padding: 12px;
  }
  
  .sw-prompt-box {
    font-size: 16px;
  }
  
  #sw-speaking-scores {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Bottom action bar stacking for small screens */
  .sw-card > div[style*="justify-content:space-between"] {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .sw-timer-container {
    flex-direction: column;
    gap: 8px;
  }
}
