:root,
[data-theme="dark"] {
  --bg: #05050a;
  --sidebar: #0a0a12;
  --card-bg: #0f0f1a;
  --text: #ffffff;
  --text-muted: #a0a0b8;
  --border: rgba(255, 255, 255, 0.06);
  --accent: #6b5cff;
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-border: rgba(255, 255, 255, 0.1);
  --btn-hover: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --logo-glow: 0 0 80px rgba(107, 92, 255, 0.4), 0 0 120px rgba(0, 212, 255, 0.2);
  --nav-active-bg: linear-gradient(90deg, rgba(107, 92, 255, 0.25), transparent);
}

[data-theme="light"] {
  --bg: #f4f5f9;
  --sidebar: #ffffff;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #5a5a78;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #5b4cdb;
  --btn-bg: rgba(0, 0, 0, 0.04);
  --btn-border: rgba(0, 0, 0, 0.1);
  --btn-hover: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  --logo-glow: 0 0 60px rgba(107, 92, 255, 0.25), 0 0 100px rgba(0, 212, 255, 0.15);
  --nav-active-bg: linear-gradient(90deg, rgba(107, 92, 255, 0.12), transparent);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ========== LAYOUT ========== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 240px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 24px 16px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 28px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6b5cff, #00d4ff);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(107, 92, 255, 0.08);
  color: var(--text);
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--text);
  border-left: 3px solid #6b5cff;
  padding-left: 9px;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.nav-icon.m365 { background: linear-gradient(135deg, #6b5cff, #a855f7); }
.nav-icon.word { background: #2b7cd3; }
.nav-icon.excel { background: #217346; }
.nav-icon.ppt { background: #c43e1c; }
.nav-icon.outlook { background: #0078d4; }
.nav-icon.onenote { background: #7719aa; }
.nav-icon.access { background: #a4373a; }

.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.3s ease;
}

.os-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ========== MAIN ========== */
.main {
  margin-left: 240px;
  flex: 1;
  padding: 40px 48px 60px;
  max-width: 1400px;
}

/* ========== HERO ========== */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  position: relative;
}

.hero-text h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(90deg, #6b5cff, #00d4ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-os {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-os span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-logo {
  position: relative;
}

.office-logo {
  width: 160px;
  height: 160px;
  background: linear-gradient(135deg, #6b5cff 0%, #00d4ff 50%, #ff6b6b 100%);
  border-radius: 32px;
  transform: rotate(15deg);
  box-shadow: var(--logo-glow);
  position: relative;
  transition: box-shadow 0.3s ease;
}

.office-logo::before {
  content: '';
  position: absolute;
  inset: 12px;
  background: var(--bg);
  border-radius: 22px;
  opacity: 0.3;
  transition: background 0.3s ease;
}

/* ========== CARDS ========== */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.8;
}

/* Card color variants - dark defaults, light overrides via filter/opacity */
.card-m365 {
  background: linear-gradient(145deg, #1a1035 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-m365 {
  background: linear-gradient(145deg, #f0ebff 0%, #ffffff 100%);
}
.card-m365::before { background: linear-gradient(90deg, #6b5cff, #a855f7); }

.card-word {
  background: linear-gradient(145deg, #0d1e35 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-word {
  background: linear-gradient(145deg, #e8f1fb 0%, #ffffff 100%);
}
.card-word::before { background: #2b7cd3; }

.card-excel {
  background: linear-gradient(145deg, #0a1f15 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-excel {
  background: linear-gradient(145deg, #e6f5ee 0%, #ffffff 100%);
}
.card-excel::before { background: #217346; }

.card-ppt {
  background: linear-gradient(145deg, #2a120a 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-ppt {
  background: linear-gradient(145deg, #fceeea 0%, #ffffff 100%);
}
.card-ppt::before { background: #c43e1c; }

.card-outlook {
  background: linear-gradient(145deg, #0a1a2e 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-outlook {
  background: linear-gradient(145deg, #e6f2fb 0%, #ffffff 100%);
}
.card-outlook::before { background: #0078d4; }

.card-onenote {
  background: linear-gradient(145deg, #1a0a2e 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-onenote {
  background: linear-gradient(145deg, #f3e8fb 0%, #ffffff 100%);
}
.card-onenote::before { background: #7719aa; }

.card-access {
  background: linear-gradient(145deg, #2a0a0f 0%, var(--card-bg) 100%);
}
[data-theme="light"] .card-access {
  background: linear-gradient(145deg, #fce8e9 0%, #ffffff 100%);
}
.card-access::before { background: #a4373a; }

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

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.word-icon { background: linear-gradient(135deg, #2b7cd3, #1a5aa8); }
.excel-icon { background: linear-gradient(135deg, #217346, #155a35); }
.ppt-icon { background: linear-gradient(135deg, #c43e1c, #9a2f14); }
.outlook-icon { background: linear-gradient(135deg, #0078d4, #005a9e); }
.onenote-icon { background: linear-gradient(135deg, #7719aa, #5a1280); }
.access-icon { background: linear-gradient(135deg, #a4373a, #7d2a2c); }

.card h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 320px;
}

.card-os {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-download:hover {
  background: var(--btn-hover);
  border-color: var(--btn-border);
  transform: translateY(-1px);
}

.btn-download span {
  font-size: 16px;
}

/* ========== FOOTER ========== */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color 0.3s ease;
}

.footer-left {
  flex: 1;
  min-width: 280px;
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-small .logo-icon {
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  width: 100%;
  margin-top: 8px;
  font-size: 12px;
}

/* ========== LANGUAGE + THEME SWITCHERS ========== */
.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.lang-switcher,
.theme-switcher {
  display: flex;
  gap: 6px;
}

.lang-btn,
.theme-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lang-btn:hover,
.theme-btn:hover {
  background: rgba(107, 92, 255, 0.08);
  color: var(--text);
}

.lang-btn.active,
.theme-btn.active {
  background: linear-gradient(135deg, rgba(107, 92, 255, 0.3), rgba(0, 212, 255, 0.15));
  border-color: rgba(107, 92, 255, 0.5);
  color: var(--text);
}

[data-theme="light"] .lang-btn.active,
[data-theme="light"] .theme-btn.active {
  background: linear-gradient(135deg, rgba(107, 92, 255, 0.15), rgba(0, 212, 255, 0.08));
  border-color: rgba(107, 92, 255, 0.4);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 70px;
    padding: 20px 10px;
  }

  .logo span,
  .nav-item span:not(.nav-icon),
  .sidebar-footer .os-item,
  .controls {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .nav-item.active {
    padding-left: 12px;
    border-left: none;
    background: rgba(107, 92, 255, 0.2);
  }

  .main {
    margin-left: 70px;
    padding: 30px 24px;
  }

  .hero-text h1 {
    font-size: 32px;
  }

  .office-logo {
    width: 100px;
    height: 100px;
  }
}

@media (max-width: 600px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

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

/* SPA pages */
.page[hidden] {
  display: none !important;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
