/* ---- Page Banner / Hero ---- */
.sq-banner {
  background:
    radial-gradient(circle, rgba(255, 193, 7, 0.22) 1px, transparent 1px),
    linear-gradient(135deg, #050505 0%, #111111 45%, #f5b400 100%);

  background-size:
    18px 18px,
    100% 100%;

  padding: 38px 0 32px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}
#sq-card-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sq-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f5c200' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.sq-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sq-banner-icon {
  font-size: 32px;
  color: #f5c200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sq-banner h1 {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
  letter-spacing: 0.3px;
}
.sq-banner p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  margin: 0;
}

/* ---- Section & Container ---- */
.sq-main-section {
  padding: 40px 0 60px;
  background: #f4f5f8;
  min-height: 520px;
}

/* ---- Views Toggle ---- */
.sq-view {
  display: none;
}
.sq-view.active {
  display: block;
  animation: sqFadeIn 0.25s ease-in-out;
}

@keyframes sqFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Section Cards ---- */
.sq-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  padding: 28px;
  border: 1px solid #e2e8f0;
  margin-bottom: 30px;
}
.sq-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.sq-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

/* Buttons */
.btn-sq-add {
  background: linear-gradient(90deg, #c4122d 0%, #e61d3c 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(196, 18, 45, 0.3);
  transition: all 0.22s ease;
  text-decoration: none !important;
}
.btn-sq-add:hover {
  background: linear-gradient(90deg, #a50e24 0%, #c4122d 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(196, 18, 45, 0.4);
}

.btn-sq-back {
  background: #ffffff;
  color: #2b3648;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1.5px solid #2b3648;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sq-back:hover {
  background: #2b3648;
  color: #ffffff;
}

/* Search Input */
.sq-search-box {
  position: relative;
  min-width: 240px;
}
.sq-search-box input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13.5px;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.2s;
}
.sq-search-box input:focus {
  border-color: #f5c200;
  background: #ffffff;
}
.sq-search-box .sq-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
}

/* ---- Main Tables (Matching Reference Images) ---- */
.sq-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
}
table.sq-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
table.sq-table thead tr {
  background: #2c335a;
}
table.sq-table thead th {
  padding: 14px 20px;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: none;
}
table.sq-table thead th:first-child {
  border-top-left-radius: 8px;
}
table.sq-table thead th:last-child {
  border-top-right-radius: 8px;
  text-align: right;
  padding-right: 28px;
}

table.sq-table tbody tr {
  background: #ffffff;
  transition: background 0.18s ease;
}
table.sq-table tbody tr:nth-child(even) {
  background: #fafafa;
}
table.sq-table tbody tr:hover {
  background: #f1f5f9;
}
table.sq-table tbody td {
  padding: 15px 20px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: middle;
}
table.sq-table tbody td:last-child {
  text-align: right;
  padding-right: 28px;
}

.sq-sr-no {
  font-weight: 700;
  color: #475569;
}
.sq-sector-title {
  font-weight: 600;
  color: #1e293b;
}

/* Action Eye Icon Button */
.btn-sq-eye {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #eef2ff;
  color: #3b82f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.btn-sq-eye:hover {
  background: #2c335a;
  color: #f5c200;
  transform: scale(1.1);
}

.sq-no-roles {
  text-align: center;
  padding: 36px 16px;
  color: #64748b;
  font-size: 14.5px;
  font-weight: 500;
}

/* ---- Upload Form Card ---- */
.sq-form-card {
  max-width: 760px;
  margin: 0 auto;
}
.sq-form-group {
  margin-bottom: 22px;
}
.sq-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}
.sq-form-label .req {
  color: #dc2626;
  margin-left: 2px;
}

.sq-select-control {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  color: #1e293b;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.sq-select-control:focus {
  border-color: #2c335a;
  box-shadow: 0 0 0 3px rgba(44, 51, 90, 0.1);
}

/* File Upload Drop Zone */
.sq-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.sq-dropzone:hover,
.sq-dropzone.dragover {
  border-color: #2c335a;
  background: #f1f5f9;
}
.sq-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.sq-dropzone-icon {
  font-size: 42px;
  color: #3b82f6;
  margin-bottom: 10px;
}
.sq-dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.sq-dropzone-sub {
  font-size: 12.5px;
  color: #64748b;
}
.sq-file-selected {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.btn-sq-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(90deg, #c4122d 0%, #e61d3c 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(196, 18, 45, 0.3);
  transition: all 0.22s ease;
  margin-top: 10px;
}
.btn-sq-submit:hover {
  background: linear-gradient(90deg, #a50e24 0%, #c4122d 100%);
  box-shadow: 0 6px 20px rgba(196, 18, 45, 0.4);
}

/* ---- PDF Modal (Matching Screenshot 2) ---- */
.sq-pdf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sq-pdf-modal.active {
  opacity: 1;
  pointer-events: all;
}
.sq-pdf-modal-card {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.sq-pdf-modal-header {
  background: #2c335a;
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sq-pdf-modal-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.sq-pdf-modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.sq-pdf-modal-close:hover {
  opacity: 1;
}

.sq-pdf-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: #f8fafc;
}
.sq-pdf-role-name {
  font-size: 18px;
  font-weight: 700;
  color: #2c335a;
  margin-bottom: 16px;
}

/* Paper Container Frame */
.sq-paper-frame {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  min-height: 480px;
}
.sq-paper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2c335a;
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.sq-paper-logo {
  font-size: 24px;
  font-weight: 900;
  color: #c4122d;
  letter-spacing: -0.5px;
}
.sq-paper-logo span {
  color: #f5c200;
}

.sq-paper-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13.5px;
}
.sq-paper-table td,
.sq-paper-table th {
  border: 1px solid #64748b;
  padding: 8px 12px;
}
.sq-paper-table th {
  background: #f1f5f9;
  font-weight: 700;
  width: 25%;
  color: #1e293b;
}

.sq-paper-box {
  border: 1px solid #64748b;
  padding: 14px 18px;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 4px;
}
.sq-paper-box-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #1e293b;
}
.sq-paper-instructions {
  font-size: 13px;
  color: #334155;
  padding-left: 20px;
  margin: 0;
}
.sq-paper-instructions li {
  margin-bottom: 4px;
}

/* ---- PDF Loading & Empty State Styles ---- */
.sq-pdf-loader-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  min-height: 450px;
}
.sq-pdf-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #c4122d;
  border-right-color: #f5c200;
  border-radius: 50%;
  animation: sqSpin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes sqSpin {
  to {
    transform: rotate(360deg);
  }
}
.sq-pdf-loader-text {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}
.sq-pdf-loader-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.sq-no-pdf-card {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  margin: 10px 0;
}
.sq-no-pdf-icon {
  font-size: 52px;
  color: #94a3b8;
  margin-bottom: 12px;
}
.sq-no-pdf-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}
.sq-no-pdf-desc {
  font-size: 14px;
  color: #64748b;
  max-width: 440px;
  margin: 0 auto 20px auto;
}

.sq-pdf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-sq-action {
  background: #e2e8f0;
  color: #1e293b;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sq-action:hover {
  background: #cbd5e1;
  color: #0f172a;
}
.btn-sq-action-primary {
  background: #2c335a;
  color: #ffffff;
}
.btn-sq-action-primary:hover {
  background: #1e2440;
  color: #f5c200;
}

@media (max-width: 480px) {
  /* Banner */
  .sq-banner {
    padding: 22px 0 18px;
  }
  .sq-banner h1 {
    font-size: 18px;
  }
  .sq-banner p {
    font-size: 12px;
  }
  .sq-banner-icon {
    font-size: 24px;
  }

  /* Main section */
  .sq-main-section {
    padding: 18px 0 36px;
  }

  /* Card */
  .sq-card {
    padding: 14px 12px;
    border-radius: 8px;
  }

  /* Toolbar: stack title + actions vertically */
  .sq-card-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 16px;
  }
  .sq-card-title {
    font-size: 16px;
  }

  /* Toolbar actions row: search + button */
  #sq-card-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  /* Search box: full width */
  .sq-search-box {
    min-width: 100%;
    width: 100%;
  }

  /* "Add Question Paper" button: full width */
  .btn-sq-add {
    width: 100%;
    justify-content: center;
    font-size: 13px;
    padding: 10px 14px;
  }

  /* Back button: full width */
  .btn-sq-back {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px 12px;
  }

  /* Table: tighter padding on mobile */
  table.sq-table thead th {
    padding: 11px 10px;
    font-size: 10.5px;
    letter-spacing: 0.3px;
  }
  table.sq-table tbody td {
    padding: 12px 10px;
    font-size: 13px;
  }
  table.sq-table thead th:last-child,
  table.sq-table tbody td:last-child {
    padding-right: 12px;
  }

  /* SR NO column: narrower */
  .sq-sr-no {
    font-size: 12px;
  }

  /* PDF Modal */
  .sq-pdf-modal {
    padding: 8px;
    align-items: flex-end;
  }
  .sq-pdf-modal-card {
    max-height: 98vh;
    border-radius: 12px 12px 0 0;
  }
  .sq-pdf-modal-header {
    padding: 12px 16px;
  }
  .sq-pdf-modal-title {
    font-size: 14px;
    gap: 6px;
  }
  .sq-pdf-modal-body {
    padding: 14px 12px;
  }
  .sq-pdf-role-name {
    font-size: 15px;
    margin-bottom: 12px;
  }

  /* PDF iframe/object height: shorter on phones */
  #pdfObject,
  .sq-pdf-modal-body iframe {
    height: 380px !important;
  }

  /* PDF actions: stack */
  .sq-pdf-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .btn-sq-action {
    justify-content: center;
    width: 100%;
  }

  /* Auth card */
  .sq-auth-card {
    padding: 14px 14px;
  }
  .sq-auth-prompt {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .sq-auth-icon {
    font-size: 28px;
  }
  .sq-auth-title {
    font-size: 14px;
  }
  .sq-auth-desc {
    font-size: 12px;
  }
  .sq-auth-active {
    flex-direction: column;
    align-items: flex-start;
  }
  .sq-auth-user-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }
  .btn-sq-logout {
    width: 100%;
    justify-content: center;
  }

  /* Upload form card */
  .sq-form-card {
    max-width: 100%;
  }
  .sq-dropzone {
    padding: 24px 14px;
  }
  .sq-dropzone-icon {
    font-size: 32px;
  }
  .sq-dropzone-title {
    font-size: 13px;
  }
  .btn-sq-submit {
    font-size: 14px;
    padding: 12px;
  }

  /* No-PDF empty state card */
  .sq-no-pdf-card {
    padding: 30px 16px;
  }
  .sq-no-pdf-icon {
    font-size: 40px;
  }
  .sq-no-pdf-title {
    font-size: 16px;
  }
  .sq-no-pdf-desc {
    font-size: 13px;
  }

  /* PDF loader */
  .sq-pdf-loader-wrapper {
    padding: 40px 16px;
    min-height: 320px;
  }
}

/* ── Tablets (481px – 768px) ─────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
  /* Card */
  .sq-card {
    padding: 18px 16px;
  }

  /* Toolbar: keep title left, actions right, but wrap neatly */
  .sq-card-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Toolbar actions row: horizontal, full width */
  #sq-card-toolbar-actions {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  /* Search: grow to fill remaining space */
  .sq-search-box {
    flex: 1 1 180px;
    min-width: 180px;
  }

  /* "Add Question Paper" button: shrink gracefully */
  .btn-sq-add {
    font-size: 13px;
    padding: 10px 16px;
    flex-shrink: 0;
  }

  /* Table: tighter column padding */
  table.sq-table thead th,
  table.sq-table tbody td {
    padding-left: 14px;
    padding-right: 14px;
  }
  table.sq-table thead th:last-child,
  table.sq-table tbody td:last-child {
    padding-right: 16px;
  }

  /* PDF modal: bottom-sheet style */
  .sq-pdf-modal {
    padding: 12px;
    align-items: flex-end;
  }
  .sq-pdf-modal-card {
    max-height: 96vh;
    border-radius: 12px 12px 0 0;
  }
  .sq-pdf-modal-body {
    padding: 18px 16px;
  }
  #pdfObject,
  .sq-pdf-modal-body iframe {
    height: 460px !important;
  }

  /* PDF actions: wrap */
  .sq-pdf-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Auth card */
  .sq-auth-active {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .btn-sq-logout {
    align-self: flex-start;
  }

  /* Upload form */
  .sq-form-card {
    max-width: 100%;
  }
  .sq-paper-frame {
    padding: 16px;
  }
}

/* ---- Google Authentication Card & Form Disabled States ---- */
.sq-auth-card {
  padding: 18px 22px;
  border-radius: 10px;
  margin-bottom: 24px;
  transition: all 0.25s ease;
}
.sq-auth-pending {
  background: #fffdf5;
  border: 1.5px solid #fde68a;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.08);
}
.sq-auth-active {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.08);
}
.sq-auth-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sq-auth-icon {
  font-size: 36px;
  color: #d97706;
  display: flex;
  align-items: center;
}
.sq-auth-title {
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 2px;
}
.sq-auth-desc {
  font-size: 13px;
  color: #b45309;
}
.sq-auth-user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.sq-auth-user-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: #166534;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  padding: 5px 12px;
  border-radius: 6px;
}
.sq-auth-status-text {
  font-size: 13px;
  color: #15803d;
}
.btn-sq-logout {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-sq-logout:hover {
  background: #fca5a5;
  color: #7f1d1d;
}

/* Disabled Form States */
.sq-select-control:disabled {
  background-color: #f1f5f9 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  border-color: #cbd5e1 !important;
}
.sq-dropzone.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}
.btn-sq-submit:disabled {
  background: #94a3b8 !important;
  color: #ffffff !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  pointer-events: none !important;
  opacity: 0.6;
}
