/* CSS Variables cho dễ quản lý màu */
:root {
  --primary: #00d2ff;
  --primary-gradient: linear-gradient(135deg, #00d2ff, #3a7bd5);
  --secondary: #a8e6cf;
  --accent: #ff9a8b;
  --bg-light: #f0f8ff;
  --text: #2d3436;
  --text-light: #636e72;
  --card-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
  --bg-light: #121212;
  --text: #f0f0f0;
  --text-light: #b0b0b0;
  --card-bg: rgba(30, 30, 30, 0.85);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-light);
  color: var(--text);
  line-height: 1.6;
  transition: var(--transition);
}

/* Header hiện đại */
.main-header {
  background: var(--primary-gradient);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.logo img {
  height: 48px;
  transition: transform 0.3s;
}

.logo img:hover {
  transform: scale(1.1);
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.main-nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  transition: var(--transition);
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
}

.theme-toggle button,
.menu-toggle {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: white;
  cursor: pointer;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Style Select */
.style-select {
  text-align: center;
  margin-bottom: 2rem;
}

.style-select select {
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border: none;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  cursor: pointer;
}

.style-select select:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.3);
}

/* Translator Box - Glassmorphism */
.translator-box {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  margin: 3rem 0;
}

.box {
  flex: 1;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.box:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

textarea {
  width: 100%;
  min-height: 220px;
  padding: 1.2rem;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  resize: vertical;
  transition: var(--transition);
}

textarea:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 210, 255, 0.3);
}

textarea[readonly] {
  background: rgba(240, 240, 240, 0.8);
}

.box-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

/* Buttons hiện đại */
.primary-btn,
#translateBtn,
#rev-btn,
.copy-button,
.swap-button button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
  transition: var(--transition);
}

.primary-btn:hover,
#translateBtn:hover,
#rev-btn:hover,
.copy-button:hover,
.swap-button button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 210, 255, 0.4);
}

/* Products & Blog grid */
.products-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.ecom-product,
.blog-item {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.ecom-product:hover,
.blog-item:hover {
  transform: translateY(-8px);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 4rem 2rem;
  margin-top: 4rem;
}

footer a {
  color: #a8e6cf;
}

/* Responsive */
@media (max-width: 768px) {
  .translator-box {
    flex-direction: column;
  }
  .main-nav {
    display: none;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    position: absolute;
    top: 100%;
    left: 0;
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    padding: 1rem;
  }
}