/* =====================================================
   assets/css/main.css (FULL REWRITE - FINAL CLEAN)
   - Keeps your existing design
   - Fixes mobile navbar text (YELLOW)
   - Fixes mobile dropdown/mega menu clipping (push right)
   - Adds scrolling inside long dropdowns on mobile
===================================================== */

/* =====================================================
   GLOBAL
===================================================== */
* { box-sizing: border-box; }

body {
  font-family: 'Open Sans', sans-serif;
  background-color: #F5F7FA;
  color: #333333;
  margin: 0;
  padding-top: 80px; /* space for fixed navbar */
}

/* =====================================================
   NAVBAR (MAIN)
===================================================== */
.custom-navbar { background-color: #1F4E79; }

.custom-navbar .navbar-nav { gap: 0.25rem; }

.custom-navbar .nav-link {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-size: 0.93rem;
  white-space: nowrap;
  font-weight: 600;
}

.custom-navbar .navbar-brand {
  margin-right: 0.75rem;
  white-space: nowrap;
}

.brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

.logo-img {
  height: 36px;
  width: auto;
}

.navbar .nav-link.active { color: #F2C94C !important; }

.subsidiary-badge {
  background-color: #F2C94C;
  color: #1F4E79;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 0.6px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  -webkit-border-radius: 20px;
  -moz-border-radius: 20px;
  -ms-border-radius: 20px;
  -o-border-radius: 20px;
}

.subsidiary-badge span {
  display: block;
}

.subsidiary-badge span:first-child {
  font-size: 0.9rem;
  font-weight: 800;
}

.subsidiary-badge span {
  opacity: 0;
  transform: translateY(5px);
  animation: revealWord 0.5s ease forwards;
}

.subsidiary-badge span:nth-child(1) {
  animation-delay: 0.2s;
}

.subsidiary-badge span:nth-child(2) {
  animation-delay: 0.6s;
}

.subsidiary-badge span:nth-child(3) {
  animation-delay: 1s;
}

@keyframes revealWord {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .custom-navbar .nav-link {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: 0.9rem;
  }
}

/* =====================================================
   MEGA MENU (DESKTOP)
===================================================== */
.dropdown-mega .dropdown-menu.mega-menu {
  width: min(600px, 90vw);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);

  /* Desktop centering */
  left: 50%;
  transform: translateX(-50%);
}

.dropdown-mega .dropdown-menu .row {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.5rem;
}

.mega-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  color: #1F4E79;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dropdown-menu .dropdown-item {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
  line-height: 1.3;
}

.dropdown-menu .dropdown-item:hover {
  background-color: #F5F7FA;
}

.dropdown-mega .dropdown-menu a { white-space: nowrap; }

/* =====================================================
   HOME ACTION BAR (HOME SUB-NAV)
===================================================== */
.home-actionbar {
  background-color: rgba(31, 78, 121, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.home-actionbar .btn {
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
}

/* =====================================================
   HERO (HOME)
===================================================== */
.hero-section {
  min-height: 85vh;
  position: relative;
  display: flex;
  align-items: center;

  background-image:
    linear-gradient(rgba(31,78,121,0.75), rgba(0,0,0,0.45)),
    url("../img/1.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-content { position: relative; z-index: 2; }

/* =====================================================
   PAGE HERO (ALL OTHER PAGES)
   Use:
   <section class="page-hero" style="--page-hero-img:url('../assets/img/hero-services.jpg');">
===================================================== */
.page-hero {
  padding: 90px 0 60px;
  position: relative;
  color: #ffffff;

  /* Default image fallback */
  --page-hero-img: url("../assets/img/2.jpg");

  background-image:
    linear-gradient(rgba(31,78,121,0.78), rgba(0,0,0,0.50)),
    var(--page-hero-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-hero .page-hero-inner { max-width: 900px; }

.page-hero h1,
.page-hero h2 {
  font-family: 'Poppins', sans-serif;
}

/* Breadcrumbs */
.page-hero .breadcrumb {
  --bs-breadcrumb-divider-color: rgba(255,255,255,0.7);
}

.page-hero .breadcrumb a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.page-hero .breadcrumb a:hover { text-decoration: underline; }

/* =====================================================
   CARDS
===================================================== */
.stat-card,
.service-card,
.subject-card,
.mini-card {
  background-color: #FFFFFF;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.service-card,
.subject-card,
.mini-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover,
.subject-card:hover,
.mini-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* Icons color (home 3 steps, etc.) */
.service-card .fa-solid { color: #1F4E79; }

/* =====================================================
   BUTTONS
===================================================== */
.btn-warning {
  background-color: #FFA500;
  border-color: #FFA500;
  color: #1F4E79;
}

.btn-warning:hover {
  background-color: #E69500;
  border-color: #E69500;
  color: #1F4E79;
}

/* Team page image consistency */
.team-photo{
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 3px solid rgba(31,78,121,0.20);
}

.tutor-avatar{
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(31,78,121,0.25);
}
.tutor-avatar.placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(31,78,121,0.08);
  color:#1F4E79;
  font-size: 28px;
}


/* =====================================================
   LINKS (GENERAL - LIGHT BACKGROUNDS)
===================================================== */
.link-darkish {
  color: #1F4E79;
  text-decoration: none;
  font-weight: 600;
}

.link-darkish:hover {
  color: #1F78B4;
  text-decoration: underline;
}

/* =====================================================
   FOOTER
===================================================== */
.footer { background-color: #1F4E79; }

.footer h5 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

.footer-links a,
.footer-link {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover,
.footer-link:hover { text-decoration: underline; }

.footer-social {
  color: #FFFFFF;
  font-size: 1.2rem;
  margin-right: 10px;
  display: inline-block;
}

.footer-social:hover { color: #F2C94C; }

/* =====================================================
   RESPONSIVENESS (GENERAL)
===================================================== */
@media (max-width: 768px) {
  body { padding-top: 90px; }

  .home-actionbar .btn {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .hero-section h1 { font-size: 1.8rem; }
  .page-hero { padding: 70px 0 45px; }
}

/* =====================================================
   MOBILE NAVBAR + SUBNAVBAR (FINAL CLEAN FIX)
   - Yellow main nav text
   - Dark subnavbar background
   - Push dropdown to the right (no clipping)
   - Scroll inside dropdown if long
   - Overrides mega-menu centering on mobile
===================================================== */
@media (max-width: 991.98px){

  /* Collapsed navbar container */
  .custom-navbar .navbar-collapse{
    background: #1F4E79;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
  }

  /* Main nav links (yellow) */
  .custom-navbar .navbar-collapse .nav-link{
    color: #F2C94C !important;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: 10px;
    white-space: normal; /* allow wrap if needed */
  }

  .custom-navbar .navbar-collapse .nav-link:hover,
  .custom-navbar .navbar-collapse .nav-link:focus{
    background: rgba(242,201,76,0.18);
    color: #FFD84D !important;
  }

  /* Dropdown arrow color */
  .custom-navbar .navbar-collapse .dropdown-toggle::after{
    border-top-color: #F2C94C !important;
  }

  /* ✅ Critical: remove mega-menu left:50% translateX(-50%) on mobile */
  .dropdown-mega .dropdown-menu.mega-menu{
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: auto !important;
  }

  /* Dropdown menu becomes stacked block inside collapse */
  .custom-navbar .dropdown-menu{
    position: static !important;
    float: none !important;

    /* Push right + prevent edge clipping */
    margin: 8px 0 12px 12px !important;
    width: calc(100% - 24px) !important;

    padding: 12px !important;
    background: #0F3554 !important;
    border-radius: 12px !important;
    border: 1px solid rgba(242,201,76,0.25) !important;
    box-shadow: none !important;

    /* Scroll for long menus */
    max-height: 62vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Kill Bootstrap row negative margins inside dropdowns */
  .custom-navbar .dropdown-menu .row{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Kill column offsets inside dropdown */
  .custom-navbar .dropdown-menu [class*="col-"]{
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
  }

  /* Mega titles */
  .custom-navbar .dropdown-menu .mega-title{
    color: #F2C94C !important;
    font-weight: 800;
    text-align: center;
    margin: 10px 0 6px !important;
  }

  /* Dropdown items */
  .custom-navbar .dropdown-menu .dropdown-item,
  .custom-navbar .dropdown-menu a{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;

    text-align: center !important;
    color: #F5F7FA !important;

    background: rgba(255,255,255,0.08) !important;
    border-radius: 10px !important;
    padding: 10px 12px !important;
    margin-bottom: 6px !important;
    font-weight: 600 !important;

    white-space: normal !important; /* prevents clipping */
    word-break: break-word;
  }

  .custom-navbar .dropdown-menu .dropdown-item:hover,
  .custom-navbar .dropdown-menu a:hover{
    background: rgba(242,201,76,0.22) !important;
    color: #FFD84D !important;
  }

  /* Mega grid → single column (if you use .mega-grid wrapper) */
  .mega-grid{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}


/* Tutor Jobs UI */
.job-card .job-id{
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: rgba(31,78,121,0.85);
  margin-bottom: 2px;
}

.jit-badge{
  background: rgba(242,201,76,0.22);
  color: #1F4E79;
  border: 1px solid rgba(242,201,76,0.55);
  font-weight: 700;
}

.jit-badge-outline{
  border: 1px solid rgba(242,201,76,0.75);
  color: #1F4E79;
  background: rgba(242,201,76,0.15);
  font-weight: 700;
}


/* Resources: Test Papers UI */
.paper-card .paper-id{
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  color: rgba(31,78,121,0.85);
  margin-bottom: 2px;
}

/* Reuse the same badge styles we used for Jobs */
.jit-badge{
  background: rgba(242,201,76,0.22);
  color: #1F4E79;
  border: 1px solid rgba(242,201,76,0.55);
  font-weight: 700;
}

.jit-badge-outline{
  border: 1px solid rgba(242,201,76,0.75);
  color: #1F4E79;
  background: rgba(242,201,76,0.15);
  font-weight: 700;
}


/* Test Papers: clickable card button */
.paper-card.paper-click{
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.paper-card.paper-click:focus{
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(242,201,76,0.35);
}

/* Modal PDF preview tweaks */
.paper-preview iframe{
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}


/* Resources page cards */
.resource-card .resource-icon{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(31,78,121,0.10);
  color: #1F4E79;
  font-size: 1.1rem;
}


/* =====================================================
   ADMIN PORTAL (append to end of main.css)
===================================================== */
.admin-shell{
  display:flex;
  min-height:100vh;
  background:#F5F7FA;
}

.admin-sidebar{
  width:270px;
  background:#0F3554;
  color:#fff;
  padding:18px 14px;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
}

.admin-brand{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(242,201,76,0.22);
  border-radius: 14px;
  padding: 12px 12px;
  margin-bottom: 14px;
}

.admin-nav{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.admin-nav-title{
  margin: 14px 8px 6px;
  font-size: 0.75rem;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
}

.admin-nav a{
  display:block;
  color:#F5F7FA;
  text-decoration:none;
  padding:10px 10px;
  border-radius: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
}

.admin-nav a:hover{
  background: rgba(242,201,76,0.18);
  border-color: rgba(242,201,76,0.25);
  color:#FFD84D;
}

.admin-nav a.active{
  background: rgba(242,201,76,0.25);
  border-color: rgba(242,201,76,0.35);
  color:#FFD84D;
}

.admin-main{
  flex:1;
  display:flex;
  flex-direction:column;
}

.admin-topbar{
  background:#1F4E79;
  color:#fff;
  padding:12px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  position:sticky;
  top:0;
  z-index:10;
  border-bottom:1px solid rgba(255,255,255,0.15);
}

.admin-content{
  padding:18px;
}

.admin-footer{
  padding:14px 18px;
  border-top:1px solid rgba(0,0,0,0.06);
  background:#fff;
}

@media (max-width: 991.98px){
  .admin-sidebar{ display:none; }
  .admin-content{ padding:14px; }
}




/* =====================================================
   LOGO ANIMATIONS
===================================================== */
@keyframes logoEntrance {
  0%   { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(242, 201, 76, 0)); }
  50%       { filter: drop-shadow(0 0 6px rgba(242, 201, 76, 0.35)); }
}

.logo-anim {
  animation:
    logoEntrance 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    logoPulse 3.5s ease-in-out 1s infinite;
  transition: transform 0.2s ease;
}
.logo-anim--left  { animation-delay: 0s, 1s; }
.logo-anim--right { animation-delay: 0.2s, 1.2s; }

.logo-anim:hover {
  transform: scale(1.1) rotate(4deg);
}

/* =====================================================
   REQUEST A TUTOR BUTTON (NAVBAR)
===================================================== */
.navbar .btn-warning {
  width: fit-content;
  white-space: nowrap;
  padding: 7px 16px;
  line-height: 1.2;
  border-radius: 8px;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.25);
}
.navbar .btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(255, 165, 0, 0.35);
}
.navbar .btn-warning:active {
  transform: scale(0.96) translateY(0);
  box-shadow: none;
}