/**
 * AATec Summit Platform - Component Styles
 * 
 * Version: 1.0.0
 * Classification: Enterprise/Government Efficacy Standard
 * Compliance: WCAG 2.2 Level AAA
 * 
 * Reusable component styles for cards, panels, modals, tables, etc.
 */

/* ============================================================================
   CARDS - Event Cards, Info Cards
   ============================================================================ */

.card {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.card:focus-within {
  border-color: var(--accent-primary);
}

.card-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 1rem;
  color: var(--text-primary);
  opacity: 0.8;
}

.card-body {
  margin-bottom: 1rem;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border-subtle);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Event Card Specific */
.event-card {
  position: relative;
}

.event-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-primary);
  color: var(--bg-primary);
  padding: 0.5em 1em;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.event-status.status-live {
  background: var(--error);
  animation: pulse 2s infinite;
}

.event-status.status-ended {
  background: var(--border-subtle);
}

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

.event-time {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}

.event-location {
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--text-primary);
  opacity: 0.9;
}

/* ============================================================================
   PANELS - Live Event 3-Panel Layout
   ============================================================================ */

.live-event-container {
  display: grid;
  grid-template-columns: 60% 40%;
  grid-template-rows: 80% 20%;
  gap: 1rem;
  height: calc(100vh - 200px);
  min-height: 600px;
}

.panel-video {
  grid-column: 1;
  grid-row: 1 / 3;
  background: var(--bg-primary);
  border: 3px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.panel-video.fullscreen {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

.panel-qa {
  grid-column: 2;
  grid-row: 1;
  background: var(--bg-primary);
  border: 3px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-voice-controls {
  grid-column: 2;
  grid-row: 2;
  background: var(--bg-primary);
  border: 3px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Panel Headers */
.panel-header {
  padding: 1rem;
  border-bottom: 2px solid var(--accent-primary);
  background: rgba(255, 255, 0, 0.05);
}

.panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0;
}

/* Panel Content */
.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Responsive panels for mobile */
@media (max-width: 1024px) {
  .live-event-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
  }
  
  .panel-video {
    grid-column: 1;
    grid-row: 1;
    min-height: 400px;
  }
  
  .panel-qa {
    grid-column: 1;
    grid-row: 2;
    min-height: 300px;
  }
  
  .panel-voice-controls {
    grid-column: 1;
    grid-row: 3;
  }
}

/* ============================================================================
   Q&A FEED
   ============================================================================ */

.qa-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qa-question {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem;
  border-radius: 4px;
  transition: border-color var(--transition-fast);
}

.qa-question:hover {
  border-left-color: var(--accent-secondary);
}

.qa-question.answered {
  border-left-color: var(--success);
}

.qa-question.pending {
  opacity: 0.7;
}

.qa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.qa-family-name {
  font-weight: 700;
  color: var(--accent-secondary);
}

.qa-timestamp {
  font-size: 0.875rem;
  opacity: 0.7;
}

.qa-text {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.qa-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.qa-upvote-btn {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: transparent;
  border: 2px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5em 1em;
  min-height: 36px;
  font-size: 0.875rem;
}

.qa-upvote-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 0, 0.1);
}

.qa-upvote-btn.upvoted {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 0, 0.2);
  font-weight: 700;
}

.qa-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25em 0.75em;
  border-radius: 3px;
}

.qa-status-badge.approved {
  background: var(--success);
  color: var(--bg-primary);
}

.qa-status-badge.answered {
  background: var(--accent-secondary);
  color: var(--bg-primary);
}

.qa-status-badge.pending {
  background: var(--warning);
  color: var(--bg-primary);
}

/* ============================================================================
   MODALS - WCAG AAA: FOCUS TRAP, KEYBOARD ACCESSIBLE
   ============================================================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-primary);
  border: 3px solid var(--accent-primary);
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent-primary);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-primary);
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  padding: 0;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close-btn:hover {
  background: var(--error);
  border-color: var(--error);
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 2px solid var(--border-subtle);
}

/* ============================================================================
   TABLES - Admin Dashboard
   ============================================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--border);
  margin-bottom: 2rem;
}

thead {
  background: rgba(255, 255, 0, 0.1);
  border-bottom: 3px solid var(--accent-primary);
}

th {
  text-align: left;
  padding: 1rem;
  font-weight: 700;
  color: var(--accent-primary);
  border-right: 1px solid var(--border-subtle);
}

th:last-child {
  border-right: none;
}

td {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

td:last-child {
  border-right: none;
}

tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Responsive tables */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
  }
}

/* ============================================================================
   BREADCRUMBS - WCAG AAA: USER LOCATION AWARENESS
   ============================================================================ */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin: 0 0.75em;
  color: var(--accent-primary);
  font-weight: 700;
}

.breadcrumbs a {
  color: var(--text-primary);
}

.breadcrumbs a:hover {
  color: var(--accent-primary);
}

.breadcrumbs [aria-current="page"] {
  color: var(--accent-primary);
  font-weight: 700;
  text-decoration: none;
}

/* ============================================================================
   TAGS / BADGES
   ============================================================================ */

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: rgba(255, 255, 0, 0.2);
  color: var(--text-primary);
  border: 2px solid var(--accent-primary);
  padding: 0.25em 0.75em;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.tag-secondary {
  background: var(--accent-secondary);
  color: var(--bg-primary);
}

.tag-success {
  background: var(--success);
  color: var(--bg-primary);
}

.tag-error {
  background: var(--error);
  color: var(--text-primary);
}

/* ============================================================================
   ALERTS / NOTIFICATIONS
   ============================================================================ */

.alert {
  padding: 1rem 1.5rem;
  border-radius: 4px;
  border: 2px solid transparent;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.alert-info {
  background: var(--info);
  color: var(--bg-primary);
  border-color: var(--bg-primary);
}

.alert-success {
  background: var(--success);
  color: var(--bg-primary);
  border-color: var(--bg-primary);
}

.alert-warning {
  background: var(--warning);
  color: var(--bg-primary);
  border-color: var(--bg-primary);
}

.alert-error {
  background: var(--error);
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* ============================================================================
   LISTS
   ============================================================================ */

.list-styled {
  padding-left: 2em;
  margin-bottom: 2em;
}

.list-styled li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.list-unstyled {
  list-style: none;
  padding-left: 0;
}

.list-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding-left: 0;
}

/* Definition Lists */
dl {
  display: grid;
  grid-template-columns: max-content auto;
  gap: 0.5rem 2rem;
  margin-bottom: 2rem;
}

dt {
  font-weight: 700;
  color: var(--accent-primary);
}

dd {
  margin: 0;
  color: var(--text-primary);
}

/* ============================================================================
   VIDEO PLAYER CONTROLS
   ============================================================================ */

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.video-container:hover .video-controls,
.video-container:focus-within .video-controls {
  opacity: 1;
}

.video-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5em;
}

.video-captions-toggle {
  margin-left: auto;
}

/* ============================================================================
   FORMS - ADVANCED
   ============================================================================ */

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

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

.form-section {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  padding: 1.5rem;
  border-radius: 4px;
  margin-bottom: 2rem;
}

.form-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-subtle);
}

/* ============================================================================
   TABS - WCAG AAA: ARIA TABPANEL PATTERN
   ============================================================================ */

.tabs {
  margin-bottom: 2rem;
}

.tab-list {
  display: flex;
  list-style: none;
  border-bottom: 3px solid var(--accent-primary);
  margin-bottom: 1.5rem;
}

.tab-button {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-primary);
  padding: 1em 1.5em;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  bottom: -3px;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-primary);
}

.tab-button[aria-selected="true"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background: rgba(255, 255, 0, 0.1);
}

.tab-panel {
  padding: 1.5rem;
  border: 2px solid var(--border-subtle);
  border-radius: 4px;
}

.tab-panel[hidden] {
  display: none;
}

/* ============================================================================
   PROGRESS INDICATORS
   ============================================================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width var(--transition-normal);
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5em;
  text-align: center;
}

/* ============================================================================
   TOOLTIPS - WCAG AAA: DISMISSIBLE
   ============================================================================ */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary);
  color: var(--bg-primary);
  padding: 0.5em 1em;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  margin-bottom: 0.5em;
  z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  opacity: 1;
}

/* ============================================================================
   ICONS - WCAG AAA: ALWAYS WITH TEXT
   ============================================================================ */

.icon {
  width: 1.25em;
  height: 1.25em;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

/* Decorative icons hidden from screen readers */
.icon[aria-hidden="true"] {
  pointer-events: none;
}

/* ============================================================================
   GRID LAYOUTS
   ============================================================================ */

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
  text-align: center;
  padding: 4rem 2rem;
  border-bottom: 3px solid var(--accent-primary);
  margin-bottom: 3rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================================
   ACCESSIBLE DATA TABLES
   ============================================================================ */

.data-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.data-table {
  min-width: 100%;
}

.data-table caption {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-align: left;
  padding: 1rem;
  caption-side: top;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--accent-primary);
}

.loading-inline::before {
  content: '⏳';
  animation: spin 2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .loading-inline::before {
    animation: none;
  }
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-primary);
  opacity: 0.7;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.empty-state-text {
  max-width: 600px;
  margin: 0 auto 2rem;
}
