/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f5efe6;
  font-family: sans-serif;
  height: 100vh;
  width: 100vw;
}

/* Layout */
#app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

#sidebar-container {
  width: 250px;
  overflow: hidden;
  transition: width 0.3s ease;
}

#sidebar {
  width: 100%;
  height: 100%;
  background-color: #fff;
  padding: 1rem;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.3s ease;
}

/* Sidebar toggle */
#sidebar-toggle {
  position: absolute;
  top: 10px;
  left: 250px;
  background-color: #6bbf59;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 18px;
  z-index: 1000;
  transition: left 0.3s ease;
}

/* Collapsed state */
#app-shell.collapsed #sidebar-container {
  width: 0;
}

#app-shell.collapsed #sidebar {
  transform: translateX(-100%);
}

#app-shell.collapsed #sidebar-toggle {
  left: 0;
}

#app-shell.collapsed #dashboard {
  padding-left: 60px;
}

/* Branding */
.logo {
  image-rendering: crisp-edges;
  max-width: 100%;
  height: auto;
}

/* Login */
#login {
  margin-top: 20px;
}

#logout {
  background-color: #6bbf59;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease;
  margin-top: 20px;
  width: 100%;
}

#logout:hover {
  background-color: #58a94a;
}

#app-container {
  flex-grow: 1;
  padding: 2rem 2rem 2rem 60px;
  background: #f5efe6;
  overflow-y: auto;
  transition: padding-left 0.3s ease;
}

/* Dynamic content */
#greeting {
  font-size: 1em;
  color: #333;
  margin-bottom: 1rem;
}

#app-heading {
  font-size: 2em;
  color: #333;
  margin-bottom: 1rem;
}

.category {
  background-color: #f9ffe0;
  border-left: 6px solid #b4dd1e;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.category.favorites {
  background-color: #f0fdf4;
  border-left-color: #6bbf59;
}

.category-title {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.app-tile {
  background: white;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.app-tile:hover {
  transform: scale(1.05);
  border-color: #742bd7;
}

.app-tile.color-palette-generator {
  background: linear-gradient(135deg, #f0fdf4, #d0f0ff);
  font-weight: bold;
}

/* Responsive */
@media screen and (max-width: 768px) {
  #app-shell {
    flex-direction: column;
    height: auto;
    overflow-x: hidden;
  }

  #sidebar-container {
    width: 100% !important;
    height: auto;
    transition: none;
  }

  #sidebar {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    box-shadow: none;
    transform: none !important;
  }

  #sidebar-toggle {
    display: none;
  }

  .logo {
    max-width: 80px;
    height: auto;
    margin-bottom: 1rem;
  }

  #logout {
    font-size: 14px;
    padding: 8px 16px;
    width: 100%;
  }

  #app-container {
    padding: 1rem;
    padding-left: 1rem;
  }

  .category {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .category-title {
    font-size: 1.25rem;
  }

  .app-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .app-tile {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}