/* Modern Design System - Performance Optimized */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap&text=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя.,!?-+() ');

:root {
  --primary-color: #007790;
  --primary-light: #0099aa;
  --primary-dark: #005566;
  --accent-color: #00d4aa;
  --dark-color: #1a1a2e;
  --light-color: #f8f9fa;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #333;
  background: #eef1f4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

/* ===== GLASSMORPHISM COMPONENTS ===== */

/* Navigation */
.glass-nav {
  background: rgba(0, 100, 120, 0.97) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  will-change: background;
}

.glass-nav.scrolled {
  background: rgba(0, 80, 100, 0.99) !important;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand-text {
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.brand-dot {
  color: var(--accent-color);
}

.nav-glass-link {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  padding: 0.5rem 1.5rem !important;
  margin-left: 1rem;
  transition: background 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-glass-link:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ===== HERO SECTION ===== */
.hero-section {
  background: linear-gradient(135deg, #007790 0%, #005566 50%, #003d4d 100%);
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.hero-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 80%, rgba(0, 212, 170, 0.08) 0%, transparent 55%);
  pointer-events: none;
  contain: strict;
}

.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  /* animation disabled for performance on low-end devices */
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  bottom: 10%;
  left: -50px;
  animation-delay: -5s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  top: 40%;
  right: 10%;
  animation-delay: -10s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  right: 30%;
  animation-delay: -15s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 992px) {
  .shape {
    animation: float 20s infinite ease-in-out;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.badge-glass {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.text-gradient {
  background: linear-gradient(135deg, #00d4aa 0%, #00ffcc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.9;
  max-width: 500px;
}

/* Buttons */
.btn-glass {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
  color: white;
}

.btn-outline-glass {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

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

/* Hero Stats */
.hero-stats {
  margin-top: 3rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
}

.stat-item .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-item .stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Glass Code Window */
.hero-image-container {
  contain: layout;
}

.code-window {
  background: #2d2d3d;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease;
  max-width: 500px;
  margin: 0 auto;
  will-change: transform;
}

.code-window:hover {
  transform: scale(1.01);
}

.glass-code {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-header {
  background: #2d2d3d;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-header {
  background: #2d2d3d;
}

.code-dots {
  display: flex;
  margin-right: 15px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.code-title {
  color: #888;
  font-size: 0.85rem;
  flex-grow: 1;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.code-content {
  padding: 25px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #f8f8f2;
  overflow-x: auto;
  text-align: left;
}

.code-content pre {
  margin: 0;
  white-space: pre-wrap;
}

/* ===== SECTION STYLES ===== */
section {
  position: relative;
}

.section-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.section-title {
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.section-subtitle {
  color: #6c757d;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== FEATURES SECTION ===== */
.features-section {
  background: #f7f8fb;
  padding: 5rem 0;
}

.glass-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  contain: layout style;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.11);
}

.feature-card {
  padding: 2rem;
}

.feature-card .card-body {
  padding: 1rem 0;
}

.feature-card .card-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.feature-card .card-text {
  color: #6c757d;
  line-height: 1.7;
}

.feature-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.glass-icon {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  box-shadow: 0 10px 30px rgba(0, 119, 144, 0.3);
}

.feature-card:hover .glass-icon {
  transform: scale(1.08);
}

/* ===== LESSONS SECTION ===== */
.lessons-section {
  background: #f0f2f5;
  padding: 5rem 0;
}

.glass-accordion {
  background: transparent;
  border: none;
}

.glass-accordion-item {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

.glass-accordion-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09);
}

.accordion-button {
  background: transparent;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 1.25rem 1.5rem;
  border: none;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  background: linear-gradient(135deg, rgba(0, 119, 144, 0.1) 0%, rgba(0, 153, 170, 0.05) 100%);
  color: var(--primary-color);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

.accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23007790'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transition: transform 0.3s ease;
}

.accordion-body {
  padding: 0 1.5rem 1.5rem;
}

.accordion-body .list-group-item {
  background: transparent;
  border: none;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.accordion-body .list-group-item:last-child {
  border-bottom: none;
}

.accordion-body .list-group-item:hover {
  padding-left: 10px;
  background: rgba(0, 119, 144, 0.03);
  border-radius: 8px;
}

.accordion-body a {
  color: #495057;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.accordion-body a:hover {
  color: var(--primary-color);
}

/* ===== EXAMPLES SECTION ===== */
.examples-section {
  background: #fff;
  padding: 5rem 0;
}

.code-example-card {
  overflow: hidden;
}

.code-example-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.code-example-body {
  background: #1e1e2e;
  padding: 1.5rem;
  overflow-x: auto;
}

.code-example-body pre {
  margin: 0;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  color: #f8f8f2;
  line-height: 1.7;
}

/* ===== PRACTICE SECTION ===== */
.practice-section {
  background: #f0f2f5;
  padding: 5rem 0;
}

.practice-card {
  padding: 0;
  overflow: hidden;
}

.practice-header {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.practice-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  color: white;
  transition: all 0.3s ease;
}

.practice-card:hover .practice-icon {
  transform: scale(1.1) rotate(10deg);
}

.beginner .practice-icon {
  background: linear-gradient(135deg, #28a745, #34ce57);
  box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.intermediate .practice-icon {
  background: linear-gradient(135deg, #ffc107, #ffda6a);
  box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3);
  color: #333;
}

.advanced .practice-icon {
  background: linear-gradient(135deg, #dc3545, #e4606d);
  box-shadow: 0 10px 30px rgba(220, 53, 69, 0.3);
}

.practice-title {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--dark-color);
}

.practice-body {
  padding: 1.5rem;
}

.practice-desc {
  color: #6c757d;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.practice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.practice-list li {
  padding: 0.5rem 0;
  color: #495057;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.practice-list li:hover {
  padding-left: 5px;
  color: var(--primary-color);
}

.practice-list .fa-check-circle {
  color: var(--primary-color);
}

/* ===== ABOUT SECTION ===== */
.about-section {
  background: #f7f8fb;
  padding: 5rem 0;
}

.about-text {
  color: #495057;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  transition: all 0.3s ease;
}

.about-feature:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

.about-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.about-feature h5 {
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--dark-color);
}

/* Stats Container */
.glass-stats {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.stat-circle {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 119, 144, 0.1), rgba(0, 153, 170, 0.05));
  border-radius: 20px;
  transition: all 0.3s ease;
}

.stat-circle:hover {
  transform: translateY(-5px);
  background: linear-gradient(135deg, rgba(0, 119, 144, 0.15), rgba(0, 153, 170, 0.1));
}

.stat-number-large {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label-large {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ===== FOOTER ===== */
.glass-footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 3rem 0 2rem;
  position: relative;
}

.glass-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.footer-text {
  opacity: 0.8;
}

/* ===== SYNTAX HIGHLIGHTING ===== */
.keyword { color: #ff79c6; font-weight: 600; }
.string { color: #f1fa8c; }
.comment { color: #6272a4; font-style: italic; }
.builtin { color: #8be9fd; font-weight: 500; }
.function { color: #50fa7b; font-weight: 600; }
.literal { color: #bd93f9; font-weight: 600; }
.number { color: #bd93f9; font-weight: 600; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
  .hero-section {
    min-height: auto;
    padding: 4rem 0;
  }
  
  .hero-section .row {
    min-height: auto;
  }
  
  .hero-content {
    text-align: center;
    margin-bottom: 3rem;
  }
  
  .hero-description {
    margin: 0 auto;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .code-window {
    transform: none;
    max-width: 100%;
  }
  
  .code-window:hover {
    transform: scale(1.02);
  }
  
  .display-3 {
    font-size: 2.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  .brand-text {
    font-size: 1.1rem;
  }
  
  .nav-glass-link {
    margin: 0.5rem 0;
    text-align: center;
  }
  
  .display-3 {
    font-size: 2rem;
  }
  
  .btn-glass,
  .btn-outline-glass {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .hero-stats .row {
    flex-direction: column;
  }
  
  .stat-item {
    margin-bottom: 1rem;
  }
  
  .feature-card,
  .practice-card,
  .code-example-card {
    margin-bottom: 1rem;
  }
  
  .glass-stats {
    padding: 2rem 1rem;
  }
  
  .stat-circle {
    margin-bottom: 1rem;
  }
  
  .code-content {
    font-size: 0.8rem;
    padding: 15px;
  }
  
  .about-feature {
    margin-bottom: 1rem;
  }
}

@media (max-width: 575px) {
  .display-3 {
    font-size: 1.75rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .section-badge {
    font-size: 0.75rem;
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .practice-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .stat-number-large {
    font-size: 2rem;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

/* Scroll reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

/* ===== SELECTION STYLING ===== */
::selection {
  background: rgba(0, 119, 144, 0.3);
  color: var(--dark-color);
}

/* ===== UTILITY CLASSES ===== */
.text-primary-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.shadow-glass {
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
