/* 
  gyanix - Premium Educational Portal
  Theme: Modern Clean & Professional
  Version: 4.0
*/

/* --- 1. CSS Reset & Variables --- */
:root {
  /* Brand Colors - Refined */
  --primary: #2563EB;
  /* Royal Blue */
  --primary-dark: #1E40AF;
  --primary-light: #DBEAFE;

  --secondary: #475569;
  /* Slate */
  --secondary-dark: #1E293B;

  --accent: #F59E0B;
  /* Amber for highlights */

  /* Backgrounds */
  --bg-body: #F8FAFC;
  /* Slate 50 - Softer than pure white/gray */
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;

  /* Typography */
  --text-main: #0F172A;
  /* Slate 900 */
  --text-body: #334155;
  /* Slate 700 */
  --text-muted: #64748B;
  /* Slate 500 */
  --text-light: #94A3B8;
  /* Slate 400 */

  /* UI Elements */
  --border: #E2E8F0;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --max-width: 1200px;
  --header-height: 90px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

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

ul {
  list-style: none;
}

/* --- 2. Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75em;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1.25rem;
}

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

.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

/* --- 3. Layout Utilities --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.grid {
  display: grid;
  gap: 2rem;
}

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

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

/* Responsive Grid */
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.flex {
  display: flex;
}

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

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* --- 4. Components --- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-card);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25em 0.75em;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}

.badge-red {
  background: #FEE2E2;
  color: #DC2626;
}

.badge-green {
  background: #DCFCE7;
  color: #166534;
}

.badge-blue {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-gray {
  background: #F1F5F9;
  color: #475569;
}

.badge-urgent {
  background: #FEE2E2;
  color: #DC2626;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.badge-success {
  background: #DCFCE7;
  color: #166534;
}

.badge-tech {
  background: #F3E8FF;
  color: #7C3AED;
}

/* Urgent Pulse Animation */
@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.badge-urgent {
  background: #FEE2E2;
  color: #DC2626;
  animation: pulse-red 2s infinite;
}

.badge-tech {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.badge-career {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card-header {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-dark);
}

.card-text {
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.card-link {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
}

.card-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --- 5. Navigation --- */
header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.news-ticker {
  background: var(--secondary-dark);
  color: white;
  font-size: 0.8rem;
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker 30s linear infinite;
  padding-left: 100%;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

.nav-container {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  z-index: 2;
  position: relative;
}

.brand-logo {
  height: 65px;
  width: auto;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-weight: 500;
  color: var(--text-body);
  font-size: 0.95rem;
  position: relative;
}

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

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

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

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
}

.menu-icon {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
  position: relative;
}

/* --- 6. Hero Section (Fixed Background) --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Fixed Background Image */
  background-image: url('../images/hero-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Dark Overlay for Text Readability */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(37, 99, 235, 0.35), rgba(15, 23, 42, 0.80));
  background-size: 200% 200%;
  animation: heroGradient 12s ease infinite;
  z-index: 1;
}

@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ensure hero content sits above the overlay */
.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  text-align: center;
  margin: 0 auto;
}

.hero-badge {
  background: rgba(37, 99, 235, 0.9);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-radius: 99px;
  display: inline-block;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4), 0 0 40px rgba(37, 99, 235, 0.2);
  animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.4), 0 0 40px rgba(37, 99, 235, 0.2); }
  50% { box-shadow: 0 0 30px rgba(37, 99, 235, 0.6), 0 0 60px rgba(37, 99, 235, 0.3); }
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: white;
  background: none;
  background-clip: unset;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtext {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Buttons Override for Dark Background */
.hero .btn-primary {
  background: var(--primary);
  color: white;
  border: 2px solid var(--primary);
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  transition: all 0.3s ease;
}

.hero .btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.hero .btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.7);
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.hero .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  transform: translateY(-2px);
}

/* Hero flex layout - center content */
.hero>.container>.flex {
  justify-content: center;
}

/* Mobile: Switch to scroll attachment */
@media (max-width: 768px) {
  .hero {
    background-attachment: scroll;
    min-height: 90vh;
    padding: 4rem 0;
  }

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

  .hero-subtext {
    font-size: 1rem;
  }
}


/* --- 7. Blog & Content Styles --- */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  margin-top: 2rem;
}

.blog-post {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.breadcrumbs {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a:hover {
  text-decoration: underline;
  color: var(--primary);
}

.post-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Table of Contents */
.toc {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.toc ul li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: var(--text-body);
  font-size: 0.95rem;
}

.toc a:hover {
  color: var(--primary);
  padding-left: 4px;
}

/* Post Content Typography */
.content h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
}

.content h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  color: var(--secondary-dark);
}

.content p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: var(--text-body);
}

.content ul,
.content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.content ul {
  list-style: disc;
}

.content ol {
  list-style: decimal;
}

.content strong {
  color: var(--text-main);
  font-weight: 600;
}

.content blockquote {
  border-left: 4px solid var(--accent);
  background: #FFFBEB;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-body);
}

/* Sidebar */
.sidebar-widget {
  background: white;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.sidebar-links li {
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.75rem;
}

.sidebar-links li:last-child {
  border-bottom: none;
}

/* Footer */
footer {
  background: var(--secondary-dark);
  color: var(--text-light);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: white;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a:hover {
  color: white;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* --- 8. Mobile Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .brand-logo {
    height: 45px;
  }

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

  .menu-icon {
    display: block;
  }

  .menu-toggle:checked~.nav-menu {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    z-index: 1;
  }

  .blog-layout {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}