/* Community Voices - SANAC Civil Society Forum Styles */

:root {
  --primary-red: #ef4444;
  --primary-red-dark: #dc2626;
  --primary-red-light: #fef2f2;
  --secondary-blue: #3b82f6;
  --success-green: #10b981;
  --warning-yellow: #f59e0b;
  --error-red: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --background: #ffffff;
  --background-light: #f9fafb;
  --background-dark: #f3f4f6;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
  overflow-x: hidden;
}

/* Screen Management */
.screen {
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.screen.hidden {
  display: none;
}

/* Loading Screen */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  color: white;
}

.loading-content {
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}

.logo-container {
  margin-bottom: 2rem;
}

.logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.logo-small {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-placeholder {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-placeholder-small {
  width: 40px;
  height: 40px;
  background: var(--primary-red);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Offline Indicator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning-yellow);
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.875rem;
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
}

/* Auth Screen */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--background-light) 0%, var(--background) 100%);
  padding: 1rem;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 2rem 2rem 1rem;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  color: white;
}

.auth-header .logo {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  opacity: 0.9;
  font-size: 0.875rem;
}

.auth-tabs {
  display: flex;
  background: var(--background-light);
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: white;
  color: var(--primary-red);
  border-bottom: 2px solid var(--primary-red);
}

.tab-content {
  display: none;
  padding: 2rem;
}

.tab-content.active {
  display: block;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
}

.password-toggle:hover {
  background: var(--background-light);
}

.auth-help {
  margin-top: 1rem;
  text-align: center;
}

.help-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--background-dark);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-danger {
  background: var(--error-red);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Dashboard */
.dashboard-screen {
  background: var(--background-light);
}

.dashboard-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.header-text h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.header-text p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.dashboard-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.dashboard-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-red);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.recent-activity {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.recent-activity h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background-light);
  border-radius: var(--radius);
}

.activity-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-red-light);
  border-radius: var(--radius);
}

.activity-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.activity-content small {
  color: var(--text-secondary);
}

/* Recording Screen */
.recording-screen {
  background: var(--background-light);
}

.recording-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recording-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.recording-status {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.recording-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 500;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  background: var(--text-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.pulse-dot.recording {
  background: var(--error-red);
  animation: pulse-recording 1s infinite;
}

.recording-timer {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-red);
  font-family: "Courier New", monospace;
}

.recording-questions {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.recording-questions h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--background-light);
  border-radius: var(--radius);
}

.question-number {
  width: 30px;
  height: 30px;
  background: var(--primary-red);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.question-item p {
  margin: 0;
  color: var(--text-primary);
}

.recording-controls {
  text-align: center;
}

/* Registration Screen */
.registration-screen {
  background: var(--background-light);
}

.registration-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.registration-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.registration-form {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h3 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.125rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
}

.checkbox-label:hover {
  background: var(--background-light);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-red);
}

.consent-label {
  background: var(--primary-red-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 1rem;
  border-radius: var(--radius);
}

.form-actions {
  text-align: center;
  margin-top: 2rem;
}

/* Notifications */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  color: white;
  font-weight: 500;
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
}

.notification-success {
  background: var(--success-green);
}

.notification-error {
  background: var(--error-red);
}

.notification-info {
  background: var(--secondary-blue);
}

.notification-warning {
  background: var(--warning-yellow);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulse-recording {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .auth-container {
    margin: 1rem;
  }

  .recording-content,
  .registration-content,
  .dashboard-content {
    padding: 1rem;
  }

  .notification {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .question-item {
    flex-direction: column;
    text-align: center;
  }

  .btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

/* Print Styles */
@media print {
  .dashboard-header,
  .recording-header,
  .registration-header,
  .btn,
  .notification {
    display: none;
  }

  .screen {
    min-height: auto;
  }

  body {
    background: white;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-secondary: #000000;
  }
}

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