/**
 * Student Card Manager – Frontend Styles
 * Design matches the reference image (dark blue + gold accents).
 *
 * @package Student_Card_Manager
 */

/* ==========================================================================
   Root Wrapper (Full 100vw)
   ========================================================================== */
.scm-fe-wrapper {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #0a1a3a;
  background-image:
    radial-gradient(ellipse at top left, rgba(245, 179, 1, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at bottom right, rgba(245, 179, 1, 0.05) 0%, transparent 45%),
    linear-gradient(135deg, #0a1a3a 0%, #0f1f4d 100%);
  color: #ffffff;
  padding: 60px 20px 80px;
  min-height: 90vh;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

.scm-fe-wrapper *,
.scm-fe-wrapper *::before,
.scm-fe-wrapper *::after {
  box-sizing: border-box;
}

/* Decorative side dots (mimic reference image) */
.scm-fe-decor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 220px;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(circle, rgba(245, 179, 1, 0.35) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  background-repeat: repeat;
}

.scm-fe-decor-left {
  left: 0;
  -webkit-mask-image: linear-gradient(to right, #000 0%, transparent 90%);
  mask-image: linear-gradient(to right, #000 0%, transparent 90%);
}

.scm-fe-decor-right {
  right: 0;
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 90%);
  mask-image: linear-gradient(to left, #000 0%, transparent 90%);
}

/* Golden wave lines (subtle) */
.scm-fe-decor-left::before,
.scm-fe-decor-right::before {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  width: 100%;
  background: repeating-linear-gradient(
    60deg,
    transparent 0,
    transparent 40px,
    rgba(245, 179, 1, 0.18) 40px,
    rgba(245, 179, 1, 0.18) 41px
  );
  opacity: 0.4;
}

/* ==========================================================================
   Container
   ========================================================================== */
.scm-fe-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 2;
}

/* ==========================================================================
   Header
   ========================================================================== */
.scm-fe-header {
  text-align: center;
  margin-bottom: 40px;
}

.scm-fe-title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  margin: 0 0 12px 0 !important;
  color: #ffffff !important;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.scm-fe-title-accent {
  color: #f5b301;
  background: linear-gradient(135deg, #f5b301 0%, #ffd35c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.scm-fe-subtitle {
  font-size: clamp(14px, 1.6vw, 16px);
  color: #cbd5e1;
  margin: 0 auto !important;
  max-width: 640px;
  line-height: 1.6;
}

.scm-fe-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}

.scm-fe-divider span:not(.dot) {
  display: block;
  width: 40px;
  height: 2px;
  background: #f5b301;
  border-radius: 2px;
}

.scm-fe-divider .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5b301;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */
.scm-fe-search-form {
  margin: 0 auto 32px;
  max-width: 960px;
}

.scm-fe-search-wrap {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(245, 179, 1, 0.5);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(245, 179, 1, 0.08);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.scm-fe-search-wrap:focus-within {
  border-color: #f5b301;
  box-shadow: 0 8px 40px rgba(245, 179, 1, 0.2);
}

.scm-fe-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  color: #f5b301;
  flex-shrink: 0;
}

.scm-fe-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 16px;
  padding: 18px 8px;
  width: 100%;
  min-width: 0;
  font-family: inherit;
}

.scm-fe-search-input::placeholder {
  color: rgba(203, 213, 225, 0.6);
}

.scm-fe-search-input:focus {
  outline: none;
  box-shadow: none;
}

.scm-fe-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  background: linear-gradient(135deg, #f5b301 0%, #e8a600 100%);
  color: #0a1a3a;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s,
    filter 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.scm-fe-search-btn:hover {
  filter: brightness(1.08);
}

.scm-fe-search-btn:active {
  transform: scale(0.98);
}

.scm-fe-search-btn[disabled] {
  opacity: 0.7;
  cursor: wait;
}

/* ==========================================================================
   Search Result Area
   ========================================================================== */
.scm-fe-search-result {
  margin-bottom: 24px;
}

.scm-fe-search-result:empty {
  margin-bottom: 0;
}

.scm-fe-search-message {
  padding: 16px 20px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  text-align: center;
  font-size: 14px;
}

.scm-fe-search-message.scm-fe-searching {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ==========================================================================
   Student Card (matches reference image exactly)
   ========================================================================== */
.scm-fe-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.scm-fe-card {
  position: relative;
  background: linear-gradient(135deg, #0f2555 0%, #1a3a7a 100%);
  border: 1.5px solid rgba(245, 179, 1, 0.35);
  border-radius: 20px;
  padding: 30px 34px;
  color: #ffffff;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  width: 55vw;
  margin: auto;
}
@media (max-width: 900px) {
  .scm-fe-card {
    width: 75vw;
  }
}
@media (max-width: 480px) {
  .scm-fe-card {
    width: 95vw;
  }
}

/* Corner "STUDENT CARD" gold ribbon */
.scm-fe-card-corner {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #f5b301 0%, #e8a600 100%);
  color: #0a1a3a;
  padding: 10px 26px 10px 40px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 20px 0 24px;
}

.scm-fe-card-corner-text {
  display: inline-block;
}

/* Card grid layout */
.scm-fe-card-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
}

.scm-fe-card-no-image .scm-fe-card-inner {
  grid-template-columns: 1fr auto;
}

/* Image column */
.scm-fe-card-image-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.scm-fe-card-image {
  width: 130px;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(245, 179, 1, 0.6);
  background: #1e3a8a;
  flex-shrink: 0;
  border-radius: 50%;
}

.scm-fe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Main info column */
.scm-fe-card-main-col {
  min-width: 0;
}

/* Institute header */
.scm-fe-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(245, 179, 1, 0.2);
}

.scm-fe-card-logo {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.scm-fe-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.scm-fe-card-institute {
  min-width: 0;
}

.scm-fe-card-institute-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 2px;
}

.scm-fe-card-institute-tagline {
  font-size: 13px;
  color: #f5b301;
  font-weight: 500;
}

/* Info rows */
.scm-fe-card-info {
  display: grid;
  gap: 8px;
}

.scm-fe-card-row {
  display: grid;
  grid-template-columns: 28px 130px 12px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  line-height: 1.4;
}

.scm-fe-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5b301;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.scm-fe-card-icon svg {
  width: 100%;
  height: 100%;
}

.scm-fe-card-label {
  color: #cbd5e1;
  font-weight: 500;
}

.scm-fe-card-sep {
  color: #cbd5e1;
  text-align: center;
}

.scm-fe-card-value {
  color: #ffffff;
  font-weight: 600;
  word-break: break-word;
}

.scm-fe-highlight {
  color: #f5b301 !important;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Status Badge */
.scm-fe-status-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
}

.scm-fe-status-progress {
  background: #059669;
  color: #ffffff;
}

.scm-fe-status-completed {
  background: #2563eb;
  color: #ffffff;
}

/* Progress ring column */
.scm-fe-card-progress-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 10px;
}

.scm-fe-progress-ring {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scm-fe-progress-ring svg {
  display: block;
}

.scm-fe-progress-ring-fill {
  transition: stroke-dashoffset 0.6s ease;
  filter: drop-shadow(0 0 6px rgba(245, 179, 1, 0.5));
}

.scm-fe-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ffffff;
  line-height: 1;
}

.scm-fe-progress-percent {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.scm-fe-progress-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #cbd5e1;
  margin-top: 4px;
}

/* ==========================================================================
   Custom Card Wrapper
   ========================================================================== */
.scm-fe-custom-card {
  margin-bottom: 24px;
}

/* ==========================================================================
   Empty State / Info
   ========================================================================== */
.scm-fe-empty,
.scm-fe-info {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed rgba(245, 179, 1, 0.3);
  border-radius: 16px;
}

.scm-fe-empty-icon,
.scm-fe-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  background: rgba(245, 179, 1, 0.1);
  color: #f5b301;
  border-radius: 50%;
}

.scm-fe-info {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.scm-fe-info-icon {
  width: 44px;
  height: 44px;
  margin: 0;
}

.scm-fe-info p {
  margin: 0 !important;
  color: #cbd5e1;
  font-size: 15px;
}

.scm-fe-empty-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0 0 8px 0 !important;
}

.scm-fe-empty-text {
  color: #94a3b8;
  font-size: 14px;
  margin: 0 !important;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.scm-fe-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 32px 0;
}

.scm-fe-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 179, 1, 0.3);
  color: #cbd5e1 !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s;
}

.scm-fe-page-btn:hover {
  background: rgba(245, 179, 1, 0.15);
  border-color: #f5b301;
  color: #ffffff !important;
}

.scm-fe-page-current {
  background: linear-gradient(135deg, #f5b301 0%, #e8a600 100%);
  color: #0a1a3a !important;
  border-color: #f5b301;
  cursor: default;
}

.scm-fe-page-current:hover {
  color: #0a1a3a !important;
}

.scm-fe-page-ellipsis {
  color: #64748b;
  padding: 0 4px;
}

/* ==========================================================================
   Footer Hint
   ========================================================================== */
.scm-fe-footer-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  margin-top: 24px;
}

.scm-fe-footer-icon {
  color: #f5b301;
  display: inline-flex;
  align-items: center;
}

/* Accessibility */
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablets */
@media screen and (max-width: 900px) {
  .scm-fe-wrapper {
    padding: 40px 16px 60px;
  }

  .scm-fe-card {
    padding: 24px 20px 24px 20px;
  }

  .scm-fe-card-inner {
    grid-template-columns: auto 1fr;
    gap: 20px;
  }

  .scm-fe-card-no-image .scm-fe-card-inner {
    grid-template-columns: 1fr;
  }

  .scm-fe-card-progress-col {
    grid-column: 1 / -1;
    padding-left: 0;
    margin-top: 8px;
  }

  .scm-fe-card-row {
    grid-template-columns: 24px 120px 10px 1fr;
    font-size: 13px;
  }

  .scm-fe-decor {
    width: 100px;
    opacity: 0.35;
  }
}

/* Phones */
@media screen and (max-width: 600px) {
  .scm-fe-wrapper {
    padding: 30px 12px 50px;
  }

  .scm-fe-decor {
    display: none;
  }

  .scm-fe-search-wrap {
    flex-direction: column;
  }

  .scm-fe-search-icon {
    display: none;
  }

  .scm-fe-search-input {
    padding: 14px 16px;
    text-align: center;
  }

  .scm-fe-search-btn {
    padding: 14px 20px;
    justify-content: center;
  }

  .scm-fe-card {
    padding: 20px 16px;
  }

  .scm-fe-card-corner {
    padding: 8px 16px 8px 26px;
    font-size: 10px;
  }

  .scm-fe-card-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }

  .scm-fe-card-image-col {
    justify-content: center;
  }

  .scm-fe-card-image {
    width: 110px;
    height: 130px;
  }

  .scm-fe-card-header {
    justify-content: center;
    text-align: center;
    flex-direction: column;
  }

  .scm-fe-card-row {
    grid-template-columns: 22px 1fr;
    row-gap: 2px;
  }

  .scm-fe-card-row .scm-fe-card-sep {
    display: none;
  }

  .scm-fe-card-value {
    grid-column: 2;
    margin-top: -2px;
  }

  .scm-fe-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
  }

  .scm-fe-progress-ring {
    width: 110px;
    height: 110px;
  }

  .scm-fe-progress-ring svg {
    width: 110px;
    height: 110px;
  }

  .scm-fe-progress-percent {
    font-size: 20px;
  }
}
/* ==========================================================================
   Certified Card (Frontend)
   ========================================================================== */

/* Highlight the whole card slightly when certified */
.scm-fe-card-certified {
  border-color: rgba(245, 179, 1, 0.7) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(245, 179, 1, 0.3) inset !important;
}

/* Certified status badge in info row */
.scm-fe-status-certified {
  background: linear-gradient(135deg, #f5b301 0%, #e8a600 100%) !important;
  color: #0a1a3a !important;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px !important;
  box-shadow: 0 2px 6px rgba(245, 179, 1, 0.35);
}

.scm-fe-badge-icon {
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   Certified Badge (Replaces Progress Ring)
   ========================================================================== */
.scm-fe-certified-badge {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 6px 16px rgba(245, 179, 1, 0.4));
  animation: scm-cert-pulse 2.5s ease-in-out infinite;
}

@keyframes scm-cert-pulse {
  0%,
  100% {
    filter: drop-shadow(0 6px 16px rgba(245, 179, 1, 0.4));
  }
  50% {
    filter: drop-shadow(0 8px 24px rgba(245, 179, 1, 0.7));
  }
}

.scm-fe-certified-badge-ring {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scm-fe-certified-badge-ring svg {
  position: absolute;
  top: 0;
  left: 0;
  animation: scm-cert-rotate 30s linear infinite;
}

@keyframes scm-cert-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.scm-fe-certified-badge-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #0a1a3a;
  line-height: 1;
}

.scm-fe-certified-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.scm-fe-certified-icon svg {
  animation: none !important;
  position: static !important;
}

.scm-fe-certified-word {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #0a1a3a;
}

/* Ribbons (gold ribbons hanging below the badge) */
.scm-fe-certified-ribbon {
  position: absolute;
  bottom: -12px;
  width: 20px;
  height: 30px;
  background: linear-gradient(135deg, #f5b301 0%, #d97706 100%);
  z-index: 1;
}

.scm-fe-certified-ribbon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: #0f2555;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
}

.scm-fe-certified-ribbon-left {
  left: 35px;
  transform: rotate(-8deg);
}

.scm-fe-certified-ribbon-right {
  right: 35px;
  transform: rotate(8deg);
}

/* Mobile adjustments for certified badge */
@media screen and (max-width: 600px) {
  .scm-fe-certified-badge,
  .scm-fe-certified-badge-ring {
    width: 120px;
    height: 120px;
  }

  .scm-fe-certified-badge-ring svg {
    width: 120px;
    height: 120px;
  }

  .scm-fe-certified-word {
    font-size: 12px;
  }

  .scm-fe-certified-icon svg {
    width: 28px;
    height: 28px;
  }

  .scm-fe-certified-ribbon-left {
    left: 30px;
  }

  .scm-fe-certified-ribbon-right {
    right: 30px;
  }
}
