/*==================================================
    UO TECH - RESPONSIVE STYLES
    responsive.css
==================================================*/

/* Brand logo responsive sizing */
@media (max-width: 768px) {
  .brand img.logo-light,
  .brand img.logo-dark {
    height: 36px;
  }
}

/* Double CTA mobile stacking */
@media (max-width: 600px) {
  .cta-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 16px;
  }
  .gold-btn-arrow, .outline-btn-arrow {
    width: 100%;
    justify-content: center;
  }
}

/* Course list item overrides (Subpages) */
@media (max-width: 780px) {
  .course-item {
    flex-direction: column;
  }
  .course-thumb {
    width: 100%;
    height: auto;
  }
}

/* --- MAIN RESPONSIVE OVERRIDES --- */

@media (max-width: 1200px) {
  .hero .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    padding-top: 150px;
    /* Clear absolute header on tablet */
    padding-bottom: 40px;
  }

  .hero {
    min-height: auto;
    height: auto;
  }

  .intro {
    max-width: 100%;
  }

  .hero-btns {
    justify-content: center;
  }

  .guide {
    justify-self: center;
  }

  .hero-stat {
    grid-column: 1;
    margin-top: 20px;
  }

  .about-top-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-grid-navy {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 24px;
  }

  .navy-col:not(:last-child)::after {
    display: none;
  }

  .orange-help-banner {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .help-text {
    justify-content: center;
  }

  .help-btns {
    width: 100%;
    justify-content: center;
  }

  .journey-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .journey-flow {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 40px;
    gap: 30px;
    margin-top: 30px;
  }

  .journey-flow::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 24px;
    width: 2px;
    background-color: var(--accent-gold);
    z-index: 1;
  }

  .journey-divider {
    display: none;
  }

  .journey-step {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: 
      "circle title"
      "circle desc";
    column-gap: 20px;
    row-gap: 2px;
    align-items: center;
    text-align: left;
    z-index: 2;
  }

  .journey-step .step-number {
    grid-area: circle;
  }

  .journey-step h4 {
    grid-area: title;
    margin: 0;
    max-width: none;
    width: auto;
  }

  .journey-step p {
    grid-area: desc;
    margin: 0;
    max-width: none;
    width: auto;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-collage {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .collage-left .gallery-tile,
  .collage-center .gallery-tile,
  .collage-right .gallery-tile {
    aspect-ratio: 16/10;
    height: auto;
  }

  .impact-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievers-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .news-cards-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .cta-dual-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .foot {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .about-lobby-img {
    height: 240px;
  }

  .about-overlay-box {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
    padding: 20px 16px;
  }

  .overlay-col {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }

  .overlay-col i {
    font-size: 1.25rem;
  }

  .overlay-col h5 {
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 2px;
  }

  .overlay-col p {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .overlay-col:not(:last-child)::after {
    display: none;
  }

  .philosophy-card {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 35px 24px;
  }

  .philosophy-col:not(:last-child)::after {
    display: none;
  }

  .top {
    display: none;
  }

  .navbar {
    height: 70px;
    top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .brand {
    font-size: 0.95rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .brand-main-text {
    display: none;
  }

  .brand-sub-text {
    display: flex;
    flex-direction: column;
    margin-top: 0;
  }

  .brand-sub-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.5px;
  }

  .brand-sub-desc {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    margin-top: 1px;
  }

  .section-header-line {
    display: none;
  }

  .section-header-content {
    max-width: 100%;
  }

  .consult {
    display: none;
  }

  .menu {
    display: block;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--white);
    cursor: pointer;
  }

  .nav nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--primary-dark);
    flex-direction: column;
    padding: 24px 5%;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 10px 25px rgba(14, 31, 61, 0.2);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .nav nav.open {
    display: flex;
  }

  /* Mobile Dropdown styles */
  .courses-dropdown {
    width: 100%;
  }

  .courses-dropdown .dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 4px 0;
  }

  .courses-dropdown .courses-list {
    position: relative;
    top: 0;
    left: 0;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 100%;
    min-width: 100%;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
    display: none;
  }

  .courses-dropdown.active .courses-list {
    display: block !important;
  }

  /* Single Column Grid on Mobile */
  .mega-menu-grid {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  .mega-col {
    gap: 2px !important;
  }

  /* Hide Sub-Categories on Mobile Viewport */
  .courses-dropdown .courses-list a:not(.mega-title) {
    display: none !important;
  }

  /* Main Category Titles as compact mobile links */
  .mega-title {
    font-size: 0.9rem !important;
    padding: 6px 12px !important;
    margin: 4px 0 2px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 6px;
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.02);
  }

  a.mega-title:hover,
  a.mega-title:active {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--accent-gold) !important;
  }

  /* View All Courses link on Mobile */
  .courses-dropdown .courses-list a[href="all-courses.html"] {
    display: flex !important;
    color: var(--accent-gold) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    padding: 10px 12px !important;
    margin: 8px 0 4px 0 !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    border-radius: 8px !important;
    background: rgba(212, 175, 55, 0.08) !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .hero .hero-inner {
    padding-top: 110px;
    /* Clear mobile header */
    padding-bottom: 40px;
    text-align: left;
  }

  .hero-btns {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero .guide {
    display: none;
  }

  .hero-stat {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
    padding: 20px;
    background: rgba(14, 31, 61, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--card-shadow);
  }

  .hero-stat span {
    border-right: none;
    border-bottom: none;
    padding-bottom: 0;
    width: 100%;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
  }

  .hero-stat span div {
    align-items: flex-start;
  }

  .hero-stat i {
    font-size: 1.25rem;
  }

  .hero-stat b {
    font-size: 1.25rem;
  }

  .hero-stat small {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .partners-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .partners-title {
    width: 100%;
  }

  /* Programs Section Mobile Tabs Redesign */
  .tabs-scroll-prev,
  .tabs-scroll-next {
    display: none !important;
  }

  .tabs-container {
    position: relative;
    margin-bottom: 24px;
  }

  .tabs-container::before,
  .tabs-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 5;
    pointer-events: none;
  }

  .tabs-container::before {
    left: calc(-5% - 15px);
    background: linear-gradient(to right, var(--bg-light), transparent);
  }

  .tabs-container::after {
    right: calc(-5% - 15px);
    background: linear-gradient(to left, var(--bg-light), transparent);
  }

  .tabs {
    margin-left: calc(-5% - 15px);
    margin-right: calc(-5% - 15px);
    padding-left: calc(5% + 15px);
    padding-right: calc(5% + 15px);
  }
}

@media (max-width: 560px) {
  .section-padding {
    padding: 60px 0;
  }

  .hero h1 {
    font-size: 2.15rem;
  }

  .hero-btns {
    flex-direction: column;
    gap: 12px;
  }

  .btn-hero {
    width: 100%;
    justify-content: center;
  }

  .btn-hero.outline {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
  }

  .about-checkmarks {
    align-items: flex-start;
  }

  .orange-help-banner {
    padding: 20px 15px;
  }

  .help-btns {
    flex-direction: column;
  }

  .help-btn {
    width: 100%;
  }

  .tabs-container {
    margin-bottom: 24px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .impact-stats-row {
    grid-template-columns: 1fr;
  }

  .cta-card {
    padding: 30px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .cta-card-content {
    max-width: 100%;
  }

  .cta-card-qr-box {
    align-self: center;
  }

  .foot {
    grid-template-columns: 1fr;
  }

  .copyright {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Staggered Course Cards Mobile Override */
@media (max-width: 991px) {
  .page-courses-list {
    gap: 40px;
  }
  .course-item,
  .course-item:nth-child(even) {
    flex-direction: column;
    border-radius: 16px;
    min-height: auto;
  }
  .course-thumb-wrap {
    flex: 0 0 auto;
    width: 100%;
    min-height: 250px;
  }
  .course-body {
    flex: 0 0 auto;
    padding: 30px 20px;
  }
  .course-body h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  /* Mobile Dropdown Fix */
  .courses-dropdown .courses-list {
    position: static !important;
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    transform: none !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    background: transparent !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    left: auto !important;
  }
  
  .courses-dropdown.active .courses-list {
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 1000px !important;
    padding: 15px 0 15px 15px !important;
  }

  .mega-menu-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 0 !important;
  }

  .mega-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  .mega-title {
    font-size: 0.9rem !important;
    margin-top: 6px !important;
    margin-bottom: 4px !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15) !important;
    padding-bottom: 4px !important;
    color: var(--accent-gold) !important;
  }

  .courses-dropdown .courses-list a {
    display: flex !important;
    padding: 6px 0 !important;
    font-size: 0.9rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
  }

  .courses-dropdown .courses-list a:hover {
    color: var(--accent-gold) !important;
    padding-left: 4px !important;
  }
  
  .hero-video {
    transform: scale(1.6) translateY(5%) !important;
    transform-origin: center bottom !important;
  }
  
  .courses-dropdown .courses-list a:hover {
    background: transparent;
    padding-left: 10px;
    color: var(--accent-gold);
  }

  .courses-dropdown .courses-list a::before {
    display: none;
  }
  
  .courses-dropdown .dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
