/* ITDevCon Speeches Rating - Styles */

:root {
  --brand-primary: #1e40af;
  --brand-light: #3b82f6;
  --brand-bg: #eff6ff;
  --star-color: #f59e0b;
  --star-empty: #d1d5db;
  --success-color: #059669;
  --error-color: #dc2626;
  --info-color: #2563eb;
}

/* === Global === */
body {
  background: #f8fafc;
}

/* === Fade-in animation === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
main { animation: fadeInUp 0.3s ease-out; }

/* === Brand === */
.brand {
  color: var(--brand-primary);
  letter-spacing: 0.02em;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero h1 {
  color: var(--brand-primary);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.hero p {
  color: #64748b;
  margin-bottom: 0.25rem;
}

/* === Section labels === */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-primary);
  margin-bottom: 0.75rem;
}

/* === Rating Card === */
.rate-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
}
.rate-card header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--brand-bg);
}
.rate-card header h2 {
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
  font-size: 1.4rem;
}
.speaker-name {
  color: #64748b;
  font-size: 1rem;
}

/* === Star Rating === */
.rating-group {
  margin-bottom: 1rem;
}
.rating-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #334155;
}
.star-rating {
  display: flex;
  gap: 0.25rem;
}
.star {
  font-size: 2rem;
  cursor: pointer;
  color: var(--star-empty);
  transition: color 0.15s, transform 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.star:hover,
.star.hover {
  color: #fbbf24;
  transform: scale(1.15);
}
.star.active {
  color: var(--star-color);
}

/* === Attend Again === */
.attend-again {
  display: flex;
  gap: 2rem;
}
.attend-again label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
}

/* === Suggestions Grid === */
.suggestions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .suggestions-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.suggestions-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.suggestions-grid label:hover {
  background: var(--brand-bg);
}

/* === Submit Button === */
.btn-submit {
  width: 100%;
  padding: 0.9rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}
.btn-submit:hover {
  background: var(--brand-light);
}

/* === Thank You Card === */
.thankyou-card,
.error-card,
.info-card {
  max-width: 500px;
  margin: 2rem auto;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.thankyou-icon {
  font-size: 3.5rem;
  color: var(--success-color);
  background: #ecfdf5;
  width: 80px;
  height: 80px;
  line-height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
}
.error-icon {
  font-size: 3.5rem;
  color: var(--error-color);
  background: #fef2f2;
  width: 80px;
  height: 80px;
  line-height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
}
.info-icon {
  font-size: 3.5rem;
  color: var(--info-color);
  background: var(--brand-bg);
  width: 80px;
  height: 80px;
  line-height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
}

/* === Footer === */
footer.container {
  border-top: 1px solid #e2e8f0;
  margin-top: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  text-align: center;
  color: #94a3b8;
}

/* === Admin Styles === */
.admin-nav a {
  font-size: 0.85rem;
  color: #64748b;
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}
.admin-nav a:hover,
.admin-nav a[aria-current="page"] {
  color: var(--brand-primary);
  background: var(--brand-bg);
}

/* Admin Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-primary);
}
.stat-label {
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Speech table */
.speech-table {
  width: 100%;
  border-collapse: collapse;
}
.speech-table th {
  background: var(--brand-bg);
  color: var(--brand-primary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem;
  text-align: left;
}
.speech-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}
.speech-table tr:hover td {
  background: #f8fafc;
}

/* Rating bars */
.rating-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.rating-bar-label {
  flex: 0 0 200px;
  font-size: 0.85rem;
  color: #334155;
}
.rating-bar-track {
  flex: 1;
  height: 24px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
}
.rating-bar-fill {
  height: 100%;
  background: var(--brand-light);
  border-radius: 12px;
  transition: width 0.5s ease;
}
.rating-bar-value {
  flex: 0 0 50px;
  font-weight: 700;
  color: var(--brand-primary);
  text-align: right;
}

/* Badge */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--brand-bg);
  color: var(--brand-primary);
}
.badge-success {
  background: #ecfdf5;
  color: var(--success-color);
}
.badge-danger {
  background: #fef2f2;
  color: var(--error-color);
}

/* Action buttons */
.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
  margin: 0;
  box-sizing: border-box;
}
.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-light);
  color: #fff;
}
.btn-danger {
  background: var(--error-color);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
}
.btn-outline {
  border: 1px solid var(--brand-primary);
  color: var(--brand-primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--brand-bg);
}

/* Admin forms */
.admin-form {
  max-width: 600px;
  margin: 0 auto;
}
.admin-form label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.form-actions .btn-submit {
  flex: 1;
  text-align: center;
}
.btn-cancel {
  background: #94a3b8 !important;
}
.import-textarea::placeholder {
  color: #c0c8d4 !important;
  opacity: 1;
}

/* Fix PicoCSS button expansion */
.btn-sm, .btn-primary, .btn-danger, .btn-outline {
  width: auto;
}
.speech-table button,
.speech-table a.btn-sm {
  width: auto;
  display: inline-block;
  padding: 0.3rem 0.7rem;
  margin: 0;
}
.speech-table form {
  display: inline;
  margin: 0;
}
.actions-cell {
  white-space: nowrap;
  text-align: right;
}
.actions-cell .btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}
th.actions-header {
  text-align: right;
}
/* Speaker checkboxes in speech form */
.speaker-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0;
}
.speaker-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.speaker-check:hover {
  background: var(--brand-bg);
}

.compact-table td,
.compact-table th {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  vertical-align: middle;
}

/* Login card */
.login-card {
  max-width: 400px;
  margin: 3rem auto;
  padding: 2rem;
}
.login-card h2 {
  text-align: center;
  color: var(--brand-primary);
  margin-bottom: 1.5rem;
}

/* QR Code display */
.qr-container {
  text-align: center;
  padding: 2rem;
}
.qr-container canvas,
.qr-container img {
  margin: 0 auto;
  display: block;
}
.qr-url {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--brand-bg);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  word-break: break-all;
}

/* Suggestion frequency */
.suggestion-freq {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.suggestion-freq-bar {
  flex: 0 0 40px;
  height: 20px;
  background: var(--brand-bg);
  border-radius: 4px;
  overflow: hidden;
}
.suggestion-freq-fill {
  height: 100%;
  background: var(--brand-light);
  border-radius: 4px;
}
.suggestion-freq-text {
  font-size: 0.85rem;
}
.suggestion-freq-count {
  font-weight: 700;
  color: var(--brand-primary);
  font-size: 0.85rem;
}

/* Comment card */
.comment-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #334155;
}

/* Pct display */
.pct-display {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--brand-primary);
}
.pct-label {
  font-size: 0.85rem;
  color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
  .rating-bar-label {
    flex: 0 0 120px;
    font-size: 0.78rem;
  }
  .speech-table {
    font-size: 0.82rem;
  }
  .speech-table th,
  .speech-table td {
    padding: 0.5rem;
  }
}

/* === Vote Speech List === */
.vote-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}
.vote-header h2 {
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}
.vote-header p {
  color: #64748b;
  margin: 0;
}

.speech-vote-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.speech-vote-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.speech-vote-card:hover {
  border-color: var(--brand-light);
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
}
.speech-vote-card.speech-future {
  opacity: 0.55;
  border-style: dashed;
}
.speech-vote-card.speech-closed {
  opacity: 0.7;
}

.speech-vote-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.15rem;
}
.speech-vote-speaker {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0 0 0.3rem;
}
.speech-vote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: #94a3b8;
}
.speech-vote-meta span {
  white-space: nowrap;
}

.speech-vote-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #f1f5f9;
}

.speech-vote-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vote-score {
  font-weight: 700;
  color: var(--brand-primary);
  font-size: 0.9rem;
}

.badge-future {
  background: #f1f5f9;
  color: #94a3b8;
}
.badge-closed {
  background: #f1f5f9;
  color: #94a3b8;
}

/* Edit notice */
.edit-notice {
  font-size: 0.85rem;
  color: var(--star-color);
  font-weight: 600;
  margin-top: 0.25rem;
}
.speech-meta-detail {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Responsive vote list */
@media (max-width: 480px) {
  .speech-vote-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* === Share buttons === */
.share-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.share-label {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}
.share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.share-btn-facebook {
  background: #1877f2;
  color: #fff;
}
.share-btn-facebook:hover {
  color: #fff;
}
.share-btn-linkedin {
  background: #0a66c2;
  color: #fff;
}
.share-btn-linkedin:hover {
  color: #fff;
}
.share-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}
.share-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.15s;
}
.share-link:hover {
  transform: scale(1.15);
}
.share-link-fb {
  color: #1877f2;
}
.share-link-li {
  color: #0a66c2;
}

/* === ITDevCoin === */
.itdevcoin-box {
  background: linear-gradient(135deg, #fefce8, #fef3c7);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  text-align: center;
}
.itdevcoin-balance {
  font-size: 1rem;
  font-weight: 700;
  color: #92400e;
}
.itdevcoin-hint {
  font-size: 0.82rem;
  color: #a16207;
  margin: 0.4rem 0 0;
  line-height: 1.5;
}
.coin-value {
  font-size: 1.2rem;
  color: #b45309;
}
.itdevcoin-reward {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-top: 1.25rem;
  text-align: center;
  color: #92400e;
  font-weight: 600;
}
.coin-earned {
  font-size: 1.3rem;
  font-weight: 800;
  color: #b45309;
}
.coin-balance-small {
  font-size: 0.82rem;
  font-weight: 400;
  margin-top: 0.25rem;
  color: #a16207;
}

/* === Speech public page === */
.speech-public-card {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.speech-public-card h2 {
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}
.speech-public-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.75rem;
}

/* HTMX loading */
.htmx-request { opacity: 0.65; transition: opacity 0.3s; }
