@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #2563EB; /* Royal Blue */
  --primary-hover: #1D4ED8;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --surface-color: rgba(255, 255, 255, 0.95);
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --border-color: #E5E7EB;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --danger-color: #EF4444;
  --info-color: #3B82F6;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
/* Animated Background Elements */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background-color: #f8fafc;
}

.floating-shape {
  position: absolute;
  filter: blur(80px);
  opacity: 0.5;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out alternate;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: rgba(37, 99, 235, 0.15); /* Royal Blue */
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: rgba(56, 189, 248, 0.15); /* Sky Blue / Cyan */
  bottom: -10%;
  right: -5%;
  animation-delay: -7s;
}

.shape-3 {
  width: 600px;
  height: 600px;
  background: rgba(139, 92, 246, 0.12); /* Soft Violet for contrast */
  top: 30%;
  left: 40%;
  animation-delay: -14s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* Educational Background Icons */
.edu-icon {
  position: absolute;
  color: var(--primary-color);
  opacity: 0.12;
  width: 80px;
  height: 80px;
  animation: float-icon 20s infinite ease-in-out alternate;
  z-index: -1;
}
.icon-1 { top: 20%; left: 8%; animation-delay: 0s; transform: rotate(-15deg); }
.icon-2 { bottom: 15%; left: 12%; animation-delay: -5s; transform: rotate(10deg); width: 100px; height: 100px; }
.icon-3 { top: 25%; right: 10%; animation-delay: -10s; transform: rotate(20deg); width: 90px; height: 90px; }
.icon-4 { bottom: 20%; right: 8%; animation-delay: -15s; transform: rotate(-25deg); width: 110px; height: 110px; }

@keyframes float-icon {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(15deg); }
  100% { transform: translateY(20px) rotate(-15deg); }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography utilities */
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

/* Top Navigation Bar */
.top-navbar {
  background: transparent;
  box-shadow: none;
  padding: 2rem 0 1rem;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: center;
}

.nav-container img {
  max-height: 95px;
  transition: transform 0.3s ease;
}

.nav-container img:hover {
  transform: scale(1.03);
}

.login-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  padding: 10.5rem 1rem 2rem;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}

.login-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.format-box {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
}

.format-box .box-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.format-box .box-line {
  margin-top: 0.25rem;
}

.format-box span {
  font-family: monospace;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-primary {
  width: 100%;
  padding: 0.875rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:active {
  transform: translateY(2px);
}

.notice-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.notice-error::before {
  content: "⚠️";
  font-size: 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .edu-icon {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 8.5rem 1rem 2rem;
  }
  .login-card {
    padding: 1.5rem;
  }
  .nav-container img {
    max-height: 75px;
  }
  .top-navbar {
    padding: 1.5rem 0 0.5rem;
  }
  .format-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .scorecard-paper {
    padding: 1.5rem;
  }
  .candidate-details {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .info-summary {
    grid-template-columns: 1fr;
  }
}

/* Scorecard Page Layout */
.scorecard-wrapper {
  min-height: 100vh;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scorecard-paper {
  background: #ffffff;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  border-top: 6px solid var(--primary-color);
  overflow: hidden;
  position: relative;
}

.scorecard-header {
  padding: 1rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.scorecard-header img {
  max-height: 70px;
  margin-bottom: 0.5rem;
}

.exam-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Candidate Details Grid */
.candidate-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
  background-color: #F9FAFB;
  border-bottom: 1px solid var(--border-color);
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* Percentile Highlight */
.percentile-section {
  padding: 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(to bottom, #ffffff, #f0fdfa);
}

.percentile-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--success-color);
  color: white;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
  border: 6px solid rgba(255,255,255,0.5);
}

.percentile-badge .p-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.percentile-badge .p-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
  opacity: 0.9;
}

/* Marks Table */
.marks-section {
  padding: 2rem;
  overflow-x: auto;
}

.marks-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  min-width: 600px;
}

.marks-table th, 
.marks-table td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.marks-table th:last-child,
.marks-table td:last-child {
  border-right: none;
}

.marks-table tr:last-child th,
.marks-table tr:last-child td {
  border-bottom: none;
}

.marks-table thead {
  background-color: #F3F4F6;
}

.marks-table th {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.marks-table td {
  font-size: 1.1rem;
  font-weight: 500;
}

.marks-table tr:hover td {
  background-color: #F9FAFB;
}

.total-col {
  background-color: #EEF2FF;
  font-weight: 700 !important;
  color: var(--primary-color);
}

/* Info Summary Section */
.info-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1.25rem 2rem;
  background-color: #F9FAFB;
  border-top: 1px solid var(--border-color);
}

.info-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.info-card h5 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.info-card p {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1rem;
}

/* Scholarship Status */
.scholarship-status {
  padding: 1.5rem 2rem;
  text-align: center;
  font-weight: 600;
  font-size: 1.25rem;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.status-eligible {
  color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.1);
}

.status-ineligible {
  color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.1);
}

.status-default {
  color: var(--info-color);
  background-color: rgba(59, 130, 246, 0.1);
}

/* Instruction Messages */
.message-box {
  padding: 2rem;
  font-size: 0.95rem;
  color: #374151;
  background: #ffffff;
  border-radius: 0 0 16px 16px;
}

.message-box strong {
  color: var(--warning-color);
}

/* Print Styles */
.print-action {
  text-align: center;
  margin: 2rem 0;
}

.btn-print {
  background-color: var(--text-dark);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background-color: #000;
  transform: translateY(-2px);
}

@media print {
  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .bg-animation, .edu-icon, .top-navbar, .print-action {
    display: none !important;
  }
  .scorecard-wrapper {
    padding: 0;
    margin: 0;
    min-height: auto;
  }
  .scorecard-paper {
    box-shadow: none;
    border: none;
    border-top: 4px solid var(--primary-color);
    padding: 0;
    max-width: 100%;
    margin: 0;
  }
  .scorecard-header {
    margin-bottom: 0.5rem;
    padding: 1rem 1rem 0.5rem;
  }
  .scorecard-header img {
    max-height: 55px;
    margin-bottom: 0.5rem;
  }
  .exam-title {
    font-size: 1rem;
  }
  .candidate-details {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    gap: 0.5rem;
  }
  .detail-label {
    font-size: 0.75rem;
  }
  .detail-value {
    font-size: 0.95rem;
  }
  .percentile-section {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: transparent;
  }
  .percentile-badge {
    padding: 0.5rem 2rem;
    box-shadow: none;
    border: 1px solid var(--border-color);
    color: black;
    background: transparent;
  }
  .percentile-badge .p-value {
    font-size: 1.5rem;
  }
  .marks-section {
    margin-bottom: 0.5rem;
  }
  .marks-table th, .marks-table td {
    padding: 0.25rem;
    font-size: 0.75rem;
  }
  .scholarship-status {
    padding: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
  }
  .info-summary {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: transparent;
    border-top: 1px solid var(--border-color);
  }
  .info-card {
    flex: 1;
    padding: 0.25rem;
    text-align: center;
    border: none;
  }
  .info-card h5 {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
  }
  .info-card p {
    font-size: 0.8rem;
    font-weight: bold;
  }
  .message-box {
    padding: 0.5rem;
    font-size: 0.7rem;
    line-height: 1.2;
    margin-bottom: 0;
  }
  .message-box .mt-4 {
    margin-top: 0.25rem;
  }
}
