/* KUNDOOR MARKAZ - MODERN WEBSITE REDESIGN */

:root {
  --color-primary: #00546B;
  --color-primary-dark: #003D4F;
  --color-accent: #C99B3B;
  --color-accent-dark: #A67F2E;
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F9F9F9;
  --color-bg-dark: #1A1A1A;
  --color-text-primary: #333333;
  --color-text-secondary: #666666;
  --color-border: #E0E0E0;
  --font-heading: 'Poppins', 'Montserrat', sans-serif;
  --font-body: 'Open Sans', 'Roboto', sans-serif;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition-base: 300ms ease-in-out;
  --container-max-width: 1200px;
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-base);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  overflow-x: hidden;
}

.section {
  padding: var(--spacing-3xl) 0;
}

.text-center {
  text-align: center;
}

.bg-light {
  background-color: var(--color-bg-secondary);
}

/* HEADER */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: all var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
  height: 70px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.logo {
  height: 50px;
  transition: height var(--transition-base);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-primary);
  text-transform: capitalize;
  position: relative;
  padding: var(--spacing-xs) 0;
  transition: color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.header-social {
  display: flex;
  gap: var(--spacing-sm);
  margin-left: var(--spacing-lg);
}

/* Login Button */
.btn-login-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: white !important;
  border-radius: var(--radius-full);
  padding: 0.4rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: none;
  transition: all var(--transition-base);
  margin-left: var(--spacing-sm);
  white-space: nowrap;
  border: 2px solid transparent;
}

.btn-login-header i {
  margin-right: 0.5rem;
  font-size: 0.9em;
}

.btn-login-header:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-secondary);
  color: var(--color-primary);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.social-icon:hover {
  background-color: var(--color-primary);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--spacing-xs);
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
}

/* HERO */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 84, 107, 0.95) 0%, rgba(0, 61, 79, 0.95) 100%),
              url('pics/valyasthad podium.jpg') center/cover no-repeat;
  background-attachment: fixed;
  color: #FFFFFF;
  text-align: center;
  padding-top: var(--header-height);
}

.hero-content {
  max-width: 900px;
  padding: var(--spacing-2xl) var(--spacing-md);
  animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--spacing-md);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--spacing-lg);
  color: #FFFFFF;
}

.hero-title .highlight {
  color: var(--color-accent);
  display: block;
}

.hero-description {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: var(--spacing-xl);
  color: rgba(255, 255, 255, 0.9);
}

.hero-cta {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  text-transform: capitalize;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: transparent;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
}

.btn-secondary:hover {
  background-color: #FFFFFF;
  color: var(--color-primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

/* SECTION HEADERS */
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.section-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--spacing-sm);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

.section-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* COURSE CARDS */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-2xl);
}

.course-card {
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid var(--color-border);
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.course-icon {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #007A9A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #FFFFFF;
}

.course-content {
  padding: var(--spacing-lg);
}

.course-title {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  text-transform: capitalize;
}

.course-description {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-md);
}

/* ANIMATIONS */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* FOOTER */
.footer {
  background-color: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--spacing-3xl) 0 var(--spacing-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
}

.footer-section h3 {
  color: #FFFFFF;
  margin-bottom: var(--spacing-md);
  font-size: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-base);
  text-transform: capitalize;
}

.footer-link:hover {
  color: var(--color-accent);
}

.footer-social {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.footer-social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.footer-social-icon:hover {
  background-color: var(--color-accent);
  transform: translateY(-3px);
}

.footer-bottom {
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* SCROLL TO TOP */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--color-accent);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-3px);
}

/* ACCESSIBILITY */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE MEDIA QUERIES
   All media queries consolidated here for proper loading
   ============================================ */

/* TABLET AND MOBILE - 968px and below */
@media (max-width: 968px) {
  /* Menu Toggle Button */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
  }

  .menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transition: all 0.3s ease;
    display: block;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Navigation Menu */
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: calc(100vh - var(--header-height));
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.5rem 1.25rem;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 1rem;
    display: block;
    color: var(--color-text-primary);
    transition: all 0.2s ease;
  }

  .nav-link:hover,
  .nav-link:focus {
    color: var(--color-primary);
    padding-left: 8px;
  }

  .header-social {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0 0.5rem;
    width: 100%;
    padding: 0;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1.25rem;
  }

  .header-social .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    transition: all 0.2s ease;
    font-size: 1rem;
  }

  .header-social .social-icon:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
  }

  .header-social .btn-login-header {
    width: 100%;
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: white;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
  }

  .header-social .btn-login-header:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
  }

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
  
  .header-social {
    margin-left: 0;
    justify-content: center;
  }
  
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

/* MOBILE - 768px and below */
/* Responsive adjustments for login button */
@media (max-width: 992px) {
  .header-social .btn-login-header {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    margin-left: 0.5rem;
  }
}

@media (max-width: 768px) {
  /* Spacing adjustments */
  :root {
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
  }
  
  html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
  }
  
  .section {
    padding: var(--spacing-2xl) 0;
    overflow-x: hidden;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
    max-width: 100%;
    overflow-x: hidden;
  }
  
  /* Header fixes */
  .header {
    width: 100%;
    max-width: 100vw;
  }
  
  .header-container {
    padding: 0 var(--spacing-sm);
    max-width: 100%;
  }
  
  /* Footer fixes */
  .footer {
    overflow-x: hidden;
    width: 100%;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .footer-section {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  
  .footer-section p {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  
  /* Hero Section - Mobile */
  .hero {
    min-height: 80vh;
    background-attachment: scroll;
  }
  
  .hero-content {
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-cta .btn {
    width: 100%;
  }
  
  /* About Section (Excellence in Islamic & Modern Education) - Mobile */
  #about .container > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--spacing-xl) !important;
    max-width: 100%;
    overflow: hidden;
  }
  
  #about .container > div > div {
    max-width: 100%;
    min-width: 0;
  }
  
  #about .container > div > div:first-child {
    order: 2;
  }
  
  #about .container > div > div:last-child {
    order: 1;
  }
  
  #about img {
    height: 250px !important;
    width: 100%;
    object-fit: cover;
  }
  
  /* Campus Explore Section - Mobile */
  .section .container > div[style*="grid-template-columns: 1fr 1fr"],
  .section .container > div[style*="grid-template-columns"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--spacing-xl) !important;
    max-width: 100%;
    overflow: hidden;
  }
  
  .section .container > div[style*="grid-template-columns"] > div {
    max-width: 100%;
    min-width: 0;
  }
  
  .swiper-slide img {
    height: 300px !important;
    max-width: 100%;
  }
  
  .swiper,
  .mySwiper {
    max-width: 100%;
    overflow: hidden;
  }
  
  .swiper-wrapper {
    max-width: 100%;
  }
  
  .swiper-button-next,
  .swiper-button-prev {
    width: 35px !important;
    height: 35px !important;
  }
  
  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 20px !important;
  }
  
  /* Fix for all images and divs with inline styles */
  div[style*="border-radius"],
  div[style*="box-shadow"] {
    max-width: 100%;
    overflow: hidden;
  }
  
  img {
    max-width: 100% !important;
    height: auto;
  }
  
  /* HIDE FACULTY SECTION ON MOBILE (HOMEPAGE ONLY) */
  body > section:has(.faculty-grid) {
    display: none !important;
  }
}

/* EXTRA SMALL MOBILE - 480px and below */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.875rem;
  }
  
  .hero-description {
    font-size: 0.95rem;
  }
  
  #about img,
  .swiper-slide img {
    height: 200px !important;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .section-description {
    font-size: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}
