/* === RESET & BASE === */
* {
  margin: 0; padding: 0; box-sizing: border-box;
}
body {
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #1b2044, #2f3266, #004c7f);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Light Mode */
body.light-mode {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0, #cbd5e1);
  color: #1a202c;
}

body.light-mode .header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: white;
}

body.light-mode .service-card {
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .service-card:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-10px) scale(1.02);
}

body.light-mode .service-card .service-name,
body.light-mode .service-card .service-tagline,
body.light-mode .service-card .service-description {
  color: #2d3748;
}

body.light-mode .featured-article-card {
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .featured-article-title {
  color: #2d3748;
}

body.light-mode .typing-hello {
  color: #2d3748;
}

body.light-mode h1, body.light-mode h2, body.light-mode h3 {
  color: #2d3748;
}

body.light-mode .slogan {
  color: rgba(45, 55, 72, 0.8);
}

body.light-mode .main-nav a {
  color: #2d3748;
  background: rgba(255, 255, 255, 0.9);
}

body.light-mode .main-nav a:hover {
  background: rgba(255, 255, 255, 1);
  color: #667eea;
}

body.light-mode .breadcrumb-list a {
  color: #667eea;
}

body.light-mode .stat-number {
  color: #2d3748;
}

body.light-mode .stat-label {
  color: rgba(45, 55, 72, 0.8);
}

body.light-mode .services-title {
  color: #2d3748;
}

body.light-mode .footer {
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
}

body.light-mode .footer a {
  color: #667eea;
}

body.light-mode .footer p {
  color: #2d3748;
}

body.light-mode .top-banner {
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
}

body.light-mode .top-banner a {
  color: #2d3748;
}

body.light-mode .articles-header h2 {
  color: #2d3748;
}

body.light-mode .articles-toggle {
  color: #2d3748;
}

body.light-mode .articles-container {
  background: rgba(255, 255, 255, 0.95);
}

body.light-mode .article-card {
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .article-card h3 {
  color: #2d3748;
}

body.light-mode .article-card p {
  color: rgba(45, 55, 72, 0.8);
}

body.light-mode .article-meta {
  color: rgba(45, 55, 72, 0.6);
}

body.light-mode .breadcrumb-list {
  color: #2d3748;
}

body.light-mode .breadcrumb-list li {
  color: #2d3748;
}

body.light-mode .language-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #2d3748;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .language-options {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .language-option {
  color: #2d3748;
}

body.light-mode .language-option:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 12px 20px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.theme-toggle i {
  font-size: 16px;
}

body.light-mode .theme-toggle {
  background: rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(0, 0, 0, 0.2);
  color: #2d3748;
}

body.light-mode .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Service Logo Styles */
.service-logo {
  transition: all 0.3s ease;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.service-logo:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

body.light-mode .service-logo {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode .service-logo:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* === DECORATIVE SHAPES === */
.shape {
  position: absolute; opacity: 0.05; z-index: 0;
  animation: float 25s ease-in-out infinite alternate;
}
.circle { width:200px; height:200px; border-radius:50%; background:#ffcc00; top:10%; left:15%; }
.square { width:140px; height:140px; background:#00ffcc; top:55%; left:25%; }
.triangle {
  width:0; height:0;
  border-left:90px solid transparent;
  border-right:90px solid transparent;
  border-bottom:140px solid #ff6a00;
  top:35%; right:15%;
}
.hexagon {
  width:160px; height:90px; background:#10b981;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  top:25%; left:65%;
}
@keyframes float {
  0%   { transform: translate(0,0) rotate(0); }
  50%  { transform: translate(20px,-20px) rotate(180deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}

/* === SLIDESHOW STYLES === */
.slideshow-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  background-color: #f0f0f0; /* Debug: visible background */
}

.slideshow-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: center;
}

.slide:first-child {
  opacity: 1;
}

.slide.active {
  opacity: 1;
}

.slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
  padding: 2rem;
  margin: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.slide-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: white;
  font-weight: 600;
}

.slide-content p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.slideshow-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 3;
}

.slide-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.slide-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.slide-indicators {
  display: flex;
  gap: 10px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active,
.indicator:hover {
  background: white;
  transform: scale(1.2);
}

/* === FEATURED ARTICLES STYLES === */
.featured-articles-section {
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  margin: 2rem 0;
}

.featured-articles-container {
  max-width: 1400px;
  margin: 0 auto;
}

.featured-articles-header {
  text-align: center;
  margin-bottom: 3rem;
}

.featured-articles-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.featured-articles-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
}

body.light-mode .featured-articles-subtitle {
  color: rgba(45, 55, 72, 0.8);
}

.featured-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.featured-article-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
  position: relative;
}

.featured-article-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.featured-article-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.featured-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-article-card:hover .featured-article-image img {
  transform: scale(1.1);
}

.featured-article-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #ff6b6b, #ffa726);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.featured-article-content {
  padding: 1.5rem;
}

.featured-article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.featured-article-category {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-weight: 500;
}

.featured-article-date {
  color: rgba(255, 255, 255, 0.6);
}

body.light-mode .featured-article-date {
  color: rgba(45, 55, 72, 0.6);
}

.featured-article-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.featured-article-excerpt {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

body.light-mode .featured-article-excerpt {
  color: rgba(45, 55, 72, 0.8);
}

.featured-article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.featured-article-stats {
  display: flex;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

body.light-mode .featured-article-stats {
  color: rgba(45, 55, 72, 0.6);
}

.featured-article-stats span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.featured-article-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.featured-article-link:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateX(5px);
}

/* === HEADER & TYPING === */

.header {
  text-align: center;
  background:
    linear-gradient(135deg, #6c50c6 0%, #a864d8 50%, #e2657b 100%),
    linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: cover, 40px 40px, 40px 40px;
  background-repeat: repeat;
  background-position: center;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
  color: #f8f8f8;
  animation: bounceInTop 1s ease both;
}
.header .slogan {
  font-size: 1rem;
  color: #fff;
  margin-top: .5rem;
}
.header .typing-hello {
  margin-top: .8rem;
  font-size: 1rem;
  font-family: monospace;
  color: #ffeefa;
  animation: typing 5s steps(40, end) infinite;
}
.logo {
  width:80px; margin:0 auto .5rem;
  animation: bounceIn 0.8s ease both;
}
.header h1 {
  font-size:2.6rem; margin-bottom:.3rem;
  animation: bounceIn 1s ease both;
}
.header h1 {
  font-size: 2.5rem;
  color: #f0f2f5;
  margin: .5rem 0;
  text-shadow: 1px 5px 4px #ffffff85;
}
.slogan {
  font-style:italic; color:#ddd; margin-bottom:.5rem;
}
.typing-hello {
  font-family: monospace; color:#ffe873; font-size:1.2rem;
  overflow:hidden; white-space:nowrap; border-right:.15em solid #ffe873;
  display:inline-block;
  animation: typing 4s steps(30,end) 1, blink-caret .75s step-end infinite;
}
@keyframes typing { from{width:0} to{width:100%} }
@keyframes blink-caret { 50%{border-color:transparent} }
@keyframes bounceInTop {
  0% { opacity:0; transform:translateY(-150px) scale(0.8); }
  50%{ opacity:1; transform:translateY(20px) scale(1.05); }
 100%{ transform:translateY(0) scale(1); }
}
@keyframes bounceIn {
 0% { opacity:0; transform:scale(0.3); }
 50%{ opacity:1; transform:scale(1.05); }
100%{ transform:scale(1); }
}

/* === NAV === */
.main-nav {
  display:flex; justify-content:center; gap:2rem;
  padding:.8rem 0; background:rgba(255,255,255,0.1);
  backdrop-filter:blur(6px); position:relative; z-index:2;
}
.main-nav a {
  color:#fff; text-decoration:none; font-weight:600;
  transition:color .3s;
}
.main-nav a:hover { color:#ffe873; }

/* === PUZZLE PIECES === */
.main-menu {
  display:flex; justify-content:center; gap:0; padding:2rem 1rem;
  flex-wrap:wrap; position:relative; z-index:1;
}
.puzzle-piece {
  width:240px; height:320px;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:1.2rem; font-weight:600; text-align:center;
  text-decoration:none;
  box-shadow:0 12px 24px rgba(0,0,0,0.3);
  transition:transform .3s,box-shadow .3s;
  background-size: cover; background-repeat: no-repeat;
}
.puzzle-piece:hover {
  transform:translateY(-10px);
  box-shadow:0 18px 36px rgba(0,0,0,0.5);
}
.piece-left {
  background-image: url('/assets/left.svg');
  animation: slide-in-left 1s ease both;
}
.piece-middle {
  background-image: url('/assets/middle.svg');
  animation: slide-in-top 1.2s ease both;
}
.piece-right {
  background-image: url('/assets/right.svg');
  animation: slide-in-right 1.4s ease both;
}
@keyframes slide-in-left {
  from{opacity:0;transform:translateX(-200px) scale(.7);} to{opacity:1;transform:translateX(0) scale(1);}
}
@keyframes slide-in-right {
  from{opacity:0;transform:translateX(200px) scale(.7);} to{opacity:1;transform:translateX(0) scale(1);}
}
@keyframes slide-in-top {
  from{opacity:0;transform:translateY(-200px) scale(.7);} to{opacity:1;transform:translateY(0) scale(1);}
}

/* === MENU ICON === */
.menu-icon {
  width:64px; height:64px; margin-bottom:1rem;
}

/* === FOOTER === */
.footer {
  padding:1rem; text-align:center;
  background:rgba(255,255,255,0.05);
  border-top:1px solid rgba(255,255,255,0.1);
  font-size:.9rem; color:#ccc; position:relative; z-index:1;
}
/* === CANVAS CONTAINER === */
.canvas-container {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

/* Viền bo tròn & đổ bóng cho chính canvas */
#puzzleCanvas {
  border: 4px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  cursor: pointer;
  background: rgba(255,255,255,0.05);
}

/* === PUZZLE PIECES (nếu bạn dùng CSS/clip-path) === */
.puzzle {
  /* Bo cong nhẹ các góc tổng thể */
  border-radius: 8px;
  /* Đổ bóng để nhô lên */
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  transition: transform .3s, box-shadow .3s;
}
.puzzle:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.5);
}

/* Nếu bạn vẫn cần canh “miếng” riêng rẽ với clip-path: */
.puzzle-container {
  gap: 40px; /* để các bump/hole không chồng nhau */
}

/* Tối ưu hiển thị khi zoom nhỏ */
@media (max-width: 768px) {
  #puzzleCanvas {
    width: 100%;
    height: auto;
  }
  .puzzle {
    width: calc((100% - 80px)/3);
    height: auto;
  }
}



body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at center, #0a0a1f 0%, #080820 70%, #000000 100%);
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

.header {
  text-align: center;
  padding: 1rem;
}
.header .logo {
  width: 80px;
  height: auto;
}
.header h1 {
  font-size: 2.5rem;
  color: #00ffff;
  margin: .5rem 0;
}
.slogan {
  font-size: 1.2rem;
  color: #ccc;
}
.typing-hello {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: #88ccff;
  font-family: monospace;
  animation: typing 5s steps(30, end) infinite;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #88ccff;
  box-sizing: border-box;
}
@keyframes typing {
  0% { width: 0; }
  50% { width: 100%; }
  100% { width: 0; }
}

.main-nav {
  text-align: center;
}
.main-nav a {
  display: inline-block;
  margin: 0 .7rem;
  padding: .6rem 1.2rem;
  color: #00ffff;
  text-decoration: none;
  border: 1px solid #00ffff;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}
.main-nav a:hover {
  background: #00ffff;
  color: #000;
}

.main-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
  padding: 4rem 2rem;
  position: relative;
  z-index: 1;
}


.footer {
  text-align: center;
  padding: 1rem;
  font-size: .9rem;
  color: #666;
}

/* QUIZ floating box */
.quiz-box {
  position: absolute;
  bottom: 2rem;         /* đưa xuống dưới */
  right: 5%;
  transform: rotate(-1.5deg);
  padding: 0.8rem 1.8rem;
  max-width: 300px;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 14px 14px 14px 6px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 1.6rem;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0,255,255,0.3);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 8px rgba(0,255,255,0.15), inset 0 0 6px rgba(0,255,255,0.1);
  z-index: 2; /* thấp hơn */
  pointer-events: none; /* không chặn click các thứ bên trên */
  opacity: 0.7;
}

.quiz-box::after {
  content: "";
  position: absolute;
  bottom: -14px;
  right: 16px;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-top-color: rgba(0, 255, 255, 0.3);
  filter: drop-shadow(0 0 4px rgba(0,255,255,0.2));
  transform: rotate(5deg);
}

/* Floating symbols around */
.symbol {
  position: absolute;
  font-size: calc(1rem + 1.5vw);
  color: rgba(0, 200, 255, 0.3);
  opacity: 0.3;
  animation: floatSymbol 14s infinite linear;
  z-index: 1; /* chìm dưới flashcard */
  pointer-events: none;
  transform: translateY(100vh) scale(0.8) rotate(0deg);
}

@keyframes floatSymbol {
  0%   { transform: translateY(100vh) scale(0.8) rotate(0deg); opacity: 0; }
  20%  { opacity: 0.4; }
  80%  { opacity: 0.5; }
  100% { transform: translateY(-10vh) scale(1.2) rotate(360deg); opacity: 0; }
}



.main-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* === LANGUAGE SELECTOR === */
.language-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.language-dropdown {
  position: relative;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.language-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.language-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.language-option:hover {
  background: rgba(0, 0, 0, 0.1);
}

.language-option.active {
  background: rgba(67, 56, 202, 0.1);
  color: #4338ca;
}

.flag-icon {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.flag-en {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA2NCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjQ4IiBmaWxsPSIjMDEyMTY5Ii8+CjxwYXRoIGQ9Ik0wIDEyVjM2SDIxLjMzMzNMMCAxMloiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0wIDM2VjEySDIxLjMzMzNMMCA0OFYzNloiIGZpbGw9IiNEODJCNTQiLz4KPHBhdGggZD0iTTY0IDEyVjM2SDQyLjY2NjdMNjQgMTJaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNNjQgMzZWMTJINDIuNjY2N0w2NCA0OFYzNloiIGZpbGw9IiNEODJCNTQiLz4KPHN0cmlwZSB3aWR0aD0iNjQiIGhlaWdodD0iNCIgZmlsbD0iI0Q4MkI1NCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAyMikiLz4KPHN0cmlwZSB3aWR0aD0iNCIgaGVpZ2h0PSI0OCIgZmlsbD0iI0Q4MkI1NCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzAgMCkiLz4KPC9zdmc+');
}

.flag-vi {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA2NCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjQ4IiBmaWxsPSIjREEyNTFEIi8+Cjxwb2x5Z29uIHBvaW50cz0iMzIsOCIDNiwzMiAzMiwzMiA1OCwyNCAzMiw4IiBmaWxsPSIjRkZERDE5Ii8+Cjwvc3ZnPg==');
}

.flag-zh {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA2NCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjQ4IiBmaWxsPSIjREUyOTEwIi8+Cjxwb2x5Z29uIHBvaW50cz0iOSw4IDEzLDIwIDUsMTUgMTMsMTUgNSwyMCIgZmlsbD0iI0ZGRkVGRiIvPgo8Y2lyY2xlIGN4PSIyNCIgY3k9IjEyIiByPSIyIiBmaWxsPSIjRkZGRUZGIi8+CjxjaXJjbGUgY3g9IjI4IiBjeT0iMTgiIHI9IjEiIGZpbGw9IiNGRkZFRkYiLz4KPGNpcmNsZSBjeD0iMjQiIGN5PSIyNCIgcj0iMSIgZmlsbD0iI0ZGRkVGRiIvPgo8Y2lyY2xlIGN4PSIxOSIgY3k9IjIwIiByPSIxIiBmaWxsPSIjRkZGRUZGIi8+Cjwvc3ZnPg==');
}

.flag-zht {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA2NCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjQ4IiBmaWxsPSIjMDA1OEI4Ii8+CjxjaXJjbGUgY3g9IjE2IiBjeT0iMTIiIHI9IjYiIGZpbGw9Im5vbmUiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMSIvPgo8Y2lyY2xlIGN4PSIxNiIgY3k9IjEyIiByPSIyIiBmaWxsPSJ3aGl0ZSIvPgo8cG9seWdvbiBwb2ludHM9IjQsNCA0LDIwIDQ4LDIwIDQ4LDQiIGZpbGw9IiNGRjAwMDAiLz4KPHBvbHlnb24gcG9pbnRzPSI0LDI4IDQsNDQgNDgsNDQgNDgsMjgiIGZpbGw9IiNGRjAwMDAiLz4KPHBvbHlnb24gcG9pbnRzPSI0LDE2IDQsMzIgMTYsMzIgMTYsMTYiIGZpbGw9IiNGRjAwMDAiLz4KPC9zdmc+');
}

/* === BREADCRUMB === */
.breadcrumb {
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
}

.breadcrumb-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.breadcrumb-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.breadcrumb-item.active span {
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
}

/* === HERO SECTION === */
.hero-main {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border-radius: 20px;
  margin: 2rem auto;
  max-width: 900px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
  margin-bottom: 1rem;
}

.hero-description {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto 2rem auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 120px;
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === MODERN SERVICES GRID === */
.services-grid {
  padding: 3rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.services-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: slideInDown 0.8s ease-out;
}

.services-title i {
  font-size: 2rem;
  color: #ff6b6b;
  animation: pulse 2s infinite;
}

.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .services-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .language-selector {
    top: 10px;
    right: 10px;
  }
  
  .language-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .hero-main {
    margin: 1rem;
    padding: 1.5rem 1rem;
  }
  
  .hero-subtitle {
    font-size: 1.8rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .services-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
  
  .services-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .service-card {
    padding: 1.5rem;
    min-height: 250px;
  }
  
  .service-content {
    gap: 1rem;
  }
  
  .service-icon {
    width: 50px;
    height: 50px;
  }
  
  .service-icon i {
    font-size: 1.5rem;
  }
  
  .service-name {
    font-size: 1.2rem;
  }
  
  .service-description {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .services-grid {
    padding: 2rem 0.5rem;
  }
  
  .hero-main {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
  }
  
  .hero-description {
    font-size: 0.9rem;
  }
  
  .service-card {
    padding: 1rem;
    min-height: 220px;
    border-radius: 16px;
  }
  
  .service-content {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  
  .service-icon {
    align-self: center;
  }
  
  .service-name {
    font-size: 1.1rem;
  }
  
  .service-tagline {
    font-size: 0.8rem;
  }
  
  .service-description {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .feature-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
  .services-container {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1600px;
    margin: 0 auto;
  }
  
  .hero-main {
    max-width: 1200px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.8);
    --background-card: rgba(255,255,255,0.05);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .service-card {
    border: 2px solid rgba(255,255,255,0.3);
  }
  
  .service-card:hover {
    border-color: rgba(255,255,255,0.6);
  }
  
  .feature-tag {
    border: 1px solid rgba(255,255,255,0.2);
  }
}

.service-card {
  position: relative;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.service-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.service-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.service-particle.particle-1 {
  top: 20%;
  left: 15%;
  animation-delay: 0s;
}

.service-particle.particle-2 {
  top: 60%;
  right: 20%;
  animation-delay: 2s;
}

.service-particle.particle-3 {
  bottom: 25%;
  left: 75%;
  animation-delay: 4s;
}

.service-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1.5rem;
  height: 100%;
}

.service-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.service-icon i {
  font-size: 1.8rem;
  color: #fff;
  transition: all 0.3s ease;
}

.service-svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.service-card:hover .service-svg {
  transform: scale(1.1);
}

/* SVG animations */
@keyframes svgFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.service-svg {
  animation: svgFloat 3s ease-in-out infinite;
}

.service-card:nth-child(1) .service-svg { animation-delay: 0s; }
.service-card:nth-child(2) .service-svg { animation-delay: 0.5s; }
.service-card:nth-child(3) .service-svg { animation-delay: 1s; }
.service-card:nth-child(4) .service-svg { animation-delay: 1.5s; }
.service-card:nth-child(5) .service-svg { animation-delay: 2s; }
.service-card:nth-child(6) .service-svg { animation-delay: 2.5s; }
.service-card:nth-child(7) .service-svg { animation-delay: 3s; }

.service-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.service-tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  margin: 0;
}

.service-description {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  margin: 0.5rem 0 1rem 0;
  flex: 1;
}

.service-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.feature-tag {
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  transition: all 0.3s ease;
}

.service-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 3;
  border-radius: 24px;
}

.service-card:hover .service-overlay {
  opacity: 1;
}

.service-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  transform: translateY(20px);
}

.service-card:hover .service-cta {
  transform: translateY(0);
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.service-cta i {
  font-size: 1.2rem;
}

/* Service-specific themes */
.service-card.gaming:hover .service-icon {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
}

.service-card.lms:hover .service-icon {
  background: linear-gradient(135deg, #4ecdc4, #00b894);
}

.service-card.cms:hover .service-icon {
  background: linear-gradient(135deg, #45b7d1, #0984e3);
}

.service-card.classroom:hover .service-icon {
  background: linear-gradient(135deg, #96ceb4, #55a3ff);
}

.service-card.dictionary:hover .service-icon {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

.service-card.tools:hover .service-icon {
  background: linear-gradient(135deg, #fd79a8, #e84393);
}

  .service-card.articles:hover .service-icon {
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

/* Additional animations for enhanced UX */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-in {
  animation: slideInUp 0.6s ease-out forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Performance optimization classes */
.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Loading states */
.service-card:not(.animate-in) {
  opacity: 0;
  transform: translateY(20px);
}/* Enhanced animated elements */
.animated-element {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.rocket {
  animation: rocketFloat 3s ease-in-out infinite;
}

@keyframes rocketFloat {
  0%, 100% { 
    transform: translateX(-50%) translateY(0) rotate(0deg); 
  }
  50% { 
    transform: translateX(-50%) translateY(-12px) rotate(5deg); 
  }
}

.book {
  animation: bookFloat 4s ease-in-out infinite;
}

@keyframes bookFloat {
  0%, 100% { 
    transform: translateX(-50%) rotate(0deg) scale(1); 
  }
  50% { 
    transform: translateX(-50%) rotate(8deg) scale(1.05); 
  }
}

.tools {
  animation: toolsFloat 3s ease-in-out infinite;
}

@keyframes toolsFloat {
  0%, 100% { 
    transform: translateX(-50%) scale(1) rotate(0deg); 
  }
  50% { 
    transform: translateX(-50%) scale(1.1) rotate(-5deg); 
  }
}

/* Enhanced flashcard titles */
.flashcard-title {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(0, 200, 255, 0.3);
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.6) 0%, 
    rgba(0, 0, 0, 0.4) 100%);
  border-radius: 15px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 80%;
  text-align: center;
  transition: all 0.3s ease;
  z-index: 4;
}

.flashcard:hover .flashcard-title {
  background: linear-gradient(135deg, 
    rgba(0, 200, 255, 0.3) 0%, 
    rgba(0, 0, 0, 0.6) 100%);
  border-color: rgba(0, 200, 255, 0.3);
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 15px rgba(0, 200, 255, 0.5);
}

/* Enhanced card captions */
.card-caption {
  text-align: center;
  margin-top: 1rem;
  font-size: 1rem;
  color: #e0e0e0;
  opacity: 0.9;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  padding: 0 1rem;
  line-height: 1.4;
  transition: all 0.3s ease;
}

.flashcard:hover + .card-caption {
  color: #00ccff;
  opacity: 1;
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.4);
}

/* Enhanced OR divider */
.or-divider {
  text-align: center;
  margin: 3rem 0 2rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  opacity: 0.8;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  position: relative;
}

.or-divider::before,
.or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.5) 50%, 
    transparent 100%);
}

.or-divider::before {
  left: calc(50% - 120px);
}

.or-divider::after {
  right: calc(50% - 120px);
}

/* Enhanced create quiz button */
.create-quiz-btn {
  width: 100%;
  max-width: 400px;
  text-align: center;
  margin: 0 auto;
}

.create-quiz-btn .flashcard.small {
  width: 100%;
  height: 120px;
  border-radius: 16px;
  background: linear-gradient(135deg, 
    rgba(255, 0, 200, 0.2) 0%, 
    rgba(100, 0, 255, 0.2) 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.create-quiz-btn .flashcard.small:hover {
  background: linear-gradient(135deg, 
    rgba(255, 0, 200, 0.3) 0%, 
    rgba(100, 0, 255, 0.3) 100%);
  border-color: rgba(255, 0, 200, 0.5);
  box-shadow: 
    0 0 25px rgba(255, 0, 200, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.create-quiz-btn .flashcard-title {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  font-size: 1.4rem;
  font-weight: 800;
  background: transparent;
  border: none;
  backdrop-filter: none;
  padding: 0;
  min-width: auto;
}

/* Enhanced animated plus */
.animated-plus {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  animation: plusPulse 2s ease-in-out infinite;
}

@keyframes plusPulse {
  0%, 100% { 
    transform: translateX(-50%) scale(1) rotate(0deg); 
    opacity: 1; 
  }
  50% { 
    transform: translateX(-50%) scale(1.3) rotate(180deg); 
    opacity: 0.8; 
  }
}

/* Enhanced responsive design */
@media (max-width: 1200px) {
  .flashcard-container {
    gap: 2rem;
  }
  
  .flashcard {
    width: 260px;
    height: 320px;
  }
}

@media (max-width: 768px) {
  .flashcard-container {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
  }

  .flashcard {
    width: 100%;
    max-width: 320px;
    height: 380px;
  }

  .flashcard-title {
    font-size: 1.4rem;
    padding: 0.6rem 1rem;
    bottom: 15px;
  }

  .card-caption {
    font-size: 0.95rem;
    margin-top: 0.8rem;
  }

  .or-divider {
    margin: 2rem 0 1.5rem;
    font-size: 1.2rem;
  }

  .or-divider::before,
  .or-divider::after {
    width: 40px;
  }

  .or-divider::before {
    left: calc(50% - 80px);
  }

  .or-divider::after {
    right: calc(50% - 80px);
  }

  .create-quiz-btn .flashcard.small {
    height: 100px;
  }

  .create-quiz-btn .flashcard-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .flashcard {
    max-width: 280px;
    height: 350px;
  }

  .flashcard .card-front,
  .flashcard .card-back {
    padding: 1.5rem 1rem;
  }

  .flashcard-title {
    font-size: 1.2rem;
    padding: 0.5rem 0.8rem;
  }

  .animated-element svg {
    width: 28px;
    height: 28px;
  }

  .or-divider::before,
  .or-divider::after {
    width: 30px;
  }

  .or-divider::before {
    left: calc(50% - 70px);
  }

  .or-divider::after {
    right: calc(50% - 70px);
  }
}

/* Enhanced particle effects */
.star-container,
.confetti-container,
.pencil-container,
.checkmark-container,
.gear-container,
.tool-icons {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.star {
  position: absolute;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FFD700' d='M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z'/%3E%3C/svg%3E");
  background-size: contain;
  animation: starTwinkle 3s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
}

@keyframes starTwinkle {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1) rotate(0deg); 
  }
  50% { 
    opacity: 0.6; 
    transform: scale(1.2) rotate(180deg); 
  }
}

/* Enhanced focus states for accessibility */
.flashcard:focus-visible {
  outline: 3px solid rgba(0, 200, 255, 0.7);
  outline-offset: 4px;
}

.create-quiz-btn .flashcard.small:focus-visible {
  outline: 3px solid rgba(255, 0, 200, 0.7);
  outline-offset: 4px;
}

/* Enhanced loading states */
.flashcard.loading {
  pointer-events: none;
  opacity: 0.7;
}

.flashcard.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(0, 200, 255, 0.8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

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

.flashcard-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.flashcard {
  width: 220px;
  height: 280px;
  perspective: 1000px;
  position: relative;
  cursor: pointer;
}

.flashcard .card-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  z-index: 1;
}

.flashcard .card-inner {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 0.8s;
  position: relative;
  z-index: 2;
}

.flashcard.flipped .card-inner {
  transform: rotateY(180deg);
}

.flashcard .card-front, .flashcard .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-shadow: 0 0 6px rgba(0,255,255,0.7);
  transition: background 0.3s;
}

.flashcard .card-front:hover {
  background: rgba(255,255,255,0.2);
}

.flashcard .card-back {
  transform: rotateY(180deg);
}

.create-quiz-btn {
  text-align: center;
  margin-top: 2rem;
}

.create-quiz-btn .small {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background: linear-gradient(45deg, #ff00cc, #3333ff);
  color: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(255,255,255,0.4);
  transition: transform 0.2s;
}

.create-quiz-btn .small:hover {
  transform: scale(1.1);
}

.card-image {
  display: block;
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  margin: auto;
  transition: transform 0.3s ease;
}

.flashcard:hover .card-image {
  transform: scale(1.05);
}
.flashcard-title {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 5px rgba(0,0,0,0.6), 0 0 10px rgba(0,0,0,0.6);
  padding: .4rem 1rem;
  background: rgba(0, 0, 0, 0.4);   /* nền mờ đen */
  border-radius: 12px;
  backdrop-filter: blur(4px);       /* nếu trình duyệt hỗ trợ */
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  width: 100%;
}

.card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 100%;
  padding: 1rem;
  border-radius: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
  font-size: 1.4rem;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: transform 0.5s;
}

.card-front .material-symbols-outlined {
  font-size: 6rem;
  color: white;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

.flashcard-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-align: center;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}


html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.main-menu {
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 2rem 1rem;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.15);  /* nhẹ, trong suốt */
  color: #bbb;
  font-size: 0.9rem;
  text-align: center;
  z-index: 999;
  backdrop-filter: blur(4px);  /* hiệu ứng mờ background dưới */
}

.footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.footer .dmca-badge img {
  max-width: 120px;
  height: auto;
}



/* Mô tả dưới mỗi thẻ */
.card-caption {
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: #f0f0f0;
  opacity: 0.85;
  font-style: italic;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Dòng OR giữa thẻ */
.or-divider {
  text-align: center;
  margin: 2rem 0 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffecb3;
  letter-spacing: 1px;
  opacity: 0.9;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}



.hero-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  margin-bottom: 4rem;
  min-height: 500px;
}

.img-new-hero-wrap {
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 3.25%, rgba(255, 255, 255, 0.04) 96.75%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(27px);
  -webkit-backdrop-filter: blur(27px);
  padding: 24px;
  max-width: 1100px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.hero-screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  margin: 1px auto 6rem auto!important;
}












.top-banner {
  background: linear-gradient(90deg, #9a3eaa, #b858c0);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.1rem 1.8rem;
  text-align: center;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
  position: relative;
  z-index: 100;
}

.top-banner a {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  transition: color 0.3s ease;
}

.top-banner a:hover {
  color: #ffeb3b;
}

.top-banner .arrow-icon {
  display: inline-block;
  transform: rotate(-90deg);  /* Ban đầu hướng lên */
  transition: transform 0.35s ease;
}

.top-banner a:hover .arrow-icon {
  transform: rotate(0deg);  /* Hover xoay ngang */
}



/* === RESPONSIVE === */
@media (max-width: 1024px) {
  /* Header giữ căn giữa và không bị lệch */
  .header {
    padding: 1.5rem 1rem;
  }
  .header h1 {
    font-size: 2rem;
  }
  .typing-hello {
    font-size: 1rem;
  }

  .main-nav a {
    margin: 0 .5rem;
    padding: .5rem 1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  /* Banner không lệch */
  .top-banner {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }

  /* Header căn giữa đẹp */
  .header h1 {
    font-size: 1.8rem;
  }
  .header .logo {
    width: 64px;
  }

  /* Puzzle, flashcard xếp dọc */
  .main-menu {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 2rem 1rem;
  }

  .flashcard-container {
    flex-direction: column;
    gap: 1.2rem;
  }

  .flashcard {
    width: 90%;
    max-width: 280px;
    height: auto;
  }

  /* Ảnh hero thu gọn vừa màn */
  .hero-section {
    margin: 2rem 0;
    padding: 0 1rem;
  }

  .img-new-hero-wrap {
    padding: 16px;
    max-width: 100%;
    border-radius: 20px;
  }

  .hero-screenshot {
    border-radius: 16px;
    margin-bottom: 2rem !important;
  }

  /* Footer fit mobile */
  .footer {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.6rem;
  }
  .main-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .main-nav a {
    flex: 1 1 auto;
    text-align: center;
    margin: 0.3rem 0;
  }

  .quiz-box {
    bottom: 1rem;
    right: 1rem;
    max-width: 240px;
    font-size: 1.2rem;
    padding: 0.6rem 1rem;
  }
}


@media (max-width: 768px) {
  .puzzle-piece {
    width: 90%;     /* hoặc: 80%, tuỳ ý bạn */
    max-width: 320px;
    height: auto;
    aspect-ratio: 3/4;  /* tự giữ tỉ lệ cao đẹp */
    font-size: 1.4rem;  /* vừa đủ đọc */
    padding: 1.2rem;
    margin-bottom: 1.2rem;
  }

  .puzzle-piece:hover {
    transform: translateY(-6px);
  }

  .or-divider {
    margin: 1.2rem 0;
    font-size: 1rem;
  }

  .quiz-box {
    font-size: 1.1rem;
    bottom: 1rem;
    right: 1rem;
    max-width: 220px;
  }
}



@media (max-width: 768px) {
  .flashcard-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .flashcard {
    width: 90%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .flashcard .card-inner {
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .create-quiz-btn {
    width: 90%;
    max-width: 300px;
  }

  .create-quiz-btn .flashcard.small {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 1;   /* nhỏ ngang, dễ đọc */
  }

  .or-divider {
    margin: 1.2rem 0;
    font-size: 1rem;
  }
}
.footer a[href^="/"] {
  color: #3a86ff;
  text-decoration: none;
  margin: 0 6px;
}

.footer a[href^="/"]:hover {
  color: #d62828;
  text-decoration: underline;
}

/* Add these styles to your existing CSS */

/* Animated Elements */
.animated-element {
  position: absolute;
  z-index: 2;
}

/* Rocket animation */
.rocket {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  animation: rocketFloat 3s ease-in-out infinite;
}

@keyframes rocketFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* Book animation */
.book {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  animation: bookFloat 4s ease-in-out infinite;
}

@keyframes bookFloat {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(5deg); }
}

/* Tools animation */
.tools {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  animation: toolsFloat 3s ease-in-out infinite;
}

@keyframes toolsFloat {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

/* Star container and stars */
.star-container {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.star {
  position: absolute;
  width: 15px;
  height: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FFD700' d='M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z'/%3E%3C/svg%3E");
  background-size: contain;
  animation: starTwinkle 2s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* Confetti */
.confetti-container {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 16px;
  background: linear-gradient(to bottom, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff);
  transform-origin: center;
  animation: confettiFall 3s ease-in-out infinite var(--delay);
  top: -10px;
  left: calc(10% + (var(--delay) * 30%));
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(150px) rotate(720deg); opacity: 0; }
}

/* Pencil container and pencils */
.pencil-container {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.pencil {
  position: absolute;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FFA500' d='M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87L20.71,7.04M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z'/%3E%3C/svg%3E");
  background-size: contain;
  animation: pencilSpin 4s linear infinite;
}

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

/* Checkmarks */
.checkmark-container {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.checkmark {
  position: absolute;
  width: 25px;
  height: 25px;
  top: calc(30% + (var(--delay) * 30%));
  left: calc(20% + (var(--delay) * 40%));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2300FF00' d='M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z'/%3E%3C/svg%3E");
  background-size: contain;
  animation: checkmarkPop 2s ease-in-out infinite var(--delay);
}

@keyframes checkmarkPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Gears */
.gear-container {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gear {
  position: absolute;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z'/%3E%3C/svg%3E");
  background-size: contain;
}

.gear-large {
  width: 50px;
  height: 50px;
  top: 60%;
  left: 70%;
  animation: gearRotate 10s linear infinite;
}

.gear-medium {
  width: 35px;
  height: 35px;
  top: 70%;
  left: 55%;
  animation: gearRotate 7s linear infinite reverse;
}

.gear-small {
  width: 25px;
  height: 25px;
  top: 65%;
  left: 40%;
  animation: gearRotate 5s linear infinite;
}

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

/* Tool icons */
.tool-icons {
  position: absolute;
  width: 100%;
  height: 100%;
}

.tool-icon {
  position: absolute;
  width: 30px;
  height: 30px;
  top: calc(40% + (var(--delay) * 20%));
  left: calc(30% + (var(--delay) * 30%));
  animation: toolIconFloat 3s ease-in-out infinite var(--delay);
}

@keyframes toolIconFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

/* Animated plus */
.animated-plus {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  animation: plusPulse 2s ease-in-out infinite;
}

@keyframes plusPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.2); opacity: 0.8; }
}

/* Shooting stars */
.shooting-star {
  position: absolute;
  width: 2px;
  height: 15px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  top: 20%;
  left: 80%;
  animation: shootingStar 3s linear infinite var(--delay);
}

@keyframes shootingStar {
  0% { transform: translateX(0) translateY(0) rotate(45deg); opacity: 0; }
  10% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateX(-100px) translateY(100px) rotate(45deg); opacity: 0; }
}

/* Enhanced symbol animations */
.symbol.spinning {
  animation: symbolSpin 6s linear infinite;
}

.symbol.pulsing {
  animation: symbolPulse 3s ease-in-out infinite;
}

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

@keyframes symbolPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

/* === LANGUAGE SELECTOR === */
.language-selector {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.language-dropdown {
  position: relative;
  display: inline-block;
}

.language-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 80px;
}

.language-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.language-btn:active {
  transform: translateY(0);
}

.language-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.language-dropdown.active .language-menu {
  opacity: 1;
  visibility: visible;
}

/* === ENHANCED FLASHCARD DESIGN === */
.flashcard-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  justify-items: center;
}

.flashcard {
  width: 100%;
  max-width: 260px;
  height: 320px;
  justify-self: center;
  perspective: 1200px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.15));
}

.flashcard:hover {
  transform: translateY(-4px) scale(1.02);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.flashcard .card-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  z-index: 1;
  transition: all 0.3s ease;
}

.flashcard .card-inner {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 2;
}

.flashcard.flipped .card-inner {
  transform: rotateY(180deg);
}

.flashcard .card-front, .flashcard .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  overflow: hidden;
}

.flashcard .card-front::before,
.flashcard .card-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  border-radius: inherit;
  z-index: -1;
}

.flashcard .card-front:hover {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.25);
}

.flashcard .card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.06) 100%);
}

/* === CARD ICON STYLING === */
.card-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 3;
  transition: all 0.3s ease;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.card-icon .card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.flashcard:hover .card-icon svg,
.flashcard:hover .card-icon .card-image {
  transform: scale(1.08) rotate(2deg);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* === ENHANCED CARD TITLES === */
.flashcard-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(255, 255, 255, 0.2);
  margin: 0;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.3) 0%, 
    rgba(0, 0, 0, 0.15) 100%);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 75%;
  transition: all 0.3s ease;
  z-index: 4;
  position: relative;
}

.flashcard:hover .flashcard-title {
  background: linear-gradient(135deg, 
    rgba(0, 200, 255, 0.25) 0%, 
    rgba(0, 0, 0, 0.3) 100%);
  border-color: rgba(0, 200, 255, 0.25);
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(0, 200, 255, 0.4);
  transform: translateY(-2px);
}

/* === CARD CAPTIONS === */
.card-caption {
  text-align: center;
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #e0e0e0;
  opacity: 0.85;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  padding: 0 0.5rem;
  line-height: 1.3;
  transition: all 0.3s ease;
  max-width: 260px;
}

.flashcard:hover + .card-caption {
  color: #00ccff;
  opacity: 1;
  text-shadow: 0 0 6px rgba(0, 200, 255, 0.3);
  transform: translateY(-1px);
}

/* === ENHANCED RESPONSIVE DESIGN === */
@media (max-width: 1200px) {
  .flashcard-container {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    padding: 1.2rem 0.8rem;
  }
  
  .flashcard {
    max-width: 240px;
    height: 300px;
  }

  .card-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 0.8rem;
  }

  .flashcard-title {
    font-size: 1.3rem;
    padding: 0.5rem 0.7rem;
  }
}

@media (max-width: 768px) {
  .flashcard-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 0.5rem;
  }

  .flashcard {
    max-width: 100%;
    height: 280px;
  }

  .flashcard .card-front, 
  .flashcard .card-back {
    padding: 1.2rem 0.8rem;
  }

  .card-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 0.7rem;
  }

  .flashcard-title {
    font-size: 1.2rem;
    padding: 0.4rem 0.6rem;
  }

  .card-caption {
    font-size: 0.85rem;
    margin-top: 0.6rem;
  }
}

@media (max-width: 640px) {
  .flashcard-container {
    gap: 0.8rem;
    padding: 0.8rem 0.3rem;
  }

  .flashcard {
    height: 260px;
  }

  .flashcard .card-front, 
  .flashcard .card-back {
    padding: 1rem 0.6rem;
  }

  .card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.6rem;
  }

  .flashcard-title {
    font-size: 1.1rem;
    padding: 0.3rem 0.5rem;
  }

  .card-caption {
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .flashcard-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0.5rem;
  }

  .flashcard {
    max-width: 100%;
    height: 280px;
  }

  .flashcard .card-front, 
  .flashcard .card-back {
    padding: 1.2rem 0.8rem;
  }

  .card-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 0.8rem;
  }

  .flashcard-title {
    font-size: 1.2rem;
    padding: 0.4rem 0.6rem;
  }

  .card-caption {
    font-size: 0.85rem;
    margin-top: 0.6rem;
  }
}

@media (max-width: 360px) {
  .flashcard-container {
    padding: 0.8rem 0.3rem;
    gap: 0.8rem;
  }

  .flashcard {
    height: 260px;
  }

  .flashcard .card-front, 
  .flashcard .card-back {
    padding: 1rem 0.6rem;
  }

  .card-icon {
    width: 48px;
    height: 48px;
  }

  .flashcard-title {
    font-size: 1.1rem;
    padding: 0.3rem 0.5rem;
  }
}

/* === LANDSCAPE TABLET OPTIMIZATION === */
@media (max-width: 1024px) and (orientation: landscape) {
  .flashcard-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .flashcard {
    max-width: 200px;
    height: 240px;
  }

  .card-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.6rem;
  }

  .flashcard-title {
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
  }

  .card-caption {
    font-size: 0.75rem;
    margin-top: 0.4rem;
  }
}

/* === LARGE SCREEN OPTIMIZATION === */
@media (min-width: 1600px) {
  .flashcard-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
  }

  .flashcard {
    max-width: 300px;
    height: 360px;
  }

  .card-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 1.2rem;
  }

  .flashcard-title {
    font-size: 1.6rem;
    padding: 0.7rem 1rem;
  }

  .card-caption {
    font-size: 1rem;
    margin-top: 1rem;
  }
}

/* === MODERN HOVER STATES === */
.flashcard:nth-child(1):hover {
  box-shadow: 0 0 25px rgba(102, 126, 234, 0.3);
}

.flashcard:nth-child(2):hover {
  box-shadow: 0 0 25px rgba(240, 147, 251, 0.3);
}

.flashcard:nth-child(3):hover {
  box-shadow: 0 0 25px rgba(250, 112, 154, 0.3);
}

.flashcard:nth-child(4):hover {
  box-shadow: 0 0 25px rgba(102, 126, 234, 0.3);
}

.flashcard:nth-child(5):hover {
  box-shadow: 0 0 25px rgba(67, 233, 123, 0.3);
}

.flashcard:nth-child(6):hover {
  box-shadow: 0 0 25px rgba(253, 116, 108, 0.3);
}

/* === HOVER STATES FOR TOUCH DEVICES === */
@media (hover: none) and (pointer: coarse) {
  .flashcard:hover {
    transform: none;
    filter: none;
  }

  .flashcard:active {
    transform: translateY(-4px) scale(0.98);
    transition: transform 0.1s ease;
  }

  .flashcard-title {
    background: linear-gradient(135deg, 
      rgba(0, 200, 255, 0.2) 0%, 
      rgba(0, 0, 0, 0.5) 100%);
    border-color: rgba(0, 200, 255, 0.2);
  }
}

/* === ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
  .flashcard,
  .card-icon svg,
  .card-icon .card-image,
  .flashcard-title {
    animation: none !important;
    transition: opacity 0.3s ease !important;
  }

  .flashcard-container {
    animation: none !important;
  }
}

/* === PRINT STYLES === */
@media print {
  .flashcard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .flashcard {
    width: 200px;
    height: 250px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .card-caption {
    display: none;
  }
}

/* === HIGH DPI DISPLAYS === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card-icon svg,
  .card-icon .card-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* === LATEST ARTICLES SECTION === */
.articles-section {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  margin: 3rem auto;
  max-width: 1400px;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.articles-section.collapsed .articles-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.articles-container {
  padding: 0;
}

.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(108, 80, 198, 0.3), rgba(168, 100, 216, 0.3));
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.articles-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.articles-header h2 i {
  color: #ffcc00;
  font-size: 1.5rem;
}

.toggle-articles-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.toggle-articles-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.articles-section.collapsed .toggle-articles-btn i {
  transform: rotate(180deg);
}

.toggle-articles-btn i {
  transition: transform 0.3s ease;
}

.articles-content {
  padding: 2rem;
  max-height: 1000px;
  opacity: 1;
  transition: all 0.3s ease;
}

.articles-loading {
  text-align: center;
  padding: 3rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffcc00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.articles-loading p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.article-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 204, 0, 0.5);
}

.article-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(108, 80, 198, 0.3), rgba(168, 100, 216, 0.3));
}

.article-card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.3);
}

.article-card-content {
  padding: 1.25rem;
}

.article-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.article-card-excerpt {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.article-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.article-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-card-author i {
  color: #ffcc00;
}

.article-card-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-card-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.article-card-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.articles-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.articles-empty i {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
}

.articles-empty p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.btn-create-article {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #6c50c6, #a864d8);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-create-article:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 80, 198, 0.4);
}

.articles-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-view-all:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .articles-section {
    margin: 2rem 1rem;
  }

  .articles-header {
    padding: 1rem 1.5rem;
  }

  .articles-header h2 {
    font-size: 1.5rem;
  }

  .articles-content {
    padding: 1rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
