/* ==========================================================================
   GAUTAM BUDDHA UNIVERSITY - UGC CAS PROMOTION FORM
   Light Fresh Official University Blue Design System & UI
   ========================================================================== */

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

:root {
  --gbu-deep-blue: #003366;
  --gbu-primary-blue: #004b8d;
  --gbu-vibrant-blue: #0284c7;
  --gbu-light-blue: #e0f2fe;
  --gbu-sky-bg: #f0f6ff;
  --bg-main: #f4f7fc;
  --surface-card: #ffffff;
  --text-dark: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-focus: #0284c7;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(2, 132, 199, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 51, 102, 0.12), 0 8px 10px -6px rgba(0, 51, 102, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
}

/* App Header */
.app-header {
  background: linear-gradient(135deg, #002244 0%, #004b8d 100%);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid #2563eb;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gbu-header-logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  background: #ffffff;
  padding: 3px;
  border-radius: 50%;
}

.brand-titles h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-titles p {
  font-size: 0.8rem;
  color: #bae6fd;
  font-weight: 500;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.9rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  height: 38px;
  min-height: 38px;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-gold {
  background: #f59e0b;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-secondary:hover {
  background: #bae6fd;
  color: var(--gbu-deep-blue);
}

.header-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.header-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.btn-add-row {
  background: #f0f9ff;
  color: var(--gbu-deep-blue);
  border: 1.5px dashed var(--gbu-vibrant-blue);
  padding: 0.5rem 1.1rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  margin-top: 0.5rem;
  min-height: 40px;
}

.btn-add-row:hover {
  background: var(--gbu-vibrant-blue);
  color: #ffffff;
  border-style: solid;
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--gbu-vibrant-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  min-height: 36px;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  min-height: 36px;
}

/* Main Body Layout */
.app-body {
  max-width: 1350px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* Wizard Tracker Card */
.wizard-progress-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  border-top: 4px solid #2563eb;
  margin-bottom: 1.5rem;
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.wizard-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 115px;
  cursor: pointer;
  text-align: center;
}

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  transition: var(--transition);
  border: 2px solid transparent;
}

.step-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.wizard-step-item.active .step-bubble {
  background: #2563eb;
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.wizard-step-item.active .step-label {
  color: #002244;
  font-weight: 700;
}

.wizard-step-item.completed .step-bubble {
  background: #10b981;
  color: #ffffff;
}

.wizard-step-item.completed .step-label {
  color: #059669;
}

/* Form Container Card */
.form-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.step-panel {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.step-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  border-bottom: 2px solid var(--gbu-sky-bg);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  color: var(--gbu-deep-blue);
}

.section-header p {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.sub-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gbu-primary-blue);
  background: var(--gbu-sky-bg);
  padding: 0.5rem 0.85rem;
  border-left: 4px solid var(--gbu-vibrant-blue);
  border-radius: 4px;
  margin: 1.5rem 0 0.75rem 0;
}

/* Form Controls & Flex Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.col-12 {
  grid-column: span 12;
}

.col-8 {
  grid-column: span 8;
}

.col-6 {
  grid-column: span 6;
}

.col-4 {
  grid-column: span 4;
}

.col-3 {
  grid-column: span 3;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group label .required {
  color: #ef4444;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1.5px solid #dbeafe;
  border-radius: 8px;
  background-color: #eef2ff;
  color: #1e293b;
  transition: var(--transition);
  min-height: 42px;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15);
}

.form-control[readonly] {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

textarea.form-control {
  min-height: 75px;
  resize: vertical;
}

/* Hybrid Flexible Date Input Picker */
.date-picker-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.date-picker-group input[type="text"] {
  flex-grow: 1;
}

.date-picker-group input[type="date"] {
  width: 42px;
  height: 42px;
  padding: 0.4rem;
  cursor: pointer;
}

/* Dynamic Tables */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  background: #ffffff;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 600px;
}

.custom-table th {
  background: #f0f6ff;
  color: #002244;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

.custom-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  vertical-align: top;
}

.custom-table td input,
.custom-table td select,
.custom-table td textarea {
  width: 100%;
  padding: 0.55rem 0.6rem;
  font-size: 0.85rem;
  border: 1.5px solid #dbeafe;
  border-radius: 6px;
  background-color: #eef2ff;
  color: #1e293b;
  min-height: 38px;
}

.custom-table td input:focus,
.custom-table td select:focus,
.custom-table td textarea:focus {
  background-color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* Footer Navigation */
.wizard-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

/* Preview Toolbar & Container */
#preview-container {
  display: none;
  background: #1e293b;
  padding: 2rem 1rem;
  min-height: 100vh;
}

.preview-toolbar {
  max-width: 900px;
  margin: 0 auto 1.5rem auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gbu-deep-blue);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.toast {
  background: var(--gbu-deep-blue);
  color: white;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  border-left: 4px solid #f59e0b;
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (SMARTPHONE OPTIMIZATION)
   ========================================================================== */

@media (max-width: 768px) {

  /* Prevent iOS automatic zoom when focusing inputs */
  .form-control,
  .custom-table td input,
  .custom-table td select,
  .custom-table td textarea {
    font-size: 16px !important;
  }

  .app-header {
    padding: 0.85rem 1rem;
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .brand-wrapper {
    gap: 0.75rem;
  }

  .gbu-header-logo {
    height: 46px;
  }

  .brand-titles h1 {
    font-size: 1.1rem;
  }

  .brand-titles p {
    font-size: 0.75rem;
  }

  .header-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .header-actions .btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
  }

  .app-body {
    padding: 0 0.75rem;
    margin: 1rem auto;
  }

  .wizard-progress-card {
    padding: 0.85rem 0.75rem;
  }

  .wizard-step-item {
    min-width: 90px;
  }

  .step-bubble {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .step-label {
    font-size: 0.7rem;
  }

  .form-card {
    padding: 1.15rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .col-12,
  .col-8,
  .col-6,
  .col-4,
  .col-3 {
    grid-column: span 12;
  }

  .section-header h2 {
    font-size: 1.15rem;
  }

  .sub-section-title {
    font-size: 0.875rem;
    padding: 0.4rem 0.65rem;
  }

  /* Table Touch Hint Indicator */
  .table-wrapper {
    position: relative;
  }

  .table-wrapper::after {
    content: '👉 Swipe left to view table fields';
    display: block;
    font-size: 0.725rem;
    color: var(--gbu-vibrant-blue);
    background: #f0f9ff;
    text-align: right;
    padding: 2px 8px;
    font-weight: 600;
  }

  .wizard-footer-nav {
    padding: 0.85rem 1rem;
    position: sticky;
    bottom: 0;
    z-index: 90;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  }

  .preview-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

/* Auth Modal Animations & Enhancements */
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-tab-item.active {
  color: #1d4ed8 !important;
  border-bottom: 3px solid #1d4ed8 !important;
  background: #ffffff !important;
}

.auth-tab-item:hover:not(.active) {
  background: #e2e8f0 !important;
}

.gbu-auth-input:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}