/* Oathsworn Professions - Styles */

:root {
  /* Dark theme colors - Updated to match guild logo */
  --bg-primary: #0a0e1a;
  --bg-secondary: #1a1f35;
  --bg-tertiary: #252b45;
  --text-primary: #f0e6d2;
  --text-secondary: #a09b8c;
  --border-color: #3d4665;
  
  /* Profession colors based on WoW theme */
  --alchemy: #64b5f6;
  --blacksmithing: #ef5350;
  --enchanting: #9575cd;
  --engineering: #ff9800;
  --jewelcrafting: #4dd0e1;
  --leatherworking: #d4a574;
  --tailoring: #b39ddb;
  --mining: #e57373;
  --herbalism: #81c784;
  --skinning: #ffb74d;
  --cooking: #ffa726;
  --fishing: #90caf9;
  --first-aid: #80deea;
  --lockpicking: #ffee58;
  
  /* UI colors - Guild theme */
  --primary: #d4af37;
  --primary-hover: #f0d06f;
  --danger: #d32f2f;
  --danger-hover: #f44336;
  --success: #388e3c;
  --success-hover: #4caf50;
  --warning: #f57c00;
  --accent: #8b7355;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global scrollbar styling */
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.3), rgba(255, 193, 7, 0.2));
  border-radius: 6px;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.5), rgba(255, 193, 7, 0.3));
  border-color: var(--primary);
}

*::-webkit-scrollbar-corner {
  background: var(--bg-primary);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background-color: var(--bg-secondary);
  border-bottom: 3px solid var(--primary);
  padding: 20px 0;
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
  transition: opacity 0.2s;
}

.logo-section:hover {
  opacity: 0.8;
}

.logo {
  max-height: 80px;
  max-width: 80px;
}

h1 {
  color: var(--primary);
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 5px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Navigation */
nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.nav-top-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  justify-content: flex-end;
}

.nav-bottom-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  justify-content: flex-end;
}

.nav-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #b8941f 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  min-width: 180px;
  white-space: nowrap;
}

.nav-btn:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #d4af37 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #d4af37 100%);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

/* User Dropdown Container */
.user-dropdown-container {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, #1f2540 100%);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.user-info:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.user-info span {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
}

.discord-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease-in-out;
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
  color: var(--primary);
}

.dropdown-item span {
  font-size: 1.2rem;
}

/* Main Content Sections */
.content-section {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.content-section.active {
  display: block;
}

@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Find a Crafter Section */
.intro-text {
  text-align: center;
  background-color: var(--warning);
  color: #000;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 30px;
  font-weight: 500;
}

.profession-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
  justify-content: center;
}

.profession-btn {
  padding: 12px;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: transparent;
  min-width: 140px;
  width: 140px;
}

.profession-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  border-radius: 4px;
}

.profession-label {
  font-size: 0.75rem;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
}

.profession-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  border-width: 3px;
}

.profession-btn:hover .profession-icon {
  transform: scale(1.1);
  transition: transform 0.3s;
}

.profession-btn.alchemy:hover { border-color: var(--alchemy); }
.profession-btn.blacksmithing:hover { border-color: var(--blacksmithing); }
.profession-btn.enchanting:hover { border-color: var(--enchanting); }
.profession-btn.engineering:hover { border-color: var(--engineering); }
.profession-btn.jewelcrafting:hover { border-color: var(--jewelcrafting); }
.profession-btn.leatherworking:hover { border-color: var(--leatherworking); }
.profession-btn.tailoring:hover { border-color: var(--tailoring); }
.profession-btn.mining:hover { border-color: var(--mining); }
.profession-btn.herbalism:hover { border-color: var(--herbalism); }
.profession-btn.skinning:hover { border-color: var(--skinning); }
.profession-btn.cooking:hover { border-color: var(--cooking); }
.profession-btn.fishing:hover { border-color: var(--fishing); }
.profession-btn.first-aid:hover { border-color: var(--first-aid); }
.profession-btn.lockpicking:hover { border-color: var(--lockpicking); }

/* View Tabs */
.view-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  justify-content: center;
}

.view-tab {
  flex: 1;
  max-width: 300px;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-tab:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.view-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: var(--bg-primary);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.view-tab.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Tab Content */
.tab-content {
  display: none;
  opacity: 0;
  animation: fadeOut 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.4s ease-in-out;
}

/* Fade animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Main Content Layout with Sidebar - Remove/Hide */
.main-content-layout {
  display: none;
}

.professions-section {
  flex: 1;
  min-width: 0;
}

.stats-sidebar {
  display: none;
}

/* Guild Profession Statistics */
.stats-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid var(--border-color);
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: 12px;
  padding: 25px;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.stat-card h3 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 20px;
  font-size: 1.3rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.stat-card canvas {
  max-height: 300px;
  margin: 0 auto;
  display: block;
}

.chart-legend {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.legend-label {
  flex: 1;
  display: flex;
  justify-content: space-between;
}

.legend-count {
  font-weight: 600;
  color: var(--primary);
}

/* Crafter Results Container */
#crafter-results {
  margin-top: 30px;
  margin-bottom: 40px;
}

/* Crafter List */
.crafter-list {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: 12px;
  padding: 25px;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for crafter list */
.crafter-list::-webkit-scrollbar {
  width: 10px;
}

.crafter-list::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 5px;
}

.crafter-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
}

.crafter-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

.crafter-list h3 {
  margin-bottom: 20px;
  color: var(--primary);
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  position: sticky;
  top: -25px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 10px 0;
  margin: -10px -25px 20px -25px;
  padding-left: 25px;
  z-index: 1;
}

.crafter-card {
  background-color: var(--bg-tertiary);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 4px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.crafter-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.crafter-compact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.crafter-compact-card {
  background-color: var(--bg-tertiary);
  padding: 12px 15px;
  border-radius: 6px;
  border-left: 3px solid var(--border-color);
  transition: all 0.2s;
}

.crafter-compact-card:hover {
  border-left-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.crafter-compact-card.likely-online {
  border-left-color: var(--accent-gold);
  background-color: rgba(212, 175, 55, 0.05);
}

.crafter-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.crafter-compact-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.crafter-compact-skill {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}

.crafter-compact-availability {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.crafter-compact-availability span {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
}

.crafter-compact-recipes {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.crafter-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.skill-level {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.recipes-known {
  margin-top: 10px;
}

.recipe-group-display {
  margin-bottom: 12px;
}

.recipe-group-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 6px;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  border-left: 3px solid var(--primary);
}

.recipe-group-items {
  padding-left: 8px;
}

.recipe-tag {
  display: inline-block;
  padding: 3px 8px;
  margin: 3px;
  background-color: var(--bg-primary);
  border-radius: 3px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.recipe-tag a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.recipe-tag a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Character Management */
.character-list {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.character-item {
  background-color: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.character-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.character-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.character-actions {
  display: flex;
  gap: 10px;
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.9rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-edit {
  background-color: var(--primary);
  color: white;
}

.btn-edit:hover {
  background-color: var(--primary-hover);
}

.btn-delete {
  background-color: var(--danger);
  color: white;
}

.btn-delete:hover {
  background-color: var(--danger-hover);
}

.add-character-btn {
  width: 100%;
  padding: 15px;
  background-color: var(--success);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.add-character-btn:hover {
  background-color: var(--success-hover);
}

/* Forms */
.form-container {
  background-color: var(--bg-secondary);
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: 10px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 1rem;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background-color: var(--bg-tertiary);
  border-radius: 5px;
}

/* Scrollbar styling for checkbox-group */
.checkbox-group::-webkit-scrollbar {
  width: 12px;
}

.checkbox-group::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.checkbox-group::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.3), rgba(255, 193, 7, 0.2));
  border-radius: 6px;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.checkbox-group::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.5), rgba(255, 193, 7, 0.3));
  border-color: var(--accent-color);
}

/* Override for recipe selector containers */
.checkbox-group:has(.recipe-search-box) {
  display: block;
  width: 100%;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary {
  flex: 1;
  padding: 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  flex: 1;
  padding: 12px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
}

/* Admin Panel */
.admin-section {
  margin-bottom: 30px;
  background-color: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
}

.admin-section h3 {
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

#admin-character-list {
  margin-top: 20px;
  max-height: 600px;
  overflow-y: auto;
}

.admin-character-item {
  margin-bottom: 15px;
}

.character-owner {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.recipe-list {
  display: grid;
  gap: 10px;
}

.recipe-item {
  background-color: var(--bg-tertiary);
  padding: 6px 10px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  transition: all 0.2s;
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.recipe-item:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary);
}

.recipe-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.recipe-info {
  flex: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.recipe-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.recipe-link {
  color: var(--text-primary);
  text-decoration: none;
  pointer-events: all;
}

.recipe-link:hover {
  color: var(--primary);
}

.recipe-profession-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.recipe-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.btn-icon:hover {
  background-color: var(--error);
  color: white;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 5px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notification.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-notification.toast-success {
  background-color: #10b981;
  color: white;
}

.toast-notification.toast-error {
  background-color: var(--error);
  color: white;
}

.toast-notification.toast-info {
  background-color: var(--primary);
  color: white;
}

/* Recipe Manager Layout */
.recipe-manager-layout {
  max-width: 1200px !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.recipe-manager-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.recipe-left-panel,
.recipe-right-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Custom scrollbar for panels */
.recipe-left-panel::-webkit-scrollbar,
.recipe-right-panel::-webkit-scrollbar {
  width: 8px;
}

.recipe-left-panel::-webkit-scrollbar-track,
.recipe-right-panel::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 4px;
}

.recipe-left-panel::-webkit-scrollbar-thumb,
.recipe-right-panel::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.ungrouped-recipes-container {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px;
  border: 2px solid var(--border-color);
}

.ungrouped-recipes-container h3 {
  color: var(--primary);
  margin-bottom: 15px;
}

#ungrouped-recipe-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 5px;
}

#ungrouped-recipe-list::-webkit-scrollbar {
  width: 6px;
}

#ungrouped-recipe-list::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 3px;
}

#ungrouped-recipe-list::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

/* Recipe Groups */
.groups-header {
  text-align: center;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.groups-header h3 {
  color: var(--primary);
  margin: 0;
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.groups-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.btn-add-group {
  padding: 8px 16px;
  font-size: 0.9rem;
  width: 100%;
}

.groups-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 5px;
}

.groups-container::-webkit-scrollbar {
  width: 6px;
}

.groups-container::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 3px;
}

.groups-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.recipe-group {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  transition: all 0.2s;
}

.recipe-group.drag-over {
  border-color: var(--primary);
  background: var(--bg-tertiary);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.group-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.group-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-profession-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--primary);
  color: var(--bg-primary);
  border-radius: 3px;
  font-weight: 600;
}

.group-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.group-drag-handle {
  cursor: move;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 2px;
}

.group-drag-handle:hover {
  color: var(--primary);
}

.group-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 4px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: text;
  flex: 1;
  max-width: 250px;
}

.group-title:hover {
  border-color: var(--border-color);
  background: var(--bg-primary);
}

.group-title:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-primary);
}

.group-actions {
  display: flex;
  gap: 8px;
}

.group-delete-link {
  color: var(--danger);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.group-delete-link:hover {
  color: var(--danger-hover);
  text-decoration: underline;
}

.group-recipe-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 50px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.group-recipe-list.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.85rem;
}

.group-recipe-list.empty::after {
  content: 'Drag recipes here';
}

.recipe-dropzone.drag-over {
  background: var(--bg-secondary);
  border: 2px dashed var(--primary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background-color: var(--bg-secondary);
  padding: 30px;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide {
  max-width: 1200px;
}

.character-info-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.character-info-section .form-group:first-child {
  grid-column: 1 / -1;
}

.professions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.profession-column {
  background: var(--bg-primary);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex: 1;
  min-width: 0;
}

.profession-column h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--accent-gold);
  font-size: 1.1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.secondary-professions-section {
  margin-bottom: 20px;
}

.secondary-professions-section h3 {
  text-align: center;
  color: var(--accent-gold);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.cooking-centered {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.cooking-profession {
  width: 100%;
  max-width: 480px;
}

.secondary-profession-item {
  background: var(--bg-primary);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.secondary-profession-item .checkbox-item {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.secondary-profession-item .checkbox-item label {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--danger);
}

/* Loading and Error States */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.error {
  background-color: var(--danger);
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.success {
  background-color: var(--success);
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* Search Bar */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 30px;
}

#global-search {
  width: 100%;
  padding: 15px 20px;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.3s;
}

#global-search:focus {
  outline: none;
  border-color: var(--primary);
}

#global-search::placeholder {
  color: var(--text-secondary);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--bg-tertiary);
}

.search-result-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
  text-transform: uppercase;
}

.search-result-type.crafter {
  background-color: var(--primary);
  color: white;
}

.search-result-type.recipe {
  background-color: var(--warning);
  color: white;
}

.search-result-name {
  font-weight: 600;
  color: var(--text-primary);
}

.search-result-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* Time-based highlighting */
.crafter-time-highlight {
  position: relative;
  border-left: 4px solid transparent;
  transition: all 0.3s;
}

.crafter-time-highlight.time-perfect {
  border-left-color: #4caf50;
  background-color: rgba(76, 175, 80, 0.1);
}

.crafter-time-highlight.time-close {
  border-left-color: #8bc34a;
  background-color: rgba(139, 195, 74, 0.08);
}

.crafter-time-highlight.time-near {
  border-left-color: #cddc39;
  background-color: rgba(205, 220, 57, 0.05);
}

.time-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
}

.time-badge.online-now {
  background-color: #4caf50;
  color: white;
}

.time-badge.online-soon {
  background-color: #8bc34a;
  color: white;
}

.time-badge.online-later {
  background-color: #cddc39;
  color: #000;
}

/* Character Details Modal */
#character-details-content {
  padding: 20px;
}

.character-detail-section {
  margin-bottom: 20px;
}

.character-detail-section h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.profession-detail {
  background-color: var(--bg-tertiary);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.profession-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.profession-detail-header.collapsible {
  cursor: pointer;
  padding: 8px 12px;
  margin: -8px -12px 10px -12px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.profession-detail-header.collapsible:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

.profession-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profession-collapse-icon {
  color: var(--primary);
  font-size: 0.9rem;
  transition: transform 0.2s;
  display: inline-block;
  width: 12px;
}

.profession-detail-header.expanded .profession-collapse-icon {
  transform: rotate(0deg);
}

.profession-detail-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.profession-detail-skill {
  color: var(--text-secondary);
}

.profession-recipes-content {
  margin-top: 10px;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.recipe-tag {
  background-color: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
}

/* Recipe Group Sections in Character Details */
.recipe-group-section {
  margin-top: 15px;
  margin-bottom: 15px;
}

.recipe-group-title {
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}

.recipe-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.recipe-link {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
}

.recipe-link:hover {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.recipe-link-disabled {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  display: inline-block;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Recipe Search in Character Details */
.recipe-search-container {
  position: relative;
  margin-bottom: 20px;
}

.recipe-search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s;
}

.recipe-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.recipe-search-input::placeholder {
  color: var(--text-secondary);
}

.recipe-search-container .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  pointer-events: none;
  opacity: 0.5;
}

/* Recipe Filter States */
.recipe-filtered-match {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
  animation: pulseGlow 1.5s ease-in-out infinite;
  transition: all 0.4s ease-in-out;
}

.recipe-filtered-out {
  opacity: 0.25;
  filter: grayscale(70%);
  transition: all 0.4s ease-in-out;
}

.recipe-filtered-out:hover {
  opacity: 0.4;
}

/* Smooth transitions for recipe group sections */
.recipe-group-section {
  transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out;
  overflow: hidden;
}

/* Smooth transitions for profession content expanding/collapsing */
.profession-recipes-content {
  transition: opacity 0.3s ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
  }
  50% {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  }
}

/* Recipe Crafters Modal */
#recipe-crafters-content {
  padding: 20px;
}

.crafter-list-item {
  background-color: var(--bg-tertiary);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crafter-list-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.crafter-list-profession {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Modern Recipe Selector Styles */
.recipe-search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  clear: both;
}

.recipe-search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.recipe-search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.recipe-search-input::placeholder {
  color: var(--text-secondary);
}

.recipe-count {
  padding: 8px 16px;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recipe-count .selected-count {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1.1rem;
}

.recipe-group-section {
  margin-bottom: 16px;
  width: 100%;
  clear: both;
}

.recipe-group-section:last-child {
  margin-bottom: 0;
}

.recipe-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 3px solid var(--accent-color);
  flex-wrap: wrap;
  width: 100%;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.recipe-group-header:hover {
  background: rgba(255, 193, 7, 0.08);
  border-color: var(--accent-color);
  transform: translateX(2px);
}

.recipe-group-header:active {
  transform: translateX(0);
}

.group-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.group-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.recipe-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-left: 8px;
}

.recipe-select-item {
  background: var(--bg-primary);
  border-radius: 6px;
  transition: all 0.2s;
  border: 1px solid transparent;
  min-width: 0;
  overflow: hidden;
}

.recipe-select-item:hover {
  background: rgba(255, 193, 7, 0.05);
  border-color: var(--border-color);
}

.recipe-select-item input[type="checkbox"] {
  display: none;
}

.recipe-select-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  overflow: hidden;
}

.recipe-checkbox-custom {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
  margin-top: 2px;
}

.recipe-select-item input[type="checkbox"]:checked + label .recipe-checkbox-custom {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.recipe-select-item input[type="checkbox"]:checked + label .recipe-checkbox-custom::after {
  content: '✓';
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  font-size: 14px;
}

.recipe-select-item input[type="checkbox"]:checked + label {
  color: var(--accent-color);
}

.recipe-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recipe-select-item input[type="checkbox"]:checked + label .recipe-name {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }
  
  .profession-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .form-container {
    padding: 20px;
  }
  
  nav {
    width: 100%;
    justify-content: center;
  }
}
