/*
 * TinkerStream Innovations - Redesigned Custom Stylesheet (Vanilla CSS Redesign)
 * Features modern layout tokens, responsive flex grids, glassmorphism, 3D tilt classes, and animation configurations.
 */

@import url('https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900&display=swap');

/* Color Variables */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-color: #2563eb;
  --accent-secondary: #4f46e5;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --accent-gradient: linear-gradient(135deg, #2563eb, #4f46e5);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-color-glowing: rgba(37, 99, 235, 0.25);
  --card-bg: #ffffff;
  --card-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --nav-bg: rgba(255, 255, 255, 0.8);
  --map-filter: none;
}

html[data-theme="dark"] {
  --bg-primary: #07090e;
  --bg-secondary: #0d111d;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-color: #38bdf8;
  --accent-secondary: #818cf8;
  --accent-glow: rgba(56, 189, 248, 0.2);
  --accent-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-glowing: rgba(56, 189, 248, 0.4);
  --card-bg: rgba(20, 27, 45, 0.6);
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(7, 9, 14, 0.85);
  --map-filter: invert(90%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.4s ease;
  line-height: 1.6;
}

/* Containers & Grids */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 991px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Layout Padding */
.section-padding {
  padding: 80px 0;
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #ec4899, #38bdf8);
  background-size: 300% 100%;
  animation: gradient-shift 8s linear infinite;
  z-index: 10000;
  width: 0%;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Custom Cursor Glow */
@media (min-width: 992px) {
  .cursor-glow {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(56, 189, 248, 0) 70%);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
  }
  .cursor-glow.expand {
    width: 55px;
    height: 55px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.45) 0%, rgba(129, 140, 248, 0) 70%);
    border: 1px solid rgba(129, 140, 248, 0.2);
  }
}

/* Header & Navbar */
header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 900;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  transition: background 0.5s ease, border-color 0.5s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo img {
  height: 48px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
  padding: 8px 0;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

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

/* Mobile Toggle Switch */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s ease;
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    gap: 24px;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  }
  .nav-menu.active {
    left: 0;
  }
}

/* Theme Toggle button */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--border-color-glowing);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.5s ease;
}

.theme-toggle-btn .sun-icon {
  color: #ea580c;
}
.theme-toggle-btn .moon-icon {
  color: #94a3b8;
  display: none;
}
html[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: none;
}
html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: block;
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 120px 0 100px;
  overflow: hidden;
  background-color: var(--bg-primary);
}

html[data-theme="dark"] .hero-section {
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 40%),
              radial-gradient(circle at bottom left, rgba(129, 140, 248, 0.04), transparent 45%);
}

.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.hero-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.visual-orbit {
  position: relative;
  width: 420px;
  height: 420px;
  border: 1px dashed var(--border-color);
  border-radius: 50%;
  animation: rotate-orbit 30s linear infinite;
}

.orbit-img {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.orbit-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.orbit-img:hover {
  transform: scale(1.15);
  border-color: var(--border-color-glowing);
}

.orbit-img.img-1 { top: -40px; left: 170px; }
.orbit-img.img-2 { right: -40px; top: 170px; }
.orbit-img.img-3 { bottom: -40px; left: 170px; }
.orbit-img.img-4 { left: -40px; top: 170px; }

.visual-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent-gradient);
  padding: 3px;
  box-shadow: 0 10px 40px var(--accent-glow);
}

.visual-center-inner {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-align: center;
  padding: 16px;
}

@keyframes rotate-orbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 991px) {
  .hero-layout {
    flex-direction: column;
    text-align: center;
    padding-top: 40px;
  }
  .hero-title {
    font-size: 2.8rem;
  }
  .visual-orbit {
    width: 300px;
    height: 300px;
  }
  .orbit-img {
    width: 60px;
    height: 60px;
    padding: 10px;
  }
  .orbit-img.img-1 { top: -30px; left: 120px; }
  .orbit-img.img-2 { right: -30px; top: 120px; }
  .orbit-img.img-3 { bottom: -30px; left: 120px; }
  .orbit-img.img-4 { left: -30px; top: 120px; }
  .visual-center {
    width: 140px;
    height: 140px;
  }
}

/* Sections & Headings */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.section-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-color);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  display: inline-block;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Custom Cards */
.card-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--card-shadow);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.card-wrapper:hover {
  transform: translateY(-8px);
  border-color: var(--border-color-glowing);
  box-shadow: 0 20px 40px -10px var(--accent-glow);
}

.card-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(56, 189, 248, 0.2);
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.card-wrapper:hover .card-num {
  color: var(--accent-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Syllabus Cards specifics */
.syllabus-card {
  border-left: 4px solid var(--accent-color);
}

.syllabus-module {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.syllabus-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.syllabus-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 20px;
}

.syllabus-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-color);
  font-weight: bold;
}

/* Highlight / Split Sections */
.split-layout {
  display: flex;
  align-items: center;
  gap: 64px;
}

.split-content {
  flex: 1;
}

.split-visual {
  flex: 1;
}

.split-visual img {
  width: 100%;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

@media (max-width: 991px) {
  .split-layout {
    flex-direction: column;
    gap: 40px;
  }
}

/* Accordion or Module Grids */
.syllabus-details-header {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
  transition: 0.3s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

/* Map / Contacts layout */
.contact-map-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.contact-info h4 {
  font-weight: 600;
  color: var(--text-primary);
}

.contact-info a, .contact-info p {
  color: var(--text-secondary);
  text-decoration: none;
}

.map-wrapper {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.map-wrapper iframe {
  width: 100%;
  height: 100%;
  min-height: 350px;
  display: block;
  filter: var(--map-filter);
  transition: filter 0.5s ease;
}

@media (max-width: 768px) {
  .contact-map-layout {
    grid-template-columns: 1fr;
  }
}

/* Footer styling */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 64px 0 32px;
}

.footer-layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 64px;
  margin-bottom: 48px;
}

.footer-about h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-about p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 400px;
}

.footer-links h4, .footer-contact h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a, .footer-contact p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* 3D Tilt CSS Helpers */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card > * {
  transform: translateZ(20px);
}

/* Animations */
.reveal-fade-in {
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-slide-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale-up {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.in-view {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* Stagger Classes */
.stagger-1 { transition-delay: 0.05s !important; }
.stagger-2 { transition-delay: 0.1s !important; }
.stagger-3 { transition-delay: 0.15s !important; }
.stagger-4 { transition-delay: 0.2s !important; }
.stagger-5 { transition-delay: 0.25s !important; }
.stagger-6 { transition-delay: 0.3s !important; }

/* Grid Syllabus Layout details */
.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
@media (max-width: 767px) {
  .syllabus-grid {
    grid-template-columns: 1fr;
  }
}
