/* Apply Portal - Public Application Portal Styles */

/* CSS Variables */
:root {
  --portal-bg: #0f172a;
  --portal-card: rgba(15, 23, 42, 0.85);
  --portal-card-hover: rgba(30, 41, 59, 0.95);
  --portal-border: rgba(59, 130, 246, 0.2);
  --portal-text: #e2e8f0;
  --portal-muted: #94a3b8;
  --portal-primary: #3b82f6;
  --portal-primary-hover: #2563eb;
  --portal-success: #22c55e;
  --portal-danger: #ef4444;
  --portal-warning: #f59e0b;
  --portal-radius: 16px;
  --portal-radius-sm: 12px;
  --portal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --portal-transition: all 0.3s ease;
}

[data-theme="light"] {
  --portal-bg: #f8fafc;
  --portal-card: rgba(255, 255, 255, 0.95);
  --portal-card-hover: rgba(248, 250, 252, 1);
  --portal-border: rgba(59, 130, 246, 0.15);
  --portal-text: #1e293b;
  --portal-muted: #64748b;
  --portal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Reset & Base */
.apply-portal * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.apply-portal {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--portal-bg);
  color: var(--portal-text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Hero Section with Server Banner */
.portal-hero {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portal-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
}

.portal-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(15, 23, 42, 0.3) 0%,
    rgba(15, 23, 42, 0.6) 50%,
    var(--portal-bg) 100%
  );
}

.portal-hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
  max-width: 800px;
}

.portal-server-icon {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--portal-shadow);
  margin-bottom: 1.5rem;
  object-fit: cover;
}

.portal-server-icon-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--portal-primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 1.5rem;
}

.portal-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.75rem;
}

.portal-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Main Container */
.portal-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Section Titles */
.portal-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-section-title i {
  color: var(--portal-primary);
}

/* Job Cards Grid */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Job Card */
.job-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  overflow: hidden;
  transition: var(--portal-transition);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.job-card:hover {
  background: var(--portal-card-hover);
  border-color: var(--portal-primary);
  transform: translateY(-4px);
  box-shadow: var(--portal-shadow);
}

.job-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #1e293b, #334155);
}

.job-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-card-image-placeholder i {
  font-size: 3rem;
  color: var(--portal-muted);
  opacity: 0.5;
}

.job-card-body {
  padding: 1.5rem;
}

.job-card-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.job-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--portal-text);
  margin-bottom: 0.5rem;
}

.job-card-description {
  color: var(--portal-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--portal-border);
}

.job-card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.job-card-status.open {
  background: rgba(34, 197, 94, 0.15);
  color: var(--portal-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.job-card-status.closed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--portal-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.job-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--portal-primary);
  color: white;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--portal-transition);
  text-decoration: none;
}

.job-card-btn:hover {
  background: var(--portal-primary-hover);
  transform: translateY(-1px);
}

/* No Jobs State */
.no-jobs {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--portal-card);
  border-radius: var(--portal-radius);
  border: 1px solid var(--portal-border);
}

.no-jobs i {
  font-size: 4rem;
  color: var(--portal-muted);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.no-jobs h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--portal-text);
}

.no-jobs p {
  color: var(--portal-muted);
}

/* =================== */
/* Job Detail Page     */
/* =================== */

.job-detail-hero {
  position: relative;
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.job-detail-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.5);
}

.job-detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(15, 23, 42, 0.7) 60%,
    var(--portal-bg) 100%
  );
}

.job-detail-hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.job-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  font-size: 0.85rem;
  color: white;
  margin-bottom: 1rem;
}

.job-detail-badge img {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.job-detail-title {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.5rem;
}

.job-detail-emoji {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  font-weight: 600;
  color: var(--portal-muted);
  white-space: nowrap;
  transition: var(--portal-transition);
}

.stepper-item.active {
  background: var(--portal-primary);
  border-color: var(--portal-primary);
  color: white;
}

.stepper-item.completed {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--portal-success);
  color: var(--portal-success);
}

.stepper-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.stepper-item.active .stepper-number {
  background: rgba(255, 255, 255, 0.2);
}

.stepper-item.completed .stepper-number {
  background: var(--portal-success);
  color: white;
}

.stepper-arrow {
  color: var(--portal-muted);
  opacity: 0.5;
}

/* Content Sections */
.job-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
}

.job-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.job-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.content-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.content-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.content-card-title i {
  color: var(--portal-primary);
}

.content-card-body {
  color: var(--portal-muted);
  line-height: 1.8;
}

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

.content-card-body ul,
.content-card-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-card-body li {
  margin-bottom: 0.5rem;
}

/* Apply Button Card */
.apply-card {
  background: linear-gradient(135deg, var(--portal-primary), #6366f1);
  border: none;
  text-align: center;
}

.apply-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.5rem;
}

.apply-card-subtitle {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
}

.apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 2rem;
  background: white;
  color: var(--portal-primary);
  border: none;
  border-radius: var(--portal-radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--portal-transition);
  text-decoration: none;
}

.apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

/* =================== */
/* Application Form    */
/* =================== */

.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.form-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--portal-border);
}

.form-header-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--portal-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

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

.form-header-text p {
  color: var(--portal-muted);
  font-size: 0.9rem;
}

/* Form Fields */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--portal-text);
}

.form-label .required {
  color: var(--portal-danger);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  color: var(--portal-text);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--portal-transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--portal-muted);
  opacity: 0.7;
}

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

.form-help {
  font-size: 0.85rem;
  color: var(--portal-muted);
  margin-top: 0.5rem;
}

/* Discord User Display */
.discord-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: var(--portal-radius-sm);
}

.discord-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(88, 101, 242, 0.5);
}

.discord-user-info h4 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.discord-user-info p {
  color: var(--portal-muted);
  font-size: 0.85rem;
}

/* Security Notice */
.security-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--portal-radius-sm);
  margin-bottom: 1.5rem;
}

.security-notice i {
  color: var(--portal-danger);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.security-notice p {
  color: var(--portal-danger);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Privacy Disclaimer */
.privacy-disclaimer {
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--portal-radius-sm);
  color: var(--portal-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.privacy-disclaimer a {
  color: var(--portal-primary);
  text-decoration: underline;
}

/* Submit Button */
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--portal-primary), #6366f1);
  color: white;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--portal-transition);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

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

/* Success/Error States */
.form-success {
  text-align: center;
  padding: 3rem;
}

.form-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid var(--portal-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  color: var(--portal-success);
}

.form-success h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.form-success p {
  color: var(--portal-muted);
}

/* Footer */
.portal-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--portal-border);
  margin-top: 3rem;
  color: var(--portal-muted);
  font-size: 0.85rem;
}

.portal-footer a {
  color: var(--portal-primary);
  text-decoration: none;
}

.portal-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .job-content {
    grid-template-columns: 1fr;
  }

  .job-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .portal-title {
    font-size: 1.75rem;
  }

  .portal-subtitle {
    font-size: 1rem;
  }

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

  .job-detail-title {
    font-size: 2rem;
  }

  .stepper {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stepper-arrow {
    display: none;
  }

  .form-container {
    padding: 1rem;
  }

  .content-card,
  .form-card {
    padding: 1.25rem;
  }
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-sm);
  color: var(--portal-text);
  font-weight: 600;
  cursor: pointer;
  transition: var(--portal-transition);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--portal-primary);
}

/* Login Required */
.login-required {
  text-align: center;
  padding: 3rem;
  background: var(--portal-card);
  border-radius: var(--portal-radius);
  border: 1px solid var(--portal-border);
}

.login-required i {
  font-size: 3rem;
  color: var(--portal-primary);
  margin-bottom: 1rem;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: #5865F2;
  color: white;
  border: none;
  border-radius: var(--portal-radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--portal-transition);
  text-decoration: none;
  margin-top: 1rem;
}

.login-btn:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

/* Internal Badge */
.internal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--portal-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
