/* CSS Custom Properties */
:root {
  --warm-grey-100: #f5f5f4;
  --warm-grey-200: #e7e5e4;
  --warm-grey-300: #d6d3d1;
  --warm-grey-400: #a8a29e;
  --warm-grey-500: #78716c;
  --warm-grey-600: #57534e;
  --warm-grey-700: #44403c;
  --warm-grey-800: #292524;
  --warm-grey-900: #1c1917;

  /* Light theme */
  --background: #ffffff;
  --foreground: #0f0f0f;
  --card: #ffffff;
  --card-foreground: #0f0f0f;
  --primary: #0f0f0f;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f0f0f;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #f1f5f9;
  --accent-foreground: #0f0f0f;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e2e8f0;
  --input: #ffffff;
  --ring: #94a3b8;
}

/* Dark theme */
[data-theme="dark"] {
  --background: var(--warm-grey-700);
  --foreground: var(--warm-grey-100);
  --card: var(--warm-grey-600);
  --card-foreground: var(--warm-grey-100);
  --primary: var(--warm-grey-200);
  --primary-foreground: var(--warm-grey-800);
  --secondary: var(--warm-grey-500);
  --secondary-foreground: var(--warm-grey-100);
  --muted: var(--warm-grey-500);
  --muted-foreground: var(--warm-grey-300);
  --accent: var(--warm-grey-500);
  --accent-foreground: var(--warm-grey-100);
  --border: var(--warm-grey-500);
  --input: var(--warm-grey-600);
  --ring: var(--warm-grey-400);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header Styles */
.header {
  background-color: var(--warm-grey-100);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

[data-theme="dark"] .header {
  background-color: var(--warm-grey-800);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
}

.desktop-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.action-btn {
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.action-btn:hover {
  background-color: var(--muted);
}

/* Theme Toggle */
#themeToggle {
  position: relative;
}

.sun-icon,
.moon-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.sun-icon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.moon-icon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-avatar {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
}

.avatar {
  width: 2rem;
  height: 2rem;
  background-color: var(--muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 14rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

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

.user-info {
  padding: 1rem;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.user-email {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--foreground);
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--muted);
}

/* Mobile Menu */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  background-color: var(--card);
  padding: 2rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu-overlay.show .mobile-menu {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 3rem;
}

.mobile-nav-link {
  text-decoration: none;
  color: var(--foreground);
  font-size: 1.125rem;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.mobile-nav-link:hover {
  color: var(--primary);
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.search-overlay.show {
  opacity: 1;
  visibility: visible;
}

.search-container {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  background-color: var(--card);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.search-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1.125rem;
  color: var(--foreground);
  padding: 0.5rem 0;
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.search-close {
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
}

.search-suggestions h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.suggestion-btn {
  background-color: var(--muted);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.suggestion-btn:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* Main Content */
.main {
  flex: 1;
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.rotating-content {
  position: relative;
  height: 500px;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.5s ease-in-out;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
}

.slide.exit {
  opacity: 0;
  transform: translateX(-100%);
}

.slide-image {
  width: 100%;
  height: 400px;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.slide-text {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 2;
  position: relative;
}

/* CSS-generated gradient backgrounds for slides */
.slide-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.slide-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.slide-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.slide-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.slide-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--foreground);
}

/* Tools Section */
.tools-section {
  margin-top: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--foreground);
}

.tool-category {
  margin-bottom: 3rem;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.tool-scroll-container {
  position: relative;
}

.tool-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tool-scroll::-webkit-scrollbar {
  display: none;
}

.tool-card {
  flex: 0 0 300px;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  scroll-snap-align: start;
  transition: all 0.3s ease;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 0 20px 0 rgba(255, 255, 255, 0.1);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tool-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.add-to-studio-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-to-studio-btn:hover {
  background-color: var(--muted);
}

.tool-image {
  width: 100%;
  height: 150px;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

/* Tool image gradients */
.tool-image.digital-painter {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.tool-image.color-mixer {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.tool-image.magic-mask {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.tool-image.layers {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.tool-image.xy {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.tool-image.canvas-editor {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}
.tool-image.pixel-artist {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}
.tool-image.tile-maker {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}
.tool-image.stamps {
  background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 100%);
}
.tool-image.sprite-animator {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}
.tool-image.image-maker {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.tool-image.style-transfer {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.tool-image.magic-vision {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.tool-image.composer {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.tool-image.vdraw {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.tool-image.shape-builder {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}
.tool-image.svg-exporter {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.tool-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.scroll-btn:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.scroll-btn.left {
  left: 10px;
}

.scroll-btn.right {
  right: 10px;
}

/* Footer */
.footer {
  background-color: var(--warm-grey-100);
  border-top: 1px solid var(--border);
  padding: 2rem 0 1rem;
  margin-top: auto;
}

[data-theme="dark"] .footer {
  background-color: var(--warm-grey-800);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.footer-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.footer-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.toast {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 300px;
}

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

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

.toast-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Responsive Design */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .desktop-nav {
    display: none;
  }

  .slide-title {
    font-size: 1.5rem;
  }

  .rotating-content {
    height: 400px;
  }

  .slide-image {
    height: 300px;
  }

  .tool-card {
    flex: 0 0 250px;
  }

  .scroll-btn {
    display: none;
  }

  .search-container {
    width: 95%;
    padding: 1.5rem;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }

  .header-content {
    padding: 0.75rem 0;
  }

  .logo {
    font-size: 1.25rem;
  }

  .slide-title {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .tool-card {
    flex: 0 0 220px;
    padding: 1rem;
  }
}
