/* ==========================================================================
   Students Parliament Nigeria - Main Portal Page Styles
   ========================================================================== */

.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

/* Hide Netlify Drawer & Badge Widget */
#netlify-drawer,
netlify-drawer,
div[data-netlify-drawer],
div[id^="netlify-"],
div[class*="netlify-drawer"],
iframe[src*="netlify.app"],
iframe[title*="Netlify"],
[class*="netlify-badge"],
[id*="netlify-badge"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hero Section */
.portal-hero {
  text-align: center;
  padding: 48px 20px 32px;
  max-width: 820px;
  margin: 0 auto;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 61, 35, 0.08);
  color: #0b3d23;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 18px;
  border: 1px solid rgba(11, 61, 35, 0.15);
}

.portal-hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 900;
  color: #0b3d23;
  line-height: 1.2;
  margin-bottom: 14px;
}

.portal-hero p {
  color: #475569;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

/* Action Cards Grid */
.portal-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.portal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 36px 30px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.portal-card:hover {
  border-color: #0b3d23;
  transform: none;
}

.portal-card.retrieve-card:hover {
  border-color: #b45309;
  transform: none;
}

.portal-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #0b3d23;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow: 0 6px 15px rgba(11, 61, 35, 0.25);
}

.portal-card.retrieve-card .portal-card-icon {
  background: #b45309;
  box-shadow: 0 6px 15px rgba(180, 83, 9, 0.25);
}

.portal-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}

.portal-card p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 26px;
  flex-grow: 1;
}

.portal-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.portal-btn-primary {
  background: #0b3d23;
  color: #ffffff;
}

.portal-btn-primary:hover {
  background: #14532d;
  color: #ffffff;
}

.portal-btn-secondary {
  background: #b45309;
  color: #ffffff;
}

.portal-btn-secondary:hover {
  background: #92400e;
  color: #ffffff;
}

/* Retrieval Modal Backdrop & Dialog */
.portal-retrieve-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(11, 61, 35, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-retrieve-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.portal-retrieve-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 20px;
  border: 2px solid #b45309;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(180, 83, 9, 0.15);
  max-width: 700px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.93) translateY(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.portal-retrieve-backdrop.is-open .portal-retrieve-box {
  transform: scale(1) translateY(0);
}

.portal-retrieve-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.portal-retrieve-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-btn-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-btn-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.portal-search-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.portal-search-input {
  flex: 1 1 0%;
  min-width: 0;
  width: 0;
  padding: 12px 14px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.portal-search-input:focus {
  border-color: #b45309;
}

.portal-search-btn {
  background: linear-gradient(135deg, #0b3d23 0%, #15803d 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0 20px;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
}

.portal-search-btn:hover {
  background: linear-gradient(135deg, #062b17 0%, #166534 100%);
  transform: none;
}

.portal-search-btn:active {
  opacity: 0.95;
}

.portal-search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.portal-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 6px;
  margin-right: -4px;
}

.portal-results-list::-webkit-scrollbar {
  width: 6px;
}

.portal-results-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.portal-results-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.portal-results-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.portal-record-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f8fafc;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.portal-record-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.portal-record-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}

.portal-record-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.portal-record-details h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.portal-record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #64748b;
}

.portal-record-badge {
  background: #0b3d23;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}

.portal-record-actions {
  display: flex;
  gap: 8px;
}

.portal-record-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.portal-record-btn-load {
  background: #0b3d23;
  color: #ffffff;
}

.portal-record-btn-load:hover {
  background: #14532d;
}

.portal-empty-state {
  text-align: center;
  padding: 30px 10px;
  color: #64748b;
}

.portal-empty-state svg {
  margin-bottom: 12px;
  opacity: 0.4;
}

/* Footer */
.portal-footer {
  margin-top: auto;
  text-align: center;
  padding: 24px;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

@keyframes portalSpin {
  to { transform: rotate(360deg); }
}

/* Prevent any upward float or transform movement on hover across portal */
button:hover,
a:hover,
.portal-card:hover,
.portal-btn:hover,
.portal-search-btn:hover,
.portal-record-btn:hover,
.portal-record-item:hover {
  transform: none !important;
}

/* Mobile Responsiveness for Retrieve Modal & Search */
@media (max-width: 540px) {
  .portal-retrieve-backdrop {
    padding: 10px;
  }

  .portal-retrieve-box {
    padding: 18px 14px;
    border-radius: 14px;
    max-height: 90vh;
  }

  .portal-retrieve-header {
    margin-bottom: 14px;
  }

  .portal-retrieve-header h3 {
    font-size: 1.05rem;
  }

  .portal-search-bar {
    gap: 6px;
    margin-bottom: 16px;
  }

  .portal-search-input {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .portal-search-btn {
    padding: 0 14px;
    font-size: 0.85rem;
    gap: 4px;
  }

  .portal-record-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .portal-record-actions {
    width: 100%;
  }

  .portal-record-actions .portal-record-btn {
    width: 100%;
    justify-content: center;
  }
}

