/* Externalized styles from index.html */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --text-color: #333;
  --background-color: #ecf0f1;
  --surface-color: #ffffff;
  --border-color: #e5e7eb;
  --muted-color: #6b7280;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.75rem 0;
  position: sticky; /* changed from fixed to sticky to avoid large gap */
  top: 0;
  z-index: 1000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

nav { display: flex; justify-content: space-between; align-items: center; }
nav ul { list-style-type: none; padding: 0; margin: 0; }
nav ul li { margin: 0 10px; }
nav ul li a { color: #fff; text-decoration: none; font-weight: bold; transition: color 0.3s ease; }
nav ul li a:hover { color: var(--secondary-color); }

.hamburger { display: none; flex-direction: column; cursor: pointer; }
.hamburger div { width: 25px; height: 3px; background-color: white; margin: 4px 0; transition: 0.4s; }

.hero { background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; flex-direction: column; }
.hero-content { display: flex; flex-direction: column; align-items: center; }
.hero-content canvas { margin-bottom: 20px; }
.hero-content h1 { font-size: 3rem; margin-bottom: 1rem; }

.section { padding: 1rem 0; }
.tab-content { padding-top: 0.25rem; }
#Training { padding-top: 0; }
#Training .section-title { margin-top: 0; }
.section-title { font-size: 1.75rem; margin-bottom: 1rem; color: var(--primary-color); font-weight: 700; }
.profile-pic { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-right: 20px; }
.experience-item { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: var(--card-shadow); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tool-item { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; box-shadow: var(--card-shadow); }
.tool-icon { width: 48px; height: 48px; margin-right: 12px; object-fit: cover; border-radius: 8px; }

.grid-table { background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--card-shadow); overflow: hidden; }
.grid-table .table-header, .grid-table .table-row { display: grid; grid-template-columns: var(--cols, 2fr 3fr 1fr); gap: 16px; padding: 12px 16px; }
.grid-table .table-header { background: #f8fafc; font-weight: 600; }
.grid-table .table-row { border-top: 1px solid var(--border-color); }
.grid-table.cols-2 { --cols: 3fr 1fr; }
.grid-table.cols-3 { --cols: 2fr 3fr 1fr; }
.badge { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-color); background: transparent; padding: 0; border: 0; }
.badge i { color: var(--primary-color); }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; box-shadow: var(--card-shadow); }
.cta-link { display: inline-flex; align-items: center; gap: 8px; color: #1f2937; background: #eef2ff; border: 1px solid #c7d2fe; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background 0.2s ease, transform 0.2s ease; }
.cta-link:hover { background: #e0e7ff; transform: translateY(-1px); }
.store-badge { height: 24px; width: auto; }

footer { background: var(--primary-color); color: white; text-align: center; padding: 20px 0; margin-top: 40px; }

@media (max-width: 768px) {
  .grid-table .table-header { display: none; }
  .grid-table .table-row { grid-template-columns: 1fr; }
}

/* Carousel sizing tweaks */
#home .carousel-item img { object-fit: cover; width: 100%; height: 260px; max-height: 260px; }
#home .carousel-caption { background: rgba(0, 0, 0, 0.45); border-radius: 12px; padding: 12px 16px; }

/* Card grid common spacing */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* Interactive portfolio button */
.interactive-link-btn { display: inline-block; padding: 10px 20px; background-color: #4f77c0; color: #fff; text-align: center; text-decoration: none; border-radius: 4px; }
.interactive-link-btn:hover { filter: brightness(1.05); }

/* Responsive nav pills adjustments */
#pillNav { justify-content: center; }
#pillNav .nav-link { font-size: 0.95rem; padding: 0.45rem 0.75rem; }

/* Mobile: collapse nav into hamburger and reduce spacing */
@media (max-width: 576px) {
  .hamburger { display: flex; }
  #pillNav { display: none; position: absolute; left: 0; right: 0; top: 56px; background: var(--primary-color); padding: 8px; border-radius: 0; box-shadow: var(--card-shadow); z-index: 1001; }
  #pillNav.active { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #pillNav .nav-link { font-size: 0.85rem; padding: 0.4rem 0.6rem; }
  header { padding: 0.5rem 0; }
  .container { padding: 0 12px; }
  .section { padding: 0.75rem 0; }
  .section-title { font-size: 1.4rem; }
}

/* Home carousel: increase slide height by ~25% and make media fill */
#homeCarousel .carousel-item { 
  position: relative; 
  /* Height scales with viewport width; ~25% taller than 16:9 baseline */
  height: clamp(280px, calc(56.25vw * 1.25), 760px);
}

#homeCarousel .carousel-item img { 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}

/* Override Bootstrap ratio for iframe slides to occupy full slide height */
#homeCarousel .carousel-item .ratio { 
  height: 100% !important; 
  width: 100%; 
  padding-top: 0 !important; 
}

#homeCarousel .carousel-item iframe { 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
}