/* ===== ICOA2026 Portal - Component Styles ===== */

/* ============================================
   APP LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--portal-sidebar-width);
  background: rgba(10, 15, 26, 0.98);
  border-right: 1px solid var(--ico-border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
  transition: transform var(--portal-transition);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--ico-border-subtle);
  text-align: center;
}

.sidebar-logo-img {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 0 8px var(--ico-primary-glow));
  margin-bottom: 8px;
}

.sidebar-logo h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ico-primary-light);
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--ico-primary-glow);
}

.sidebar-logo .sub {
  font-size: 0.7rem;
  color: var(--ico-text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Sidebar Navigation */
.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.nav-section-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--ico-text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 20px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--ico-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--portal-transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(93, 120, 255, 0.08);
  color: var(--ico-text-primary);
  border-left-color: var(--ico-primary);
}

.nav-item.active {
  background: rgba(93, 120, 255, 0.12);
  color: var(--ico-primary-light);
  border-left-color: var(--ico-primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.nav-item.active svg {
  filter: drop-shadow(0 0 4px var(--ico-primary-glow));
}

.nav-item .badge {
  margin-left: auto;
  background: var(--ico-error);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar User Info */
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--ico-border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--ico-primary);
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ico-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--ico-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--ico-text-muted);
  cursor: pointer;
  padding: 6px;
  transition: var(--portal-transition);
}

.sidebar-logout-btn:hover {
  color: var(--ico-error);
}

.sidebar-logout-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--portal-sidebar-width);
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ico-text-primary);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--ico-text-secondary);
  margin-top: 4px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--ico-bg-panel);
  border: 1px solid var(--ico-border-subtle);
  border-radius: var(--portal-border-radius);
  padding: 24px;
  transition: all var(--portal-transition);
}

.card:hover {
  border-color: var(--ico-primary);
  box-shadow: var(--portal-glow-primary);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ico-primary-light);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.card-icon {
  width: 20px;
  height: 20px;
  stroke: var(--ico-primary-light);
  fill: none;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px var(--ico-primary-glow));
}

/* Status Cards */
.status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.status-icon.draft {
  background: rgba(93, 120, 255, 0.15);
  color: var(--ico-primary-light);
  box-shadow: inset 0 0 20px rgba(93, 120, 255, 0.1);
}

.status-icon.pending {
  background: rgba(255, 170, 0, 0.15);
  color: var(--ico-warning);
  box-shadow: inset 0 0 20px rgba(255, 170, 0, 0.1);
}

.status-icon.confirmed {
  background: rgba(0, 255, 136, 0.15);
  color: var(--ico-success);
  box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.1);
}

.status-icon.unpaid {
  background: rgba(255, 107, 107, 0.15);
  color: var(--ico-error);
  box-shadow: inset 0 0 20px rgba(255, 107, 107, 0.1);
}

.status-icon.paid {
  background: rgba(0, 255, 136, 0.15);
  color: var(--ico-success);
  box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.1);
}

.status-info h3 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ico-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-bottom: 4px;
}

.status-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--portal-transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.btn-primary {
  background: var(--ico-gradient-primary);
  color: #fff;
  border-color: var(--ico-primary);
}

.btn-primary:hover {
  box-shadow: var(--portal-glow-primary);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--ico-primary-light);
  border-color: var(--ico-primary);
}

.btn-outline:hover {
  background: rgba(93, 120, 255, 0.1);
  box-shadow: var(--portal-glow-primary);
}

.btn-success {
  background: rgba(0, 255, 136, 0.15);
  color: var(--ico-success);
  border-color: var(--ico-success);
}

.btn-success:hover {
  background: rgba(0, 255, 136, 0.25);
  box-shadow: var(--portal-glow-success);
}

.btn-danger {
  background: rgba(255, 107, 107, 0.15);
  color: var(--ico-error);
  border-color: var(--ico-error);
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.25);
  box-shadow: var(--portal-glow-error);
}

.btn-gold {
  background: rgba(255, 215, 0, 0.15);
  color: var(--ico-gold);
  border-color: var(--ico-gold);
}

.btn-gold:hover {
  background: rgba(255, 215, 0, 0.25);
  box-shadow: var(--portal-glow-gold);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.filter-btn {
  background: var(--ico-bg-card);
  border: 1px solid var(--ico-border-subtle);
  color: var(--ico-text-muted);
}
.filter-btn.active {
  background: var(--ico-primary);
  border-color: var(--ico-primary);
  color: #fff;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ico-primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ico-text-primary);
  background: rgba(15, 21, 37, 0.8);
  border: 1px solid var(--ico-border-subtle);
  border-radius: 6px;
  transition: all var(--portal-transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--ico-primary);
  box-shadow: 0 0 0 3px rgba(93, 120, 255, 0.15);
}

.form-input::placeholder {
  color: var(--ico-text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(200,220,255,0.7)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--ico-text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--ico-error);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--ico-border-subtle);
  border-radius: var(--portal-border-radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--ico-primary-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 16px;
  text-align: left;
  background: rgba(93, 120, 255, 0.08);
  border-bottom: 1px solid var(--ico-border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--ico-text-secondary);
  border-bottom: 1px solid rgba(93, 120, 255, 0.05);
}

.data-table tr:hover td {
  background: rgba(93, 120, 255, 0.04);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-draft {
  background: rgba(93, 120, 255, 0.15);
  color: var(--ico-primary-light);
  border: 1px solid rgba(93, 120, 255, 0.3);
}

.badge-pending {
  background: rgba(255, 170, 0, 0.15);
  color: var(--ico-warning);
  border: 1px solid rgba(255, 170, 0, 0.3);
}

.badge-confirmed {
  background: rgba(0, 255, 136, 0.15);
  color: var(--ico-success);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-cancelled {
  background: rgba(255, 107, 107, 0.15);
  color: var(--ico-error);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.badge-unpaid {
  background: rgba(255, 107, 107, 0.15);
  color: var(--ico-error);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.badge-paid {
  background: rgba(0, 255, 136, 0.15);
  color: var(--ico-success);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-urgent {
  background: rgba(255, 107, 107, 0.2);
  color: var(--ico-error);
  border: 1px solid rgba(255, 107, 107, 0.4);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 10px rgba(255, 107, 107, 0.3); }
}

/* Nav item pulse guide - draws attention to a nav item */
.nav-item.nav-pulse {
  animation: nav-pulse-glow 2s ease-in-out infinite;
  color: var(--ico-primary-light);
  border-left-color: var(--ico-primary);
  background: rgba(93, 120, 255, 0.08);
  position: relative;
}

.nav-item.nav-pulse::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ico-accent);
  box-shadow: 0 0 6px var(--ico-accent), 0 0 12px var(--ico-accent);
  animation: nav-dot-ping 2s ease-in-out infinite;
}

@keyframes nav-pulse-glow {
  0%, 100% { box-shadow: inset 0 0 0 rgba(93, 120, 255, 0); }
  50% { box-shadow: inset 0 0 20px rgba(93, 120, 255, 0.12), 0 0 8px rgba(93, 120, 255, 0.15); }
}

@keyframes nav-dot-ping {
  0%, 100% { opacity: 0.4; transform: translateY(-50%) scale(0.8); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

.badge-general { background: rgba(93, 120, 255, 0.15); color: var(--ico-primary-light); border: 1px solid rgba(93, 120, 255, 0.3); }
.badge-competition { background: rgba(0, 217, 255, 0.15); color: var(--ico-accent); border: 1px solid rgba(0, 217, 255, 0.3); }
.badge-logistics { background: rgba(255, 215, 0, 0.15); color: var(--ico-gold); border: 1px solid rgba(255, 215, 0, 0.3); }

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ico-border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ico-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--portal-transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ico-text-secondary);
}

.tab-btn.active {
  color: var(--ico-primary-light);
  border-bottom-color: var(--ico-primary);
}

.tab-panel {
  display: none;
}

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

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--ico-bg-medium);
  border: 1px solid var(--ico-border-subtle);
  border-radius: var(--portal-border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ico-primary-light);
  letter-spacing: 1px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--ico-text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--ico-error);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ============================================
   TOAST / NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
  border: 1px solid;
}

.toast-success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--ico-success);
  border-color: rgba(0, 255, 136, 0.3);
}

.toast-error {
  background: rgba(255, 107, 107, 0.1);
  color: var(--ico-error);
  border-color: rgba(255, 107, 107, 0.3);
}

.toast-info {
  background: rgba(93, 120, 255, 0.1);
  color: var(--ico-primary-light);
  border-color: rgba(93, 120, 255, 0.3);
}

.toast-warning {
  background: rgba(255, 170, 0, 0.1);
  color: var(--ico-warning);
  border-color: rgba(255, 170, 0, 0.3);
}

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

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--ico-text-muted);
  fill: none;
  stroke-width: 1;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--ico-text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--ico-text-muted);
}

/* ============================================
   MARKDOWN CONTENT
   ============================================ */
.markdown-content h1 { font-size: 1.5rem; margin: 24px 0 12px; }
.markdown-content h2 { font-size: 1.3rem; margin: 20px 0 10px; }
.markdown-content h3 { font-size: 1.1rem; margin: 16px 0 8px; }
.markdown-content p { margin-bottom: 12px; color: var(--ico-text-secondary); line-height: 1.7; }
.markdown-content ul, .markdown-content ol { margin: 8px 0 16px 24px; color: var(--ico-text-secondary); }
.markdown-content li { margin-bottom: 4px; }
.markdown-content code {
  background: rgba(93, 120, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ico-accent);
}
.markdown-content pre {
  background: rgba(5, 8, 16, 0.8);
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--ico-border-subtle);
}
.markdown-content pre code {
  background: none;
  padding: 0;
  color: var(--ico-text-secondary);
}
.markdown-content a { color: var(--ico-accent); }
.markdown-content a:hover { text-decoration: underline; }
.markdown-content blockquote {
  border-left: 3px solid var(--ico-primary);
  padding: 8px 16px;
  margin: 12px 0;
  background: rgba(93, 120, 255, 0.05);
  color: var(--ico-text-secondary);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  background: var(--ico-bg-panel);
  border: 1px solid var(--ico-border-subtle);
  border-radius: 8px;
  padding: 10px;
  color: var(--ico-text-primary);
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 16, 0.7);
  z-index: 45;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 16px 24px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
