/* ============================================================
   Legión4Ever — Portal del Raider (CSS)
   Aesthetic: Blizzard WoW Legion Dark Glassmorphism, Gold & Arcane Cyan
   ============================================================ */

.portal-page {
  min-height: 100vh;
  background: var(--bg-abyss);
  padding-top: calc(var(--nav-height) + var(--space-xl));
  padding-bottom: var(--space-4xl);
  position: relative;
}

/* ── Hero Profile Header ── */
.portal-profile-hero {
  background: linear-gradient(135deg, rgba(32, 10, 15, 0.9) 0%, rgba(14, 5, 7, 0.96) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(220, 38, 38, 0.2);
  margin-bottom: var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.portal-profile-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.portal-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

.portal-user-meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.portal-avatar-box {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-slate), var(--bg-deep));
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 20px rgba(229, 193, 88, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
}

.portal-welcome-text h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  letter-spacing: 0.5px;
}

.portal-welcome-text h1 span.user-highlight {
  color: var(--gold-bright);
  text-shadow: var(--glow-gold);
}

.portal-submeta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

.portal-badge-role {
  background: rgba(200, 155, 60, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.portal-discord-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(88, 101, 242, 0.15);
  border: 1px solid rgba(88, 101, 242, 0.4);
  color: #a4adfc;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
}

.portal-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Grid Layouts ── */
.portal-grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 992px) {
  .portal-grid-main {
    grid-template-columns: 1fr;
  }
}

/* ── Common Card Style ── */
.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.portal-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(220, 38, 38, 0.2);
}

.portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.portal-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Attendance Visual Meter (Asistencia a Raids) ── */
.attendance-overview {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  background: rgba(28, 10, 14, 0.7);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
  .attendance-overview {
    flex-direction: column;
    text-align: center;
  }
}

.attendance-gauge {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.attendance-gauge svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.attendance-gauge circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.gauge-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.gauge-val {
  stroke: var(--cyan-primary);
  transition: stroke-dashoffset 1s ease-out;
}

.gauge-val.val-excellent { stroke: #00FF98; filter: drop-shadow(0 0 6px rgba(0,255,152,0.6)); }
.gauge-val.val-good      { stroke: var(--gold-bright); filter: drop-shadow(0 0 6px rgba(229,193,88,0.6)); }
.gauge-val.val-low       { stroke: #FF6B6B; filter: drop-shadow(0 0 6px rgba(255,107,107,0.6)); }

.gauge-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-number {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1;
}

.gauge-pct {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.attendance-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  width: 100%;
}

.att-stat-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--cyan-primary);
}

.att-stat-item.present { border-left-color: #00FF98; }
.att-stat-item.late    { border-left-color: var(--gold-bright); }
.att-stat-item.excused { border-left-color: #3FC7EB; }
.att-stat-item.absent  { border-left-color: #FF6B6B; }

.att-stat-num {
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1.2;
}

.att-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.raid-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  max-height: 250px;
  overflow-y: auto;
}

.raid-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(22, 8, 11, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
}

.raid-date-tag {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ── Application Status Widget ── */
.app-status-box {
  background: rgba(26, 9, 13, 0.65);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.app-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--fw-bold);
  font-size: var(--fs-small);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-pending   { background: rgba(217, 119, 6, 0.18); color: var(--gold-bright); border: 1px solid var(--gold-bright); }
.badge-reviewing { background: rgba(220, 38, 38, 0.18); color: var(--cyan-light); border: 1px solid var(--cyan-light); }
.badge-accepted  { background: rgba(16, 185, 129, 0.18); color: #10B981; border: 1px solid #10B981; }
.badge-rejected  { background: rgba(239, 68, 68, 0.18); color: #EF4444; border: 1px solid #EF4444; }

.app-details-row {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: var(--fs-small);
}

.app-details-item strong {
  color: var(--text-primary);
  display: block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Messaging with Officers ── */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: rgba(18, 7, 10, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: var(--space-md);
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  position: relative;
  font-size: var(--fs-small);
  line-height: var(--lh-normal);
}

.chat-bubble.officer {
  align-self: flex-start;
  background: rgba(217, 119, 6, 0.18);
  border: 1px solid var(--border-gold);
  border-top-left-radius: 2px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(220, 38, 38, 0.18);
  border: 1px solid var(--cyan-muted);
  border-top-right-radius: 2px;
}

.chat-bubble-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 4px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.chat-bubble.officer .chat-sender {
  color: var(--gold-bright);
}

.chat-bubble.user .chat-sender {
  color: var(--cyan-light);
}

.chat-time {
  color: var(--text-muted);
  font-weight: var(--fw-regular);
}

.chat-text {
  color: var(--text-primary);
  white-space: pre-wrap;
}

.chat-reply-form {
  display: flex;
  gap: var(--space-sm);
}

.chat-reply-form input[type="text"] {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: var(--fs-small);
}

.chat-reply-form input[type="text"]:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 0 2px var(--cyan-muted);
  outline: none;
}

/* ── Character Management (Perfil Personal) ── */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.character-card {
  background: rgba(26, 9, 13, 0.65);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--class-color, var(--cyan-primary));
  border-radius: var(--radius-md);
  padding: var(--space-md);
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.character-card.is-main {
  border-color: var(--gold-bright);
  box-shadow: 0 0 15px rgba(229, 193, 88, 0.15);
}

.character-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.character-name-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.character-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.main-tag {
  background: rgba(229, 193, 88, 0.2);
  color: var(--gold-bright);
  border: 1px solid var(--gold-bright);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
}

.character-spec-role {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.character-ilvl-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--text-primary);
}

.character-ilvl-badge strong {
  color: var(--cyan-light);
}

.character-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  padding-top: var(--space-xs);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Add Character Inline/Modal Box ── */
.add-character-box {
  background: rgba(14, 5, 8, 0.65);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-md);
}

/* ── Auth Forms (Login / Registro) ── */
.portal-auth-container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
}

.portal-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl), 0 0 35px rgba(200, 155, 60, 0.2);
  backdrop-filter: blur(16px);
}

.portal-auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-xl);
}

.portal-auth-tab {
  flex: 1;
  text-align: center;
  padding: var(--space-sm);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.portal-auth-tab.active,
.portal-auth-tab:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ── Form System: Inputs, Labels & Groups ── */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-group {
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
}

.form-label {
  display: block !important;
  font-family: var(--font-display) !important;
  font-size: 0.75rem !important;
  font-weight: var(--fw-bold) !important;
  color: var(--gold-bright) !important;
  text-transform: uppercase !important;
  letter-spacing: 1.2px !important;
  margin-bottom: 2px !important;
  line-height: 1.4 !important;
  user-select: none !important;
}

.form-input {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(18, 7, 10, 0.88) !important;
  border: 1px solid rgba(220, 38, 38, 0.35) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 16px !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
  font-size: var(--fs-body) !important;
  line-height: 1.5 !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.3) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast) !important;
}

.form-input:focus {
  outline: none !important;
  background: rgba(28, 10, 14, 0.96) !important;
  border-color: var(--cyan-primary) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 0 3px var(--cyan-muted), 0 0 18px rgba(220, 38, 38, 0.4) !important;
}

.form-input::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.65;
}

select.form-input {
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: rgba(18, 7, 10, 0.88) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 42px !important;
}

select.form-input optgroup {
  background: #140709 !important;
  color: var(--gold-bright) !important;
  font-weight: bold !important;
  font-family: var(--font-display) !important;
  letter-spacing: 0.5px;
}

select.form-input option {
  background: #1c090d !important;
  color: var(--text-primary) !important;
  padding: 12px !important;
}

textarea.form-input {
  min-height: 110px !important;
  resize: vertical !important;
  line-height: var(--lh-normal) !important;
}

/* Form layout grids */
.portal-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.portal-form-row-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.portal-form-section-title {
  font-family: var(--font-display);
  font-size: var(--fs-small);
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-form-section-title.cyan {
  color: var(--cyan-light);
  border-bottom-color: rgba(220, 38, 38, 0.3);
}

@media (max-width: 640px) {
  .portal-form-row-2,
  .portal-form-row-3 {
    grid-template-columns: 1fr !important;
    gap: var(--space-xs) !important;
  }
}
