/* Modern CSS with Glassmorphism and variables */
:root {
  --primary: #1a237e;
  --primary-hover: #283593;
  --secondary: #00897b;
  --secondary-hover: #00695c;
  --accent: #f50057;
  --background: #f4f7f6;
  --text: #333333;
  --card-bg: rgba(255, 255, 255, 0.85);
  --border: #e0e0e0;
  --danger: #d32f2f;
  --success: #2e7d32;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Anek Gujarati', 'Inter', sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background animated shapes */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
}
.shape1 { width: 400px; height: 400px; background: #ffeb3b; top: -100px; right: -100px; animation: float 10s ease-in-out infinite; }
.shape2 { width: 300px; height: 300px; background: #03a9f4; bottom: -50px; left: -50px; animation: float 12s ease-in-out infinite reverse; }

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(30px, 50px) rotate(10deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Base Classes */
.container { max-width: 1500px; width: 95%; margin: 0 auto; padding: 20px; }
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

/* Typography */
.main-title { font-size: 28px; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: 5px; }
.subtitle { font-size: 16px; color: #666; text-align: center; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 700; color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 20px; }
.section-divider { background: #e0f7fa; padding: 10px; border-radius: 8px; font-size: 16px; font-weight: bold; color: var(--secondary); margin: 20px 0 10px 0; }
.gradient-text { background: linear-gradient(90deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.text-sm { font-size: 14px; color: #555; }

/* Buttons */
button { cursor: pointer; border: none; font-weight: 600; font-family: inherit; transition: all 0.2s ease; border-radius: 8px; }
.primary-btn { background: var(--primary); color: white; padding: 12px 20px; box-shadow: 0 4px 10px rgba(26, 35, 126, 0.3); }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.secondary-btn { background: var(--secondary); color: white; padding: 12px 20px; box-shadow: 0 4px 10px rgba(0, 137, 123, 0.3); }
.secondary-btn:hover { background: var(--secondary-hover); transform: translateY(-2px); }
.success-btn { background: var(--success); color: white; padding: 12px 20px; box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3); }
.success-btn:hover { background: #1b5e20; transform: translateY(-2px); }
.danger-btn { background: var(--danger); color: white; padding: 8px 16px; font-size: 14px; }
.ghost-btn { background: transparent; border: 2px solid var(--secondary); color: var(--secondary); padding: 10px; }
.ghost-btn:hover { background: var(--secondary); color: white; }

.micro-btn { background: #ff9800; color: white; font-size: 11px; padding: 3px 6px; border-radius: 4px; float: right; margin-top: 2px; }
.micro-btn:hover { background: #f57c00; }

.w-full { width: 100%; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }

/* Forms */
.input-group { margin-bottom: 15px; display: flex; flex-direction: column; text-align: left;}
.input-group label { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #444; }
.input-group input, .input-group select { padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; background: rgba(255,255,255,0.9); outline: none; transition: border 0.3s; }
.input-group input:focus, .input-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1); }
.file-input { border: 2px dashed var(--secondary); padding: 20px; text-align: center; background: #f0fdfa; border-radius: 8px; cursor: pointer; }

/* Layouts */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-3-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }

/* Dashboard Specific */
.dashboard-header { display: none; } /* REPLACED BY TOP NAVBAR */
.badge { background: #e0e0e0; color: #555; padding: 4px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.action-card { text-align: center; transition: transform 0.3s ease; display: flex; flex-direction: column; height: 100%; justify-content: space-between; }
.action-card p { flex-grow: 1; margin-bottom: 10px;}
.action-card:hover { transform: translateY(-5px); }
.action-card .icon { font-size: 40px; margin-bottom: 15px; }

/* ========================================================
   DASHBOARD SIDEBAR & NAVBAR LAYOUT
   ======================================================== */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 15px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 50;
  border-radius: 0 0 16px 16px;
  margin-bottom: 20px;
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.nav-left .gradient-text { margin-bottom: 0; font-size: 22px; }
.menu-toggle { display: none; background: transparent; color: var(--primary); font-size: 24px; padding: 5px; }

.dashboard-layout { display: flex; align-items: flex-start; gap: 20px; position: relative; }

.sidebar {
  width: 260px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  height: calc(100vh - 120px);
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 25px 20px;
  background: #021a36;
  text-align: left;
  flex-shrink: 0;
}

.brand-title {
  color: white;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 5px;
}

.brand-subtitle {
  color: #6a8caf;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-menu {
  list-style: none;
  padding: 15px;
  margin: 0;
  overflow-y: auto;
  flex-grow: 1;
}

.sidebar-menu::-webkit-scrollbar { width: 5px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: #ccc; border-radius: 5px; }

.sidebar-menu li {
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.7);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.sidebar-menu li:hover {
  background: var(--primary);
  color: white;
  transform: translateX(5px);
}

.dashboard-main-content {
  flex: 1;
  width: 100%;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 80;
}

@media screen and (max-width: 900px) {
  .dashboard-layout { flex-direction: column; }
  .menu-toggle { display: block; }
  .top-navbar { border-radius: 0; top: 0; padding: 12px 15px;}
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    border-radius: 0;
    z-index: 90;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
}

/* Views Toggle */
.view { display: none; margin: 40px auto; max-width: 800px; animation: fadeIn 0.4s ease-out; }
.view.active-view { display: block; }
#authView { max-width: 400px; text-align: center;}
.icon-header { font-size: 50px; margin-bottom: 10px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Modals */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 100; backdrop-filter: blur(4px); overflow-y: auto; }
.modal-content { margin: 5% auto; width: 90%; max-width: 700px; position: relative; animation: slideDown 0.3s ease; }
.close-btn { position: absolute; right: 20px; top: 15px; font-size: 28px; cursor: pointer; color: #888; transition: color 0.2s; }
.close-btn:hover { color: var(--danger); }
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-child { z-index: 200 !important; }

/* Auth Tabs */
.tabs { display: flex; margin-bottom: 20px; border-radius: 8px; overflow: hidden; background: #e0e0e0; }
.tab-btn { flex: 1; padding: 12px; background: transparent; color: #666; border-radius: 0; }
.tab-btn.active { background: var(--primary); color: white; }

/* Toast Notification */
.toast { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 12px 24px; border-radius: 30px; font-weight: 600; transition: bottom 0.4s ease; z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.toast.show { bottom: 30px; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }


/* ========================================================
   A4 LC TEMPLATE EXACT MATCH CSS 
   ======================================================== */
.lc-a4-page {
  /* A4 Dimensions at 96 DPI: width: 794px, height: 1123px */
  width: 794px;
  height: 1123px;
  background-color: #f7ede2; /* Base soft background like certificate */
  padding: 10px;
  box-sizing: border-box;
  font-family: inherit;
}

.lc-border {
  border: 3px solid #0970a7; /* Deep Blue border */
  height: 100%;
  padding: 15px;
  background: white;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.lc-header {
  text-align: center;
  color: #0970a7;
  margin-bottom: 10px;
}
.school-name-en { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: #0970a7; }
.school-name-gu { font-size: 30px; font-weight: 800; color: #fa8a10; margin-top: 5px; }

.lc-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.gr-box {
  border: 1px solid #7bcec6;
  background: #f4faf9;
  padding: 5px 15px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
  color: #0970a7;
}

.cert-title {
  background-color: #0970a7; /* Deep Blue */
  color: white;
  padding: 10px 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}
.cert-title .eng-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.cert-title .guj-title { font-size: 16px; border-top: 1px solid rgba(255,255,255,0.3); margin-top: 3px; padding-top: 3px; }

.lc-footer {
  margin-top: auto;
  text-align: center;
}
.certify-text { font-size: 12px; font-weight: 700; margin-bottom: 50px; color: #333; }
.signs { display: flex; justify-content: space-between; padding: 0 40px; margin-bottom: 10px; }
.sign-block { font-weight: 700; border-top: 1px dashed #333; padding-top: 5px; width: 220px; font-size: 14px; }
.warning-text-footer { font-size: 10px; font-weight: 700; color: #c0392b; border-top: 1px solid #ccc; padding-top: 5px; margin-top: 5px; }

/* Table Rows for Form */
.lc-form { margin-top: 5px; }
.row-flex {
  display: flex;
  margin-bottom: 2px;
  font-size: 11px;
  align-items: stretch;
}
.col-lbl {
  width: 40%;
  background-color: rgba(123, 206, 198, 0.25); /* Aqua pastel mix */
  padding: 3px 6px;
  font-weight: 700;
  border: 1px solid #7bcec6;
  color: #0970a7;
  display: flex;
  align-items: center;
}
.col-val {
  width: 60%;
  background-color: #ffffff; /* White input */
  padding: 3px 6px;
  border: 1px solid #7bcec6;
  border-left: none;
  font-weight: 600;
  color: #2eae8f;
  display: flex;
  align-items: center;
}
.val-text { color: #0970a7; font-size: 15px; }

/* Action Icon Buttons for Register Table */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 16px;
  border: 1px solid #e0e0e0;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 2px;
}
.action-icon-btn:hover { transform: scale(1.15); }
.action-icon-btn.edit-btn:hover { background: #e3f2fd; border-color: #2196f3; }
.action-icon-btn.download-btn:hover { background: #e8f5e9; border-color: #4caf50; }
.action-icon-btn.delete-btn:hover { background: #ffebee; border-color: #f44336; }

.action-icon-btn.eng-edit-btn:hover { background: #fff3e0; border-color: #ff9800; }

/* Button Spinner State */
.btn-spinner {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media screen and (max-width: 600px) {
  .grid-2-col, .grid-3-col { grid-template-columns: 1fr; }
}

/* ============================================
   MOBILE RESPONSIVE � Card Layout & Full-Screen
   ============================================ */
@media screen and (max-width: 768px) {

  /* --- Full-Screen Modals --- */
  .modal-content {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
    border-radius: 0 !important;
    padding: 16px !important;
  }
  .modal { padding: 0 !important; }
  .close-btn {
    right: 12px !important;
    top: 8px !important;
    font-size: 32px !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
  }

  /* --- Sticky Action Bar in Modals --- */
  .modal-action-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    padding: 8px 0 12px 0;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-bottom: 1px solid #e0e0e0;
  }

  /* --- Table ? Card Layout --- */
  .register-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  .register-table thead {
    display: none !important;
  }
  .register-table tbody tr {
    display: block !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 14px !important;
    margin-bottom: 12px !important;
    padding: 14px 16px !important;
    background: linear-gradient(135deg, #fafbfc 0%, #f0f4f8 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
    border-bottom: none !important;
  }
  .register-table tbody tr:active {
    transform: scale(0.99);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
  }
  .register-table tbody td {
    display: flex !important;
    align-items: center !important;
    text-align: left !important;
    padding: 3px 0 !important;
    border-bottom: none !important;
    font-size: 14px !important;
    white-space: normal !important;
  }
  /* Add labels before content via CSS */
  .register-table tbody td::before {
    font-weight: 700;
    color: #888;
    font-size: 12px;
    min-width: 85px;
    flex-shrink: 0;
  }

  /* LC Register labels */
  #listTableBody tr td:nth-child(1)::before { content: "????: "; }
  #listTableBody tr td:nth-child(2)::before { content: "GR No: "; }
  #listTableBody tr td:nth-child(3) { font-size: 15px !important; font-weight: 700 !important; }
  #listTableBody tr td:nth-child(3)::before { content: ""; min-width: 0 !important; }
  #listTableBody tr td:nth-child(4)::before { content: "????: "; }
  #listTableBody tr td:nth-child(5)::before { content: "?????? ??.: "; }
  #listTableBody tr td:nth-child(6)::before { content: ""; min-width: 0 !important; }

  /* Balvatika Register labels */
  #balListTableBody tr td:nth-child(1)::before { content: "????: "; }
  #balListTableBody tr td:nth-child(2)::before { content: "????? ??: "; }
  #balListTableBody tr td:nth-child(3) { font-size: 15px !important; font-weight: 700 !important; }
  #balListTableBody tr td:nth-child(3)::before { content: ""; min-width: 0 !important; }
  #balListTableBody tr td:nth-child(4)::before { content: "???? ??.: "; }
  #balListTableBody tr td:nth-child(5)::before { content: ""; min-width: 0 !important; }

  /* Std1 Register labels */
  #std1ListTableBody tr td:nth-child(1)::before { content: "????: "; }
  #std1ListTableBody tr td:nth-child(2)::before { content: "????? ??: "; }
  #std1ListTableBody tr td:nth-child(3) { font-size: 15px !important; font-weight: 700 !important; }
  #std1ListTableBody tr td:nth-child(3)::before { content: ""; min-width: 0 !important; }
  #std1ListTableBody tr td:nth-child(4)::before { content: "???? ??.: "; }
  #std1ListTableBody tr td:nth-child(5)::before { content: ""; min-width: 0 !important; }

  /* Action buttons row in cards */
  .register-table tbody td:last-child {
    display: flex !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    margin-top: 10px !important;
    padding-top: 12px !important;
    border-top: 1px solid #e0e0e0 !important;
    flex-wrap: wrap !important;
  }

  /* Larger touch-friendly action buttons */
  .action-icon-btn {
    width: 42px !important;
    height: 42px !important;
    font-size: 18px !important;
    border-radius: 10px !important;
  }

  /* --- Modal Top Button Bar --- */
  .modal-content h2 {
    font-size: 18px !important;
    padding-right: 40px;
  }
  .modal-content .primary-btn,
  .modal-content .secondary-btn,
  .modal-content .success-btn,
  .modal-content .ghost-btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
    min-width: auto !important;
    max-width: none !important;
    flex: 1 1 calc(50% - 8px) !important;
  }

  /* --- Forms inside modals --- */
  .grid-2-col { grid-template-columns: 1fr !important; }
  .input-group input, .input-group select {
    font-size: 16px !important;
    padding: 14px !important;
  }
  .input-group label { font-size: 13px !important; }

  /* --- Dashboard Cards --- */
  .grid-3-col { grid-template-columns: 1fr !important; }
  .dashboard-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .main-title { font-size: 22px !important; }

  /* --- General Mobile Spacing --- */
  .container { padding: 10px !important; width: 100% !important; }
  .glass-card { padding: 16px !important; }
}

    /* Absolute overrides to bypass browser caching of style.css on file:// protocol */
    #lcTemplate { font-size: 11.5px !important; }
    .lc-border { border: 3px solid #0970a7 !important; padding: 10px 15px !important; }
    .lc-header { color: #0970a7 !important; margin-bottom: 5px !important; }
    .school-name-en { color: #0970a7 !important; }
    .school-name-gu { color: #fa8a10 !important; }
    .lc-sub-header { margin-bottom: 3px !important; }
    .cert-title { background-color: #0970a7 !important; padding: 4px 20px !important; }
    .gr-box { border: 1px solid #7bcec6 !important; background: #f4faf9 !important; color: #0970a7 !important; }
    .row-flex { margin-bottom: 1px !important; }
    .col-lbl { background-color: rgba(123, 206, 198, 0.25) !important; border: 1px solid #7bcec6 !important; color: #0970a7 !important; padding: 2px 4px !important; }
    .col-val { background-color: #ffffff !important; border: 1px solid #7bcec6 !important; border-left: none !important; color: #2eae8f !important; padding: 2px 4px !important; }
    .val-text { color: #0970a7 !important; }
  


    .pill-page { color: #000; background: #fffaf0; width: 210mm; height: 297mm; padding: 5mm; box-sizing: border-box; font-family: 'Anek Gujarati', sans-serif; }
    .pill-page-border { border: 10px solid #d4a373; height: 100%; padding: 6mm; box-sizing: border-box; display: flex; flex-direction: column; }
    .pill-page-content { flex: 1; }
    .pill-page-footer { margin-top: auto; }
    .pill-header-box { display: flex; justify-content: center; margin-bottom: 5px; }
    .pill-school-title { border: 2px solid blue; border-radius: 30px; padding: 5px 25px; color: red; font-size: 20px; font-weight: 800; background: #fffde7; text-align: center; width: 90%; }
    .pill-main-title { text-align: center; color: blue; font-size: 16px; font-weight: 800; margin: 8px 0 2px 0; }
    .pill-sub-title { text-align: center; color: #000; font-size: 12px; font-weight: bold; margin-bottom: 12px; text-transform: uppercase;}
    .pill-row { display: flex; align-items: stretch; margin-bottom: 5px; gap: 8px; }
    .pill-label { border: 1px solid blue; border-radius: 20px; padding: 3px 15px; font-size: 12px; font-weight: bold; color: #000; display: flex; align-items: center; white-space: nowrap; background: #fff; }
    .pill-value { border: 1px solid blue; border-radius: 20px; padding: 3px 15px; font-size: 12px; font-weight: bold; color: blue; flex-grow: 1; display:flex; align-items:center; background: #fff; }
    
    .pill-dec-title { text-align: center; color: red; font-size: 20px; font-weight: 800; margin: 20px 0 20px 0; }
    .pill-dec-text { font-size: 15px; line-height: 2.3; text-align: justify; font-weight: bold; padding: 0 10px; }
    .pill-ul { border-bottom: 1px solid #777; padding: 0 5px; color: blue; font-weight: bold;}
    
    .lbl-w1 { width: 300px; }
    .lbl-w2a { width: 140px; }
    .lbl-w2b { width: 152px; }
  



