
/* =========================================
   CAPHA — Central Asian Pre-Health Association
   Master Design | Modern Academic Style
========================================= */

/* ----------- ROOT THEME ----------- */
:root {
  --primary: #0b3c5d; /* deep academic blue */
  --secondary: #328cc1; /* soft cyan-blue */
  --accent: #d9b310; /* gold accent */
  --light: #f9f9f9;
  --dark: #102542;
  --font-main: "Roboto", sans-serif;
  --font-heading: "Bodoni Moda", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: linear-gradient(180deg, #eef5f9 0%, #fdfdfd 100%);
  color: var(--dark);
  line-height: 1.6;
}

/* ----------- HEADER & NAV ----------- */
header {
  background: var(--primary);
  color: white;
  padding: 18px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
}

.brand-logo {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.1);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.8rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: 0.3s;
}

nav a:hover,
nav a.active {
  color: var(--accent);
}

/* ----------- HERO SECTION ----------- */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, #e7f3f8 50%, #d8ecf3 100%);
  padding: 90px 0;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.hero .sub {
  font-size: 1.25rem;
  color: #1e3a4a;
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.hero .btn {
  display: inline-block;
  background: var(--secondary);
  color: white;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  margin: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(50, 140, 193, 0.4);
}

.hero .btn:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

/* ----------- EVENTS SECTION ----------- */
#events {
  background: linear-gradient(180deg, #f9fbfd 0%, #edf4f8 100%);
  padding: 100px 10%;
  position: relative;
  overflow: hidden;
}

#events::before {
  content: "";
  position: absolute;
  top: -50px;
  left: -50px;
  right: -50px;
  bottom: -50px;
  background: radial-gradient(circle at top left, rgba(50, 140, 193, 0.1), transparent 70%);
  z-index: 0;
}

#events h2 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  color: var(--primary);
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(11, 60, 93, 0.15);
  position: relative;
  z-index: 2;
}

#events .section-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  color: #23445e;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.2rem;
  position: relative;
  z-index: 2;
}

.event-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 60, 100, 0.08);
  transition: all 0.4s ease;
  border: 1px solid #d2e3ed;
  position: relative;
}

.event-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(11, 60, 93, 0.18);
  border-color: var(--secondary);
}

.event-date {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  text-align: center;
  padding: 1.2rem 0.8rem;
  position: relative;
  font-family: var(--font-heading);
}

.event-date h3 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}

.event-date p {
  font-size: 1rem;
  letter-spacing: 0.5px;
  margin-top: 0.4rem;
  opacity: 0.9;
}

.event-info {
  padding: 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.event-info h3 {
  font-size: 1.45rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(11, 60, 93, 0.1);
}

.event-info p {
  font-size: 1.05rem;
  color: #34566d;
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.event-info .btn {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(50, 140, 193, 0.35);
}

.event-info .btn:hover {
  background: var(--accent);
  color: #102542;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(217, 179, 16, 0.35);
}

.event-card:hover::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(50, 140, 193, 0.1), transparent 60%);
  z-index: -1;
  transition: opacity 0.4s ease;
}

@media (max-width: 768px) {
  #events h2 {
    font-size: 2.2rem;
  }
  #events .section-intro {
    font-size: 1.05rem;
  }
  .event-info h3 {
    font-size: 1.25rem;
  }
  .event-info p {
    font-size: 0.95rem;
  }
}

/* ----------- SECTIONS ----------- */
.section {
  padding: 80px 10%;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.section:nth-of-type(even) {
  background: #f5f9fb;
}

.section h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ----------- RESOURCES ----------- */
details {
  background: #ffffff;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid #cde1ec;
  box-shadow: 0 4px 15px rgba(10, 40, 70, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

details:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(10, 40, 70, 0.1);
}

summary {
  font-weight: 700;
  font-size: 1.25rem;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  color: var(--dark);
  background: linear-gradient(90deg, #f8fbfc 0%, #e8f3f8 100%);
}

.panel {
  padding: 1.2rem 1.5rem;
  font-size: 1.05rem;
  color: #30475e;
}

.panel a.link {
  color: var(--secondary);
  text-decoration: underline;
}

.panel a.link:hover {
  color: var(--primary);
}

/* =========================================
   LEADERSHIP FLIP CARD EFFECT
========================================= */
.leaders {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  padding: 0 2rem;
}

.leader-card {
  background: transparent;
  width: 320px;
  height: 480px;
  perspective: 1000px;
  flex-shrink: 0;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.9s;
  transform-style: preserve-3d;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(20, 60, 100, 0.12);
}

.leader-card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  backface-visibility: hidden;
  overflow: hidden;
}

.card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fb 100%);
}

.card-front img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px rgba(50, 140, 193, 0.25);
  display: block;
}

.card-front h3 {
  font-family: var(--font-heading);
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  text-align: center;
  line-height: 1.2;
}

.card-front p {
  color: #2f4157;
  font-weight: 500;
  font-size: 1.05rem;
  text-align: center;
}

.card-back {
  background: linear-gradient(180deg, #328cc1 0%, #0b3c5d 100%);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 1.5rem;
  text-align: left;
  border-radius: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.4) transparent;
}

/* Webkit scrollbar styling for card back */
.card-back::-webkit-scrollbar {
  width: 6px;
}

.card-back::-webkit-scrollbar-track {
  background: transparent;
}

.card-back::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.4);
  border-radius: 3px;
}

.card-back::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.6);
}

.card-back h3 {
  font-family: var(--font-heading);
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
  text-align: center;
  width: 100%;
}

.card-back p {
  font-size: 1rem;
  line-height: 1.55;
  color: #f3f7fa;
  margin-bottom: 0.5rem;
  width: 100%;
}

.card-back a {
  color: #ffd700;
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.card-back a:hover {
  color: #fff;
}

/* ---- Alternative: Non-flip card layout (if you use .leader instead) ---- */
.leader {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 320px;
  background: white;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 8px 25px rgba(20, 60, 100, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.leader:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(20, 60, 100, 0.18);
}

.leader img {
  display: block;
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px rgba(50, 140, 193, 0.25);
}

.leader h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.4px;
  text-align: center;
  line-height: 1.2;
}

.leader p {
  font-size: 1.05rem;
  color: #2f4157;
  font-weight: 500;
  text-align: center;
}

/* ---- FIXED: Square / Portrait photos (no circular crop) ---- */
.leader img {
  display: block;
  width: 100%;
  height: 420px;               /* Portrait height */
  object-fit: cover;
  object-position: center;
  border-radius: 6px !important; /* Force remove circle */
  margin-bottom: 1rem;
  box-shadow: 0 8px 25px rgba(50, 140, 193, 0.3);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* Optional hover effect */
.leader img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(50, 140, 193, 0.45);
}

/* Text under photos */
.leader h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.4px;
}

.leader p {
  font-size: 1.1rem;
  color: #2f4157;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .leader {
    width: 85%;
  }
  .leader img {
    height: 340px;
  }
}


/* ----------- SOCIAL LINKS SECTION ----------- */
.social-links {
  text-align: center;
  margin-top: 3rem;
  padding: 0 1rem;
}

.social-links h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
  letter-spacing: 0.5px;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  color: white;
  background: var(--primary);
  padding: 12px 24px;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(11, 60, 93, 0.25);
}

.social-btn img {
  width: 20px;
  height: 20px;
}

/* LinkedIn button style */
.social-btn.linkedin {
  background: #0077b5;
}

.social-btn.linkedin:hover {
  background: #005983;
}

/* Instagram button style */
.social-btn.instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

.social-btn.instagram:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

/* ----------- FOOTER ----------- */
footer {
  background: var(--dark);
  color: #e8eef2;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  margin-top: 60px;
}

/* ----------- RESPONSIVE DESIGN ----------- */
@media (max-width: 900px) {
  /* Navigation */
  .nav {
    flex-direction: column;
    gap: 1rem;
    width: 95%;
  }

  nav ul {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
    width: 100%;
  }

  nav a {
    font-size: 0.95rem;
  }

  .brand {
    font-size: 1.1rem;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  /* Hero Section */
  .hero {
    padding: 60px 5%;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .sub {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .hero .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  /* Events Section */
  #events {
    padding: 60px 5%;
  }

  #events h2 {
    font-size: 2rem;
  }

  #events .section-intro {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }

  .event-card {
    max-width: 100%;
  }

  .event-info h3 {
    font-size: 1.2rem;
  }

  .event-info p {
    font-size: 0.95rem;
  }

  /* Leadership Cards - Mobile Optimized */
  .leaders {
    flex-direction: column;
    gap: 2rem;
    padding: 0 1rem;
    align-items: center;
  }

  .leader-card {
    width: 100%;
    max-width: 360px;
    height: 500px;
  }

  .card-front {
    padding: 1rem;
  }

  .card-front img {
    height: 360px;
    object-fit: cover;
    object-position: center 20%;
  }

  .card-front h3 {
    font-size: 1.2rem;
  }

  .card-front p {
    font-size: 1rem;
  }

  .card-back {
    padding: 1.2rem;
  }

  .card-back h3 {
    font-size: 1.2rem;
  }

  .card-back p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Non-flip card layout */
  .leader {
    width: 100%;
    max-width: 360px;
    padding: 1rem;
  }

  .leader img {
    height: 380px;
    object-fit: cover;
    object-position: center 20%;
  }

  .leader h3 {
    font-size: 1.2rem;
  }

  .leader p {
    font-size: 1rem;
  }

  /* Sections */
  .section {
    padding: 50px 5%;
  }

  .section h2 {
    font-size: 1.8rem;
  }

  /* Resources */
  summary {
    font-size: 1.1rem;
    padding: 1rem;
  }

  .panel {
    padding: 1rem;
    font-size: 0.95rem;
  }

  /* Social Links */
  .social-links {
    padding: 0 1rem;
  }

  .social-links h3 {
    font-size: 1.5rem;
  }

  .social-buttons {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .social-btn {
    width: 90%;
    max-width: 300px;
    justify-content: center;
  }

  /* Footer */
  footer {
    padding: 1.2rem 1rem;
    font-size: 0.85rem;
  }
}

/* Extra small devices (phones in portrait mode) */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .hero .sub {
    font-size: 0.9rem;
  }

  #events h2 {
    font-size: 1.6rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  /* Leadership cards for very small screens */
  .leader-card {
    max-width: 100%;
    height: 480px;
  }

  .card-front img {
    height: 340px;
  }

  .card-front h3 {
    font-size: 1.1rem;
  }

  .card-front p {
    font-size: 0.95rem;
  }

  .leader {
    max-width: 100%;
  }

  .leader img {
    height: 360px;
  }

  .leader h3 {
    font-size: 1.1rem;
  }

  .leader p {
    font-size: 0.95rem;
  }

  .event-date h3 {
    font-size: 1.6rem;
  }

  .event-date p {
    font-size: 0.9rem;
  }

  .social-btn {
    width: 95%;
    font-size: 0.95rem;
    padding: 10px 20px;
  }
}

/* Landscape orientation fix for phones */
@media (max-width: 900px) and (orientation: landscape) {
  .hero {
    padding: 40px 5%;
  }

  .leader-card {
    height: 420px;
  }

  .card-front img {
    height: 280px;
  }

  .leader img {
    height: 300px;
  }
}

/* Tablet landscape optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .leaders {
    gap: 2rem;
  }

  .leader-card {
    width: 300px;
    height: 460px;
  }

  .card-front img {
    height: 320px;
  }

  .leader {
    width: 300px;
  }

  .leader img {
    height: 360px;
  }
}

.mail-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(50, 140, 193, 0.35);
}

.mail-btn:hover {
  background: var(--accent);
  color: var(--dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 179, 16, 0.4);
}
