/* Base styles */
body {
  background-color: #111111;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #ffffff;
  overflow: hidden;
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* Mobile styles */
@media (max-width: 768px) {
  .app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .sidebar {
    display: none !important;
  }
  
  .main-content {
    padding: 12px !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }
  
  .header, .search-container, .categories {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }
  
  .header {
    margin-bottom: 24px !important;
  }
  
  .header-icon {
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto 12px !important;
  }
  
  .header-title {
    font-size: 24px !important;
  }
  
  .search-container {
    margin-bottom: 16px !important;
  }
  
  .search-bar {
    height: 36px !important;
    min-width: 60% !important;
    border-radius: 18px !important;
  }
  
  .filter-dropdown {
    height: 36px !important;
    width: 100px !important;
    border-radius: 18px !important;
  }
  
  .categories {
    margin-bottom: 20px !important;
    gap: 10px !important;
  }
  
  .category {
    padding: 6px 12px !important;
    min-width: 90px !important;
    height: 18px !important;
    border-radius: 14px !important;
    font-size: 12px !important;
  }
  
  .character-name.shimmer {
    width: 90px !important;
    height: 18px !important;
    border-radius: 6px !important;
  }
  
  .character-description.shimmer {
    height: 30px !important;
    border-radius: 6px !important;
  }
  
  .chat-button.shimmer {
    margin-top: 6px;
    height: 20px !important;
    border-radius: 14px !important;
  }
  
  .nav-item {
    padding: 8px 16px !important;
    margin: 4px 0 !important;
  }
  
  .nav-icon {
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
  }
  
  .create-btn {
    margin: 16px !important;
    padding: 8px !important;
    margin-bottom: 16px !important;
  }
}

/* Sidebar */
.sidebar {
  width: 220px;
  background-color: #111111;
  border-right: 1px solid #222222;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 0 8px 8px 0;
}

.logo {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
}

.logo-text {
  font-size: 20px;
  font-weight: bold;
  margin-left: 12px;
  border-radius: 4px;
}

.nav-item {
  padding: 12px 24px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  border-radius: 0 24px 24px 0;
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  width: 24px;
  height: 24px;
  margin-right: 16px;
  border-radius: 4px;
}

.create-btn {
  margin: 24px;
  padding: 12px;
  border-radius: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  text-align: center;
  margin-top: auto;
  margin-bottom: 24px;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 12px;
}

.header-title {
  font-size: 32px;
  font-weight: bold;
  border-radius: 8px;
}

/* Search and filters */
.search-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  width: 100%;
  max-width: 1200px;
}

.search-bar {
  height: 48px;
  border-radius: 24px;
  flex: 1;
  margin-right: 16px;
  min-width: 70%;
}

.filter-dropdown {
  width: 140px;
  height: 48px;
  border-radius: 24px;
}

/* Categories */
.categories {
  display: flex;
  margin-bottom: 32px;
  padding-bottom: 8px;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1200px;
  justify-content: center;
}

.category {
  padding: 12px 24px;
  border-radius: 24px;
  white-space: nowrap;
  min-width: 120px;
  height: 24px;
}

/* Character grid */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 0 16px 32px;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .character-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px 16px;
  }
  
  .character-card {
    height: 140px;
  }
  
  .character-image {
    width: 80px;
    height: 107px;
  }
  
  .character-info {
    margin-left: 16px;
  }
}

@media (max-width: 480px) {
  .character-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    padding: 0 8px 12px;
    margin: 0;
    box-sizing: border-box;
    gap: 12px;
  }
  
  .character-card {
    max-width: 100%;
    width: 100%;
    height: 130px;
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 16px;
    padding: 12px;
  }
  
  .character-image {
    width: 70px;
    height: 93px;
  }
  
  .character-info {
    margin-left: 12px;
  }
  
  .character-name {
    font-size: 13px;
  }
  
  .character-description {
    font-size: 12px;
  }
  
  .chat-button {
    height: 28px;
    width: 70px;
  }
}

.character-card {
  border-radius: 16px;
  border: 1px solid #3A3A3A;
  background-color: #191919;
  height: 150px;
  display: flex;
  padding: 16px;
  box-sizing: border-box;
}

.character-image {
  width: 86px;
  height: 115px;
  border-radius: 12px;
  flex-shrink: 0;
}

.character-info {
  flex: 1;
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.character-text-content {
  flex: 1;
}

.character-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  color: #EEEEEE;
}

.character-description {
  font-size: 14px;
  color: #B4B4B4;
  line-height: 1.43;
}

.character-action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.chat-button {
  height: 32px;
  width: 80px;
  border-radius: 12px;
  background-color: #222222;
}

/* Shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(to right, #1A1A1A 8%, #333333 18%, #1A1A1A 33%);
  background-size: 2000px 104px;
  animation: shimmer 2.5s infinite linear;
  border-radius: 8px;
}

/* Loading container */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: #121212;
  color: #FFFFFF;
  font-family: Arial, sans-serif;
  overflow: hidden;
  transition: opacity 0.5s ease-in-out;
  border-radius: 0;
}

.fade-out {
  opacity: 0;
}
