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

:root {
  --brand-blue: #2563eb;
  --brand-dark: #1e3a8a;
  --brand-navy: #0f172a;
  --brand-accent: #3b82f6;
  --brand-light: #eff6ff;
  --bg-gradient: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-card: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 15px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 25px 50px -12px rgba(37, 99, 235, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px 10px;
}

/* Outer Card Container */
.bg {
  max-width: 1140px;
  margin: 0 auto;
  background: var(--card-bg);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  min-height: 90vh;
}

/* Header - Clean White Surface for perfect Logo legibility */
.top-accent-line {
  height: 5px;
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #06b6d4 100%);
}

.college-header {
  background: #ffffff;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-logo img {
  max-height: 75px;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}

.header-logo img:hover {
  transform: scale(1.01);
}

.header-contact {
  text-align: right;
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
  background: #f8fafc;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.header-contact strong {
  color: var(--brand-dark);
  font-weight: 700;
}

/* Navigation bar */
.top-nav {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1e40af 100%);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
}

.nav-user {
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user strong {
  color: #ffffff;
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  background: #ffffff;
  color: var(--brand-dark);
}

.nav-logout {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-logout:hover {
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Fee Receipts Table & Status Badges */
.badge-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-paid {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.btn-print-receipt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1d4ed8 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-print-receipt:hover {
  background: #1e40af;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.35);
  transform: translateY(-1px);
}

/* Content Container */
#content {
  padding: 40px 28px;
  flex: 1;
  background: #ffffff;
}

/* Modern Login Card */
.login-wrapper {
  max-width: 440px;
  margin: 20px auto 40px auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.3s ease;
}

.login-wrapper:hover {
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.login-card-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-blue) 100%);
  color: #ffffff;
  padding: 20px 24px;
  text-align: center;
}

.login-card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.login-card-header p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 3px;
}

.login-card-body {
  padding: 32px 28px;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-main);
  background-color: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  background-color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1d4ed8 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.25 ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* Alert Box */
.alert-danger {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

/* Profile Section Styling */
.profile-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-hero-icon {
  width: 60px;
  height: 60px;
  background: var(--brand-blue);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.profile-hero-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
}

.profile-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pill-badge {
  background: #ffffff;
  color: #1e40af;
  border: 1px solid #93c5fd;
  padding: 3px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
}

/* Profile Grid Cards */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 24px;
}

@media (max-width: 500px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.profile-card-header {
  background: #f8fafc;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
}

.profile-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.profile-table tr:last-child {
  border-bottom: none;
}

.profile-table td {
  padding: 12px 20px;
  font-size: 13.5px;
}

.profile-table td.field-name {
  width: 38%;
  font-weight: 600;
  color: #475569;
  background-color: #fafafa;
}

.profile-table td.field-value {
  color: #0f172a;
  font-weight: 500;
}

/* Attendance Module Styles */
.attendance-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 4px;
}

.stat-card .stat-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-present {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.badge-absent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.attendance-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.date-selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-selector-group label {
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 14px;
}

.date-input {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
  outline: none;
  transition: border-color 0.2s ease;
}

.date-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-today {
  background: var(--brand-blue);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-today:hover {
  background: var(--brand-dark);
}

/* 2-Column Attendance Layout */
.attendance-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .attendance-layout {
    grid-template-columns: 1fr;
  }
}

/* Custom Visual Calendar Component */
.custom-calendar-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  padding: 20px;
  font-family: inherit;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cal-month-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-dark);
  min-width: 100px;
  text-align: center;
}

.cal-nav-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.cal-nav-btn:hover {
  background: #f1f5f9;
  color: var(--brand-dark);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 0;
  margin-bottom: 12px;
}

.cal-weekday {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.cal-date-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.cal-date-cell:hover:not(.other-month) {
  background: #eff6ff;
  color: var(--brand-blue);
}

.cal-date-cell.other-month {
  color: #cbd5e1;
  cursor: default;
}

.cal-date-cell.active-date {
  background: #9333ea !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.35);
}

.cal-date-cell.today-date:not(.active-date) {
  border: 2px solid #9333ea;
  color: #9333ea;
  font-weight: 700;
}

.cal-footer {
  border-top: 1px solid #f1f5f9;
  margin-top: 18px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.cal-footer-today-str {
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.cal-green-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}

.btn-go-today {
  color: #9333ea;
  background: none;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

.btn-go-today:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Events & Holidays Cards Styling */
.events-grid, .holidays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.event-card, .holiday-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover, .holiday-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
}

.card-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
  width: fit-content;
}

.holiday-date-badge {
  background: #fef3c7;
  color: #b45309;
}

.event-card-title, .holiday-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 10px;
  line-height: 1.4;
}

.event-card-details, .holiday-card-details {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.btn-show-attachment {
  background: var(--brand-blue);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
  width: 100%;
}

.btn-show-attachment:hover {
  background: var(--brand-dark);
}

/* Modal Popup Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 15px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-custom {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-custom {
  font-weight: 700;
  font-size: 16px;
  color: var(--brand-dark);
}

.btn-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.btn-modal-close:hover {
  color: #ef4444;
}

.modal-body-custom {
  padding: 15px;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 400px;
  background: #f1f5f9;
}

.modal-footer-custom {
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-modal-download {
  background: #16a34a;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.btn-modal-download:hover {
  background: #15803d;
}

/* Footer */
.college-footer {
  background: var(--brand-dark);
  color: #cbd5e1;
  text-align: center;
  padding: 16px 20px;
  font-size: 13px;
  margin-top: auto;
}

.college-footer a {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: none;
}

.college-footer a:hover {
  text-decoration: underline;
}

/* Comprehensive Mobile & Tablet Responsive Media Queries */
@media (max-width: 768px) {
  body {
    padding: 10px 6px;
  }

  .bg {
    border-radius: 12px;
    min-height: 100vh;
  }

  .college-header {
    padding: 14px 16px;
  }

  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .header-logo img {
    max-height: 60px;
    margin: 0 auto;
  }

  .header-contact {
    text-align: center;
    font-size: 12px;
    padding: 8px 14px;
    width: 100%;
  }

  .top-nav {
    flex-direction: column;
    padding: 12px 14px;
    gap: 10px;
    text-align: center;
  }

  .nav-user {
    justify-content: center;
    font-size: 13.5px;
    width: 100%;
  }

  .nav-right {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  .nav-link {
    font-size: 12.5px;
    padding: 5px 11px;
  }

  .profile-container {
    padding: 16px 10px !important;
  }

  .profile-hero {
    padding: 20px 14px !important;
  }

  .profile-avatar-circle {
    width: 60px !important;
    height: 60px !important;
    font-size: 24px !important;
  }

  .profile-name-title {
    font-size: 20px !important;
  }

  .profile-meta-chips {
    gap: 6px !important;
  }

  .meta-chip {
    font-size: 12px !important;
    padding: 4px 10px !important;
  }

  .events-grid, .holidays-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .event-card, .holiday-card {
    padding: 16px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-box {
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal-body-custom {
    padding: 10px;
    min-height: 350px;
  }

  .modal-body-custom iframe {
    height: 380px !important;
  }

  .fee-table-container, table {
    font-size: 13px;
  }

  th, td {
    padding: 10px 8px !important;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
  }

  .nav-link {
    text-align: center;
    width: 100%;
  }
}

/* Special Notice Pulsing / Blinking Badge & Cards */
.notice-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ef4444;
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  animation: pulseBlink 1.2s infinite ease-in-out;
  margin-left: 6px;
  vertical-align: middle;
}

@keyframes pulseBlink {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.notice-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.notice-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}

.notice-tag-sem {
  background: #e0e7ff;
  color: #3730a3;
}

.notice-tag-session {
  background: #fef3c7;
  color: #92400e;
}
