/* =====================================================================
   RAMJAS CONSULTING SOCIETY — PUBLIC NOTICE (RECRUITMENT 2026)
   Minimalist & Professional Selection Roster — Mobile Optimized
   ===================================================================== */

:root {
  --rcs-p-navy: #0e1e38;
  --rcs-p-ink: #132743;
  --rcs-p-muted: #5e718d;
  --rcs-p-border: rgba(19, 39, 67, 0.1);
  --rcs-p-surface: #ffffff;
  --rcs-p-subtle: #f8fafc;
  --rcs-p-hover: #f1f5f9;
  --rcs-p-accent: #2563eb;
}

/* 1. Backdrop Overlay */
.rcs-notice-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 36, 0.68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  overscroll-behavior: contain;
}

.rcs-notice-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 2. Modal Card */
.rcs-notice-modal {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: min(88vh, 760px);
  background: var(--rcs-p-surface);
  border-radius: 20px;
  border: 1px solid var(--rcs-p-border);
  box-shadow: 0 24px 60px -12px rgba(11, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100001;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease;
}

.rcs-notice-backdrop.is-open .rcs-notice-modal {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile Sheet Drag Handle */
.rcs-sheet-handle {
  display: none;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 10px auto 2px;
  flex-shrink: 0;
}

/* Close Button */
.rcs-notice-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--rcs-p-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.rcs-notice-close-btn:hover {
  background: var(--rcs-p-hover);
  color: var(--rcs-p-navy);
  border-color: var(--rcs-p-border);
}

.rcs-notice-close-btn:active {
  transform: scale(0.92);
  background: #e2e8f0;
}

.rcs-notice-close-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* 3. Header */
.rcs-notice-header {
  padding: 30px 36px 20px;
  border-bottom: 1px solid var(--rcs-p-border);
  background: #ffffff;
  position: relative;
  touch-action: pan-y;
}

.rcs-notice-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rcs-p-accent);
  margin-bottom: 6px;
}

.rcs-notice-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--rcs-p-navy);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.rcs-notice-sub {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--rcs-p-muted);
  max-width: 620px;
}

/* 4. Controls Bar (Search + Count) */
.rcs-notice-controls {
  padding: 12px 36px;
  background: var(--rcs-p-subtle);
  border-bottom: 1px solid var(--rcs-p-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rcs-search-box {
  position: relative;
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
}

.rcs-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.rcs-search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  border: none;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.rcs-search-clear-btn:hover {
  background: #cbd5e1;
  color: #1e293b;
}

.rcs-search-clear-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.rcs-search-clear-btn svg {
  width: 12px;
  height: 12px;
}

.rcs-search-input {
  width: 100%;
  padding: 9px 34px 9px 36px;
  border-radius: 10px;
  border: 1px solid var(--rcs-p-border);
  background: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  color: var(--rcs-p-ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.rcs-search-input:focus {
  border-color: var(--rcs-p-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.rcs-count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rcs-p-muted);
  white-space: nowrap;
}

/* 5. Members List */
.rcs-roster-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.rcs-roster-body::-webkit-scrollbar {
  width: 5px;
}
.rcs-roster-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.rcs-members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rcs-members-table thead {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
  border-bottom: 1px solid var(--rcs-p-border);
}

.rcs-members-table th {
  padding: 10px 24px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rcs-p-muted);
  background: #ffffff;
}

.rcs-members-table th.col-num {
  width: 54px;
  text-align: center;
}

.rcs-members-table th.col-course {
  width: 240px;
  text-align: right;
}

.rcs-members-table tbody tr {
  border-bottom: 1px solid rgba(19, 39, 67, 0.05);
  transition: background 0.15s ease;
}

.rcs-members-table tbody tr:hover {
  background: var(--rcs-p-hover);
}

.rcs-members-table td {
  padding: 11px 24px;
  vertical-align: middle;
}

.rcs-members-table td.cell-num {
  text-align: center;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: #94a3b8;
  font-weight: 500;
}

.rcs-members-table td.cell-name {
  color: var(--rcs-p-navy);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.rcs-members-table td.cell-course {
  text-align: right;
  color: var(--rcs-p-muted);
  font-size: 0.82rem;
}

.rcs-empty-notice {
  text-align: center;
  padding: 48px 24px;
  color: var(--rcs-p-muted);
  font-size: 0.9rem;
}

/* 6. Footer */
.rcs-notice-footer {
  padding: 14px 36px;
  background: var(--rcs-p-subtle);
  border-top: 1px solid var(--rcs-p-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.rcs-close-action-btn {
  padding: 8px 20px;
  border-radius: 9px;
  background: var(--rcs-p-navy);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.rcs-close-action-btn:hover {
  background: #1c355e;
}

.rcs-close-action-btn:active {
  transform: scale(0.97);
}

/* 7. Floating Launcher Badge */
.rcs-notice-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #0e1e38;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 20px rgba(11, 23, 42, 0.25);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.rcs-notice-launcher:hover {
  transform: translateY(-2px);
  background: #152d54;
  box-shadow: 0 8px 24px rgba(11, 23, 42, 0.35);
}

.rcs-notice-launcher:active {
  transform: scale(0.96);
}

.rcs-launcher-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

/* =====================================================================
   MOBILE OPTIMIZATIONS (Smartphones <= 640px)
   ===================================================================== */
@media (max-width: 640px) {
  /* 1. Backdrop as bottom-anchored modal sheet */
  .rcs-notice-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .rcs-notice-modal {
    max-height: 88dvh;
    max-height: 88vh; /* fallback */
    height: auto;
    border-radius: 22px 22px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transform: translateY(100%);
    box-shadow: 0 -12px 40px rgba(11, 23, 42, 0.28);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
                opacity 0.2s ease;
  }

  .rcs-notice-backdrop.is-open .rcs-notice-modal {
    transform: translateY(0);
    opacity: 1;
  }

  /* Drag handle indicator for native feel */
  .rcs-sheet-handle {
    display: block;
  }

  /* Close button optimized for touch targets (40px) */
  .rcs-notice-close-btn {
    top: 12px;
    right: 14px;
    width: 40px;
    height: 40px;
    background: rgba(19, 39, 67, 0.05);
    border: 1px solid rgba(19, 39, 67, 0.08);
    color: var(--rcs-p-navy);
  }

  /* Header adjusted to avoid button collision and save vertical space */
  .rcs-notice-header {
    padding: 8px 58px 12px 18px;
  }

  .rcs-notice-kicker {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }

  .rcs-notice-title {
    font-size: 1.32rem;
    margin-bottom: 4px;
    line-height: 1.22;
  }

  .rcs-notice-sub {
    font-size: 0.8rem;
    line-height: 1.38;
    color: var(--rcs-p-muted);
  }

  /* Controls (Search + Counter) in single compact bar */
  .rcs-notice-controls {
    padding: 10px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .rcs-search-box {
    flex: 1;
    max-width: none;
  }

  /* CRITICAL: 16px font-size prevents iOS Safari from auto-zooming page on focus */
  .rcs-search-input {
    font-size: 16px;
    padding: 8px 32px 8px 34px;
    border-radius: 9px;
  }

  .rcs-search-icon {
    left: 10px;
    width: 15px;
    height: 15px;
  }

  .rcs-count-badge {
    font-size: 0.74rem;
    color: var(--rcs-p-navy);
    font-weight: 600;
    flex-shrink: 0;
    background: #e2e8f0;
    padding: 5px 9px;
    border-radius: 6px;
  }

  /* Roster List / Table Mobile View */
  .rcs-members-table {
    display: block;
    width: 100%;
  }

  .rcs-members-table thead {
    display: none; /* Hide redundant column headers on mobile to save vertical room */
  }

  .rcs-members-table tbody {
    display: block;
    width: 100%;
  }

  .rcs-members-table tbody tr {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    gap: 10px;
    border-bottom: 1px solid rgba(19, 39, 67, 0.06);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.03);
  }

  .rcs-members-table tbody tr:active {
    background: var(--rcs-p-hover);
  }

  .rcs-members-table td {
    padding: 0;
    border: none;
  }

  .rcs-members-table td.cell-num {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    width: 22px;
    flex-shrink: 0;
    text-align: left;
  }

  .rcs-members-table td.cell-name {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--rcs-p-navy);
    line-height: 1.35;
    word-break: break-word;
  }

  .rcs-members-table td.cell-course {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.73rem;
    font-weight: 500;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid rgba(19, 39, 67, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Empty state */
  .rcs-empty-notice {
    padding: 36px 16px;
    font-size: 0.85rem;
  }

  /* Footer with iOS safe area and 44px tap target */
  .rcs-notice-footer {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .rcs-close-action-btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Launcher Badge on Mobile */
  .rcs-notice-launcher {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    padding: 8px 14px;
    font-size: 0.78rem;
    gap: 7px;
    box-shadow: 0 4px 16px rgba(11, 23, 42, 0.3);
  }

  .rcs-notice-launcher:active {
    transform: scale(0.96);
  }
}

/* Extra small screens (e.g., iPhone SE <= 360px) */
@media (max-width: 360px) {
  .rcs-notice-header {
    padding: 6px 52px 10px 14px;
  }

  .rcs-notice-title {
    font-size: 1.18rem;
  }

  .rcs-notice-sub {
    font-size: 0.76rem;
  }

  .rcs-members-table tbody tr {
    padding: 10px 12px;
    gap: 8px;
  }

  .rcs-members-table td.cell-num {
    display: none; /* Give maximum space to candidate name on tiny screens */
  }

  .rcs-members-table td.cell-name {
    font-size: 0.84rem;
  }

  .rcs-members-table td.cell-course {
    font-size: 0.7rem;
    padding: 2px 6px;
    max-width: 52%;
  }
}
