/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Prevent browser from remembering scroll position */
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  background-attachment: fixed;
  transition: all 0.3s ease;
  min-height: 100vh;
  /* Force page to start at top */
  overflow-x: hidden;
  /* Optimize animations */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
.header {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #2c3e50;
  padding: 0.75rem 0;
  box-shadow: 0 2px 32px rgba(0, 0, 0, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(229, 229, 229, 0.6);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 70px;
  display: flex;
  align-items: center;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.12);
  padding: 0.5rem 0;
  height: 60px;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  transition: all 0.3s ease;
  cursor: pointer;
}

.logo:hover {
  transform: translateY(-1px);
  color: #1a252f;
}

.logo i {
  margin-right: 8px;
  color: #2c3e50;
  font-size: 1.6rem;
  transition: all 0.3s ease;
}

.logo:hover i {
  color: #1a252f;
  transform: rotate(-10deg);
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: #2c3e50;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #1a252f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-link.active {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #2c3e50;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  transform: scale(1.05);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 1rem;
  z-index: 1001;
  position: relative;
}

.auth-buttons.logged-in {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.auth-buttons .btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1001;
  position: relative;
}

.user-menu.logged-out {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
  z-index: 9999 !important;
}

.user-name-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  font-weight: 600;
  color: #2c3e50;
  cursor: pointer;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.user-name-btn:hover {
  background: #f8f9fa;
  color: #000000;
  transform: translateY(-1px);
}

.dropdown-arrow {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.user-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 9999 !important;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #2c3e50;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background: #f8f9fa;
  color: #000000;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  font-size: 0.9rem;
}

.dropdown-item.vip-item i {
  color: #ffd700;
}

.dropdown-item.logout-item {
  color: #dc3545;
}

.dropdown-item.logout-item:hover {
  background: #fff5f5;
  color: #dc3545;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 0.5rem 0;
}

/* Part of Speech Badge */
.part-of-speech-badge {
  background: #e3f2fd;
  color: #1976d2;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #000000 0%, #2c3e50 100%);
  color: white;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2c3e50 0%, #495057 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Special styling for hero button */
.hero .btn-primary {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #000000 0%, #2c3e50 50%, #495057 100%);
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.hero .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
}

.hero .btn-primary:hover::before {
  left: 100%;
}

.hero .btn-primary:hover {
  background: linear-gradient(135deg, #2c3e50 0%, #495057 50%, #6c757d 100%);
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.btn-login {
  background: linear-gradient(135deg, transparent 0%, rgba(44, 62, 80, 0.05) 100%);
  color: #2c3e50;
  border: 2px solid #2c3e50;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: 8px;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  transition: left 0.3s ease;
  z-index: 0;
}

.btn-login:hover::before {
  left: 0;
}

.btn-login:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
  border-color: #2c3e50;
}

.btn-login span {
  position: relative;
  z-index: 1;
}

.btn-register {
  background: linear-gradient(135deg, #000000 0%, #2c3e50 100%);
  color: white;
  border: 2px solid #000000;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-register::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  transition: left 0.3s ease;
  z-index: 0;
}

.btn-register:hover::before {
  left: 0;
}

.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(44, 62, 80, 0.4);
  border-color: #2c3e50;
}

.btn-register span {
  position: relative;
  z-index: 1;
}

.btn-logout {
  background: #6c757d;
  color: white;
  padding: 0.5rem 1rem;
  border: 2px solid #6c757d;
}

.btn-logout:hover {
  background: #5a6268;
  border-color: #5a6268;
}

/* Main Content */
main {
  margin-top: 70px; /* Header height */
  position: relative;
  min-height: calc(100vh - 70px);
  transition: margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.scrolled main {
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}

/* Sections */
.section {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: calc(100vh - 70px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  will-change: transform, opacity;
  padding-top: 1rem;
}

.section.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 2;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 25%, #f1f3f4 75%, #e8eaed 100%);
  color: #2c3e50;
  padding: 1.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
              radial-gradient(circle at 70% 20%, rgba(44, 62, 80, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
  animation: fadeInUp 1s ease-out;
  font-weight: 600;
  background: linear-gradient(135deg, #000000 0%, #2c3e50 50%, #495057 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #000000, #2c3e50);
  border-radius: 2px;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s ease-out 0.2s both;
  color: #495057;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  font-weight: 400;
}

.hero .btn {
  animation: fadeInUp 1s ease-out 0.4s both;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.hero .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.hero .btn:hover::before {
  left: 100%;
}

/* Features */
.features {
  padding: 1rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 0, 0, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(44, 62, 80, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(108, 117, 125, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.features .container {
  position: relative;
  z-index: 1;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.feature-card {
  background: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #000000, #2c3e50, #495057);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.feature-card:nth-child(1):hover {
  transform: translateY(-15px);
  box-shadow: 0 25px 50px rgba(0, 123, 255, 0.2);
  border-color: #007bff;
}

.feature-card:nth-child(1) {
  animation: fadeInUp 0.6s ease-out 0.1s both;
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  border: 2px solid #e3f2fd;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.feature-card:nth-child(2) {
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.feature-card:nth-child(3) {
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.feature-card i {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #000000 0%, #2c3e50 50%, #495057 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  transition: all 0.3s ease;
}

.feature-card:hover i {
  transform: scale(1.1);
}

.feature-card h3 {
  color: #2c3e50;
  margin-bottom: 0.8rem;
  font-weight: 600;
  font-size: 1.2rem;
  position: relative;
}

.feature-card h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #000000, #2c3e50);
  transition: width 0.3s ease;
}

.feature-card:hover h3::after {
  width: 50px;
}

.feature-card p {
  color: #6c757d;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Public Vocabularies Section */
.public-vocabularies {
  padding: 4rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  position: relative;
}

.public-vocabularies::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 70%, rgba(0, 0, 0, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(44, 62, 80, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

.public-vocabularies .container {
  position: relative;
  z-index: 1;
}

.section-title {
  text-align: center;
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #000000, #2c3e50);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: #6c757d;
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.public-category-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.public-category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #28a745, #20c997, #17a2b8);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.public-category-card:hover::before {
  transform: scaleX(1);
}

.public-category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.public-category-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.public-category-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
  background: linear-gradient(135deg, #28a745 0%, #20c997 50%, #17a2b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.public-category-info h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.public-category-author {
  color: #6c757d;
  font-size: 0.9rem;
}

.public-category-description {
  color: #495057;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.public-category-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.public-category-stat {
  text-align: center;
}

.public-category-stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

.public-category-stat-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.public-category-actions {
  display: flex;
  gap: 1rem;
}

.btn-copy {
  flex: 1;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-copy:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-preview {
  background: #ffffff;
  color: #495057;
  border: 2px solid #dee2e6;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-preview:hover {
  border-color: #2c3e50;
  color: #2c3e50;
  transform: translateY(-2px);
}

.loading-message {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
  font-size: 1.1rem;
}

.loading-message i {
  margin-right: 0.5rem;
}

.error-message {
  text-align: center;
  padding: 3rem;
  color: #dc3545;
  font-size: 1.1rem;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  margin-top: 2rem;
}

.no-data-message {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.no-data-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  color: #adb5bd;
}

/* Category Preview Modal Styles */
.category-preview-info {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #28a745;
}

.category-preview-info h3 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.category-preview-info .category-meta {
  display: flex;
  gap: 2rem;
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.category-preview-info .category-description {
  color: #495057;
  line-height: 1.6;
}

.vocabularies-preview-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.vocabulary-preview-item {
  display: flex;
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.vocabulary-preview-item:last-child {
  border-bottom: none;
}

.vocabulary-preview-item:hover {
  background-color: #f8f9fa;
}

.vocabulary-preview-content {
  flex: 1;
}

.vocabulary-preview-word {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.vocabulary-preview-pronunciation {
  color: #6c757d;
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.vocabulary-preview-meaning {
  color: #495057;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.vocabulary-preview-example {
  color: #6c757d;
  font-size: 0.9rem;
  font-style: italic;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #17a2b8;
}

.vocabulary-preview-audio {
  margin-left: 1rem;
  display: flex;
  align-items: center;
}

.vocabulary-preview-audio button {
  background: #17a2b8;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vocabulary-preview-audio button:hover {
  background: #138496;
  transform: scale(1.1);
}

.vocabulary-preview-empty {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

.vocabulary-preview-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  color: #adb5bd;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
  margin-top: 1.5rem;
}

/* Responsive adjustments for preview modal */
@media (max-width: 768px) {
  .vocabulary-preview-item {
    flex-direction: column;
  }
  
  .vocabulary-preview-audio {
    margin-left: 0;
    margin-top: 0.5rem;
    justify-content: flex-start;
  }
  
  .category-preview-info .category-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Quiz Styles */
#quiz {
  padding: 2rem 0;
  background: #f8f9fa;
}

.quiz-setup {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 1px solid #e5e5e5;
}

.quiz-setup h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.quiz-options {
  display: flex;
  gap: 1.25rem 2rem;
  justify-content: center;
  margin: 1.75rem 0 1.5rem;
  flex-wrap: wrap;
}

.quiz-options label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #34495e;
  font-weight: 600;
}

.quiz-options select {
  height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.98rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quiz-options select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.12);
}

.quiz-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.quiz-progress {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
}

.quiz-timer {
  color: #dc3545;
  font-weight: 600;
}

.question {
  text-align: center;
  margin-bottom: 2rem;
}

.question h3 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.answers input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #ecf0f1;
  border-radius: 5px;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.answers input:focus {
  outline: none;
  border-color: #3498db;
}

/* Quiz Result */
.quiz-result {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.result-stats {
  display: flex;
  justify-content: space-around;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #3498db;
}

.stat-label {
  color: #7f8c8d;
}

/* Progress Styles */
#progress {
  padding: 2rem 0;
}

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

.progress-card {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.progress-circle {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
}

.circle-progress {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(#3498db 0deg, #ecf0f1 0deg);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.circle-progress::before {
  content: '';
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: white;
  position: absolute;
}

.circle-progress span {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
  z-index: 1;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ecf0f1;
}

.recent-activity {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 5px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  padding: 20px 0;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  margin: 0 auto;
  padding: 3rem 2.5rem;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  position: relative;
  min-height: fit-content;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.15),
    0 10px 40px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h2 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-align: center;
  font-size: 1.75rem;
  letter-spacing: -0.025em;
}

/* Add subtitle styling for better UX */
.modal-content p {
  text-align: center;
  margin-bottom: 2rem;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

.close {
  position: absolute;
  right: 1.25rem;
  top: 1.25rem;
  width: 32px;
  height: 32px;
  font-size: 1.25rem;
  cursor: pointer;
  color: #6c757d;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.close:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.close:active {
  transform: scale(0.95);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #ffffff;
  color: #2c3e50;
}

.form-group input:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-group select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  font-size: 1rem;
  background: #ffffff;
  color: #2c3e50;
  transition: all 0.3s ease;
}

.form-group select:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.modal-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.modal-footer p {
  color: #6c757d;
  margin: 0;
}

.modal-footer a {
  color: #000000;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.modal-footer a:hover {
  color: #2c3e50;
  text-decoration: underline;
}

/* Google Sign-In Button */
.btn-google {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #3c4043;
  border: 1px solid #dadce0;
  padding: 1rem 2rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  margin-top: 1rem;
  letter-spacing: 0.025em;
  min-height: 56px;
}

.btn-google::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-google:hover::before {
  left: 100%;
}

.btn-google:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-color: #c6c6c6;
  box-shadow: 0 8px 25px rgba(66, 133, 244, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.btn-google:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.btn-google:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-google i {
  font-size: 1.25rem;
  color: #4285f4;
  transition: all 0.3s ease;
}

.btn-google:hover i {
  transform: scale(1.1);
}

.btn-google.loading i {
  animation: googleSpinAnnounce 0.5s ease-in-out, googleSpin 1s linear infinite 0.5s;
}

.btn-google span {
  font-weight: 600;
  color: #3c4043;
  transition: opacity 0.3s ease;
}

.btn-google.loading span {
  opacity: 0.7;
}

/* Loading animation for Google button */
@keyframes googleSpinAnnounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

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

/* Enhanced Google brand colors */
.btn-google i.fab.fa-google {
  background: linear-gradient(45deg, #4285f4, #ea4335, #fbbc05, #34a853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Auth Divider */
.divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
}

.divider span {
  background: white;
  padding: 0 1rem;
  color: #666;
  font-size: 0.9rem;
}

/* Profile Modal Styles */
#profileModal .modal-content {
  max-width: 500px;
  width: 90%;
}

#profileModal .form-group {
  margin-bottom: 1.5rem;
}

#profileModal .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2c3e50;
}

#profileModal .form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

#profileModal .form-group input:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#profileModal .form-group input[readonly] {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

#profileModal .form-note {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.25rem;
  font-style: italic;
}

#profileModal .modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

#profileModal .modal-actions .btn {
  min-width: 100px;
}

/* Profile Form Validation Styles */
#profileModal .form-group.error input {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

#profileModal .form-group.success input {
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Account Status Section */
.account-status-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  border: 1px solid #e9ecef;
}

.account-status-section h3 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
}

.status-grid {
  display: grid;
  gap: 0.75rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  font-weight: 500;
  color: #6c757d;
}

.status-value {
  font-weight: 600;
  color: #2c3e50;
}

/* Avatar Upload Section */
.avatar-upload-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.current-avatar {
  flex-shrink: 0;
}

.current-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e9ecef;
  transition: all 0.3s ease;
}

.current-avatar img:hover {
  border-color: #000000;
  transform: scale(1.05);
}

.avatar-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.avatar-upload-controls .btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Profile Modal Section Headers */
#profileModal h3 {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

#profileModal h3:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Management Styles */
.management-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
}

.management-header h2 {
  color: #2c3e50;
  font-weight: 600;
  margin: 0;
}

.management-actions {
  display: flex;
  gap: 1rem;
}

.management-actions .btn {
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
}

.btn-success {
  background: #28a745;
  color: white;
  border: 2px solid #28a745;
}

.btn-success:hover {
  background: #218838;
  border-color: #218838;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: 2px solid #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
  border-color: #5a6268;
  transform: translateY(-1px);
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.category-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-card h3 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.category-card p {
  color: #6c757d;
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Game Styles */
.game-container {
  padding: 2rem 0;
  background: #f8f9fa;
  min-height: calc(100vh - 80px);
}

.game-setup {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 1px solid #e5e5e5;
  max-width: 600px;
  margin: 0 auto;
}

.game-setup h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.game-options {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.game-option label {
  color: #2c3e50;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.game-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.game-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 200px;
  justify-content: center;
}

.game-btn.matching {
  background: #000000;
  color: white;
  border: 2px solid #000000;
}

.game-btn.matching:hover {
  background: #2c3e50;
  border-color: #2c3e50;
  transform: translateY(-2px);
}

.game-btn.typing {
  background: transparent;
  color: #2c3e50;
  border: 2px solid #2c3e50;
}

.game-btn.typing:hover {
  background: #2c3e50;
  color: white;
  transform: translateY(-2px);
}
  background-color: white;
}

.form-group select:focus {
  outline: none;
  border-color: #3498db;
}

/* Required field styling */
.required-label .required,
.required {
  color: #dc3545;
  font-weight: 600;
}

.help-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6c757d;
  font-style: italic;
}

/* Loading Spinner */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  backdrop-filter: blur(5px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Tables Styles */
.words-table-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  overflow: hidden;
  margin: 1rem 0;
}

.words-table {
  width: 100%;
  border-collapse: collapse;
}

.words-table th {
  background: #f8f9fa;
  color: #2c3e50;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
  font-size: 0.9rem;
}

.words-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #f0f0f0;
  color: #2c3e50;
  font-size: 0.9rem;
}

.words-table tr:hover {
  background: #f8f9fa;
}

.words-table tr:last-child td {
  border-bottom: none;
}

/* Vocabulary Stats */
.vocabulary-stats {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  flex: 0 0 auto;
  min-width: 550px;
}

.activity-section {
  flex: 1;
  margin-top: 0 !important;
  margin-left: 1rem;
}

.stat-card {
  background: #ffffff;
  border-radius: 6px;
  padding: 0.6rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.stat-card.total .stat-icon {
  background: #e3f2fd;
  color: #1976d2;
}

.stat-card.learned .stat-icon {
  background: #e8f5e8;
  color: #28a745;
}

.stat-card.unlearned .stat-icon {
  background: #fff3cd;
  color: #ffc107;
}

.stat-card.progress .stat-icon {
  background: #f3e5f5;
  color: #9c27b0;
}

.stat-card.streak .stat-icon {
  background: #fff3cd;
  color: #fd7e14;
}

.stat-content {
  flex: 1;
}

.stat-sublabel {
  font-size: 0.55rem;
  color: #9ca3af;
  margin-top: 0.02rem;
}

.stat-number {
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.05rem;
}

.stat-label {
  color: #6c757d;
  font-size: 0.65rem;
  font-weight: 500;
}

/* Filters */
.filters {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e5e5;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-input-container {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.5rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  color: #2c3e50;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 1rem;
}

.clear-search {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.clear-search:hover {
  background: #f8f9fa;
  color: #dc3545;
}

.filters select {
  padding: 0.5rem;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  background: white;
  color: #2c3e50;
  font-size: 1rem;
  min-width: 150px;
}

.filters select:focus {
  outline: none;
  border-color: #000000;
}

@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input-container {
    min-width: unset;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e5e5;
  background: #ffffff;
  color: #2c3e50;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.pagination button:hover {
  border-color: #000000;
  background: #f8f9fa;
}

.pagination button.active {
  background: #000000;
  color: white;
  border-color: #000000;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Action Buttons */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border: 2px solid #dc3545;
}

.btn-danger:hover {
  background: #c82333;
  border-color: #c82333;
  transform: translateY(-1px);
}

.btn-warning {
  background: #ffc107;
  color: #212529;
  border: 2px solid #ffc107;
}

.btn-warning:hover {
  background: #e0a800;
  border-color: #e0a800;
  transform: translateY(-1px);
}

.btn-info {
  background: #17a2b8;
  color: white;
  border: 2px solid #17a2b8;
}

.btn-info:hover {
  background: #138496;
  border-color: #138496;
  transform: translateY(-1px);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #2c3e50;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 4000;
  font-weight: 500;
  border: 1px solid #495057;
  cursor: pointer;
  user-select: none;
  max-width: 350px;
  word-wrap: break-word;
}

.toast:hover {
  transform: translateX(0) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: #28a745;
  border-color: #28a745;
}

.toast.error {
  background: #dc3545;
  border-color: #dc3545;
}

.toast.warning {
  background: #ffc107;
  color: #212529;
  border-color: #ffc107;
}

.toast::after {
  content: '×';
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.toast:hover::after {
  opacity: 1;
}

/* Focus States */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(0, 0, 0, 0.1);
  outline-offset: 2px;
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
  /* Keep current light theme as default professional look */
}

/* Print styles */
@media print {
  .header,
  .modal,
  .loading,
  .toast {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .section {
    display: block !important;
    page-break-after: always;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }
  
  .modal-content {
    border: 3px solid #000000;
  }
  
  .form-group input,
  .form-group select {
    border-width: 3px;
  }
}

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px rgba(0, 0, 0, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

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

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

/* Add floating animation to feature cards */
.feature-card:nth-child(1) {
  animation: fadeInUp 0.6s ease-out 0.1s both, float 6s ease-in-out infinite 2s;
}

.feature-card:nth-child(2) {
  animation: fadeInUp 0.6s ease-out 0.2s both, float 6s ease-in-out infinite 3s;
}

.feature-card:nth-child(3) {
  animation: fadeInUp 0.6s ease-out 0.3s both, float 6s ease-in-out infinite 4s;
}

/* Enhanced hero section with subtle pattern */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.03) 1px, transparent 0);
  background-size: 30px 30px;
  pointer-events: none;
  opacity: 0.3;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

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

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

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.border-radius-small { border-radius: 4px; }
.border-radius-medium { border-radius: 8px; }
.border-radius-large { border-radius: 12px; }

.shadow-small { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.shadow-medium { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12); }
.shadow-large { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); }

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .header {
    height: 60px;
    padding: 0.5rem 0;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .logo i {
    font-size: 1.4rem;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(229, 229, 229, 0.8);
    z-index: 1000;
    border-radius: 0 0 16px 16px;
    animation: slideDown 0.3s ease-out;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .nav.active {
    display: flex;
  }
  
  .nav-link {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    border-radius: 8px;
    text-align: center;
  }
  
  main {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
  }
  
  .auth-buttons {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
  }
  
  .auth-buttons.logged-in {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  .auth-buttons.logged-out {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  
  .auth-buttons .btn {
    width: 100%;
  }
  
  .user-menu {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 1rem;
  }
  
  .user-menu.logged-out {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  .user-menu.logged-in {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .user-dropdown {
    width: 100%;
  }

  .user-name-btn {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: none;
    border: 1px solid #e5e5e5;
    backdrop-filter: none;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .quiz-options {
    flex-direction: column;
    align-items: center;
  }
  
  .management-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .game-buttons {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .features {
    padding: 1.5rem 0;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .modal-content {
    width: 98%;
    padding: 1rem;
  }
  
  .toast {
    right: 1rem;
    bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    max-width: 280px;
  }
  
  .toast::after {
    right: 0.5rem;
    top: 0.25rem;
  }
}

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

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

/* AI Modal Styles */
.modal-large {
  max-width: 800px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

/* Medium Modal Styles */
.modal-medium {
  max-width: 600px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.ai-input-tabs {
  display: flex;
  border-bottom: 2px solid #ecf0f1;
  margin-bottom: 2rem;
}

.ai-tab-btn {
  background: none;
  border: none;
  padding: 1rem 2rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  font-size: 1rem;
}

.ai-tab-btn.active {
  border-bottom-color: #3498db;
  color: #3498db;
}

.ai-tab-btn:hover {
  background: #f8f9fa;
}

.ai-tab-content {
  display: none;
}

.ai-tab-content.active {
  display: block;
}

.image-preview {
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  border: 2px dashed #ddd;
  border-radius: 10px;
}

.image-paste-area {
  border: 2px dashed #bdc3c7;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-paste-area:hover,
.image-paste-area:focus {
  border-color: #3498db;
  background-color: #e3f2fd;
  outline: none;
}

.image-paste-area.drag-over {
  border-color: #27ae60;
  background-color: #e8f5e8;
  transform: scale(1.02);
}

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

.paste-instructions i {
  font-size: 3rem;
  color: #bdc3c7;
  margin-bottom: 1rem;
  display: block;
}

.paste-instructions p {
  margin: 0.5rem 0;
  color: #7f8c8d;
  font-size: 1.1rem;
}

.paste-instructions small {
  color: #95a5a6;
  font-size: 0.9rem;
}

.image-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.ai-generated-words {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #ecf0f1;
}

.generated-words-list {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.generated-word-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.5rem;
  border: 2px solid transparent;
  transition: all 0.3s;
  cursor: pointer;
}

.generated-word-item:hover {
  border-color: #3498db;
  background: #e3f2fd;
}

.generated-word-item.selected {
  border-color: #27ae60;
  background: #e8f5e8;
}

.generated-word-item .word-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.generated-word-item .word-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2c3e50;
}

.generated-word-item .word-pronunciation {
  color: #7f8c8d;
  font-style: italic;
}

.generated-word-item .word-part-of-speech {
  color: #9b59b6;
  font-size: 0.85rem;
  font-weight: 500;
  background-color: #f8f4fd;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.5rem;
}

.generated-word-item .word-meaning {
  color: #e74c3c;
  font-weight: 500;
  margin: 0.5rem 0;
}

.generated-word-item .word-definition {
  color: #34495e;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.generated-word-item .word-example {
  color: #27ae60;
  font-style: italic;
  font-size: 0.9rem;
  border-left: 3px solid #27ae60;
  padding-left: 0.5rem;
}

.word-checkbox {
  width: 20px;
  height: 20px;
  margin-right: 1rem;
}

.ai-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.ai-actions .btn {
  min-width: 120px;
  font-size: 0.9rem;
}

.ai-actions .btn-primary {
  background-color: #3498db;
  border-color: #3498db;
}

.ai-actions .btn-warning {
  background-color: #f39c12;
  border-color: #f39c12;
  color: white;
}

.ai-actions .btn-warning:hover {
  background-color: #e67e22;
  border-color: #e67e22;
}

/* Mobile responsiveness for AI modal */
@media (max-width: 768px) {
  .modal {
    padding: 10px 0;
  }

  .modal-content {
    width: 95%;
    padding: 1.5rem;
    margin: 0 auto;
    max-height: calc(100vh - 20px);
  }

  .modal-large {
    width: 95%;
    padding: 1.5rem;
    max-height: calc(100vh - 20px);
  }

  .ai-input-tabs {
    flex-direction: column;
  }

  .ai-tab-btn {
    text-align: center;
  }

  .ai-actions {
    flex-direction: column;
    gap: 0.8rem;
  }

  .ai-actions .btn {
    width: 100%;
    min-width: auto;
  }
}

/* ===============================
   ADDITIONAL RESPONSIVE DESIGN 
   =============================== */

/* Tablet Styles */
@media (max-width: 1024px) {
  .container {
    padding: 0 15px;
  }

  .nav {
    gap: 1rem;
  }

  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .modal-content,
  .modal-large {
    width: 98%;
    padding: 1rem;
  }

  .category-card,
  .quiz-setup,
  .quiz-container {
    padding: 1rem;
  }

  .question-word {
    font-size: 1.5rem !important;
  }

  .btn {
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
  }
}

/* Speak button styles */
.btn-speak {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
}

.btn-speak:hover {
  background: #138496;
  transform: translateY(-1px);
}

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

.btn-speak i {
  font-size: 10px;
}

/* Icon Picker Styles */
.icon-picker {
  margin: 10px 0;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  max-height: 200px;
  overflow-y: auto;
}

.icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: white;
  text-align: center;
}

.icon-option:hover {
  background: #e3f2fd;
  border-color: #2196f3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.icon-option.selected {
  background: #2196f3;
  color: white;
  border-color: #1976d2;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.icon-option i {
  font-size: 20px;
  margin-bottom: 5px;
}

.icon-option span {
  font-size: 10px;
  font-weight: 500;
  word-break: break-word;
}



/* Responsive */
@media (max-width: 1200px) {
  .vocabulary-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stats-grid {
    min-width: auto;
    grid-template-columns: repeat(5, 1fr);
  }
  
  .activity-section {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
  }
  
  .stat-card {
    padding: 0.5rem;
    gap: 0.3rem;
  }
  
  .stat-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
  
  .stat-number {
    font-size: 0.9rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .stat-sublabel {
    font-size: 0.5rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
  
  .icon-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
  }
  
  .icon-option {
    padding: 8px 4px;
  }
  
  .icon-option i {
    font-size: 16px;
  }
  
  .icon-option span {
    font-size: 9px;
  }
}