/* ===== ZENKAIVERSE MASTER CSS ===== */

:root {
  /* Light Theme (default) */
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-card: #fff;
  --bg-header: #f5f5fa;
  --text-primary: #222;
  --text-secondary: #555;
  --text-inverse: #fff;
  --accent-primary: #ff2d2d;
  --accent-secondary: #b71c1c;
  --border-primary: #e0e0e0;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
}

[data-theme="dark"] {
  --bg-primary: #181622;
  --bg-secondary: #232136;
  --bg-card: #232136;
  --bg-header: #232136;
  --text-primary: #fff;
  --text-secondary: #b0b0b0;
  --text-inverse: #222;
  --accent-primary: #ff2d2d;
  --accent-secondary: #ff9800;
  --border-primary: #33334d;
  --shadow: 0 2px 16px rgba(0,0,0,0.25);
}

html {
  box-sizing: border-box;
  font-size: 16px;
  scroll-behavior: smooth;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ===== HEADER STYLES ===== */
.header {
  background: var(--bg-header);
  border-bottom: 2px solid var(--accent-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  height: 48px;
  transition: transform 0.2s;
}

.logo:hover {
  transform: scale(1.05);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-left: auto;
  margin-right: 2rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link:focus {
  background: var(--accent-primary);
  color: var(--text-inverse);
  transform: translateY(-1px);
}

/* ===== USER MENU STYLES ===== */
.user-menu {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: none;
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
}

.user-menu-button:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.user-menu-button .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
}

.user-menu-button .user-avatar-initial {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  border: 2px solid var(--accent-primary);
}

.user-menu-button .user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-button .dropdown-arrow {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

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

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
  margin-top: 0.5rem;
}

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

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.user-dropdown-item:first-child {
  border-radius: 12px 12px 0 0;
}

.user-dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

.user-dropdown-item:hover {
  background: var(--bg-secondary);
}

.user-dropdown-item.admin-only {
  border-top: 1px solid var(--border-primary);
  color: var(--accent-primary);
}

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

.user-dropdown-item.logout:hover {
  background: #dc3545;
  color: var(--text-inverse);
}

.login-button {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
  font-size: 0.9rem;
}

.login-button:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.theme-switcher {
  cursor: pointer;
  font-size: 1.3rem;
  background: none;
  border: none;
  color: var(--accent-primary);
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
}

.theme-switcher:hover {
  color: var(--accent-secondary);
  background: var(--bg-secondary);
  transform: scale(1.1);
}

main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.section {
  margin-bottom: 2.5rem;
}
.section-title {
  color: var(--accent-primary);
  font-size: 1.7rem;
  margin-bottom: 0.5em;
}
.card-list {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  min-width: 250px;
  flex: 1 1 300px;
  max-width: 400px;
  transition: box-shadow 0.2s, border 0.2s;
}
.card h3 {
  color: var(--accent-primary);
  margin-top: 0;
}
.card a {
  display: inline-block;
  margin-top: 1rem;
  background: var(--accent-primary);
  color: var(--text-inverse);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}
.card a:hover {
  background: var(--accent-secondary);
}
.app-badge {
  display: inline-block;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-radius: 12px;
  padding: 0.4rem 1.2rem;
  font-weight: bold;
  margin-top: 1rem;
}
@media (max-width: 900px) {
  main { padding: 1rem; }
  .card-list { flex-direction: column; gap: 1rem; }
  
  .header {
    padding: 0.8rem 1rem;
  }
  
  .header-nav {
    gap: 1rem;
    margin-right: 1rem;
  }
  
  .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }
}
@media (max-width: 600px) {
  .header { 
    flex-direction: column; 
    gap: 1rem; 
    padding: 1rem; 
  }
  
  .header-nav {
    order: 2;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .header-right {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  
  .logo { height: 40px; }
  
  .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .user-menu-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .user-menu-button .user-name {
    max-width: 80px;
  }
  
  main { padding: 0.5rem; }
} 

/* Mobile Navigation */
.header .menu-toggle {
  display: none;
  margin-right: 0.5rem;
  background: rgba(255,45,45,0.12);
  color: #ff2d2d;
  border: 1px solid #ff2d2d;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.drawer-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.mobile-drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: 78vw; max-width: 320px;
  background: linear-gradient(135deg, #2c0000 0%, #1a1a1a 100%);
  border-right: 1px solid rgba(255,45,45,0.4);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 1000;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-drawer.open { transform: translateX(0); }
.drawer-backdrop.show { display: block; }

.mobile-nav a {
  display: block;
  padding: 0.8rem 0.6rem;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  border: 1px solid transparent;
}
.mobile-nav a:hover { border-color: rgba(255,45,45,0.5); background: rgba(255,45,45,0.08); color: #fff; }

.mobile-actions { margin-top: auto; display: flex; gap: 0.5rem; }

/* Responsive behavior */
@media (max-width: 900px), (orientation: portrait) {
  .header .menu-toggle { display: inline-block; }
  .header-nav { display: none; }
  .header { flex-direction: row; align-items: center; gap: 0.5rem; }
  .header-right { margin-left: auto; width: auto; justify-content: flex-end; }
  #themeSwitcher { display: none; }
} 

/* Homepage desktop layout enhancements */
@media (min-width: 1000px) {
  .page-home main {
    max-width: 1400px;
    padding: 3rem 2rem;
  }
  .page-home .section.hero .icon { font-size: 3rem !important; }
  .page-home .card-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
  .page-home .card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 1.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .page-home .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 50px rgba(0,0,0,0.12);
    border-color: rgba(255,45,45,0.35);
  }
  .page-home .card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }
  .page-home .card p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
  }
  .page-home .card a {
    margin-top: 1rem;
    align-self: start;
  }
} 