* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 400px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #000000;
  color: #e0e0e0;
}

.container {
  background: #1a1a1a;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  border: 2px solid #16a75a;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

header {
  background: #0d4a30;
  color: white;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #16a75a;
  box-shadow: 0 2px 10px rgba(0, 255, 65, 0.2);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-weight: 700;
}

.header-title {
  flex: 1;
  text-align: center;
}

.header-title h1 {
  margin: 0;
  font-size: 24px;
}

.header-title .subtitle {
  margin: 5px 0 0 0;
  font-size: 14px;
  opacity: 0.9;
}

.header-settings {
  position: relative;
}

.subtitle {
  font-size: 14px;
  opacity: 0.9;
}

main {
  padding: 20px;
  flex: 1;
}

.status-section {
  background: #0d4a30;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #16a75a;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

#statusIcon {
  font-size: 24px;
}

#statusText {
  font-size: 14px;
  color: #b0b0b0;
}

.character-info {
  background: #0d4a30;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 2px solid #16a75a;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.character-info h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #16a75a;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.info-row .label {
  font-weight: 600;
  color: #16a75a;
}

.info-row span:not(.label) {
  background: transparent !important;
  background-color: transparent !important;
  color: #e0e0e0;
  padding: 0;
  border: none;
}

#charName, #charLevel, #charClass, #charRace {
  background: transparent !important;
  background-color: transparent !important;
  color: #e0e0e0 !important;
  padding: 0 !important;
  border: none !important;
}

.hidden {
  display: none !important;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #16a75a;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

.btn-secondary {
  background: #0d4a30;
  color: #16a75a;
  border: 2px solid #16a75a;
}

.btn-danger {
  background: #f44336;
  color: white;
}

.instructions {
  background: #fff3e0;
  border-radius: 8px;
  padding: 15px;
  border-left: 4px solid #ff9800;
}

.instructions h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #e65100;
}

.instructions ol {
  font-size: 13px;
  padding-left: 20px;
  color: #666;
  line-height: 1.6;
}

.instructions li {
  margin-bottom: 6px;
}

footer {
  background: #0d4a30;
  padding: 10px;
  text-align: center;
  border-top: 2px solid #16a75a;
}

.version {
  font-size: 12px;
  color: #16a75a;
}

/* Login Form Styles */
.login-box {
  padding: 20px 0;
}

.login-box h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #16a75a;
}

.help-text {
  font-size: 13px;
  color: #b0b0b0;
  margin-bottom: 20px;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #16a75a;
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #16a75a;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s;
  background: #0d4a30;
  color: #e0e0e0;
}

.form-group input:focus {
  outline: none;
  border-color: #16a75a;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 15px;
  border-left: 4px solid #c62828;
}

/* User Info Styles */
.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #0d4a30;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 13px;
  border: 1px solid #16a75a;
}

.btn-link {
  background: none;
  border: none;
  color: #16a75a;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
  transition: color 0.3s;
}

.btn-link:hover {
  color: #0d8045;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
}

/* Character Selector Styles */
.character-selector {
  padding: 12px;
  background: #0d4a30;
  border-radius: 6px;
  margin-bottom: 15px;
  border: 2px solid #16a75a;
}

.character-selector label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #16a75a;
  margin-bottom: 8px;
}

.character-dropdown {
  width: 100%;
  padding: 10px;
  border: 1px solid #16a75a;
  border-radius: 4px;
  font-size: 14px;
  background: #1a1a1a;
  color: #e0e0e0;
  cursor: pointer;
  transition: border-color 0.3s;
  appearance: auto;
  -webkit-appearance: menulist;
  position: relative;
  z-index: 10;
}

.character-dropdown:focus {
  outline: none;
  border-color: #16a75a;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.character-dropdown:hover {
  border-color: #16a75a;
}

/* Instructions Styles */
.instructions {
  background: #0d4a30;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  border: 1px solid #16a75a;
}

.instructions h3 {
  margin: 0 0 15px 0;
  color: #16a75a;
  font-size: 16px;
}

/* Quick Steps Layout */
.quick-steps {
  margin-bottom: 20px;
}

.step-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  background: #1a1a1a;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #16a75a;
  min-height: 50px;
}

.step-emoji {
  font-size: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}

.step-text {
  font-size: 12px;
  line-height: 1.2;
}

.step-text strong {
  color: #e0e0e0;
  font-size: 13px;
}

.step-text small {
  color: #b0b0b0;
  font-size: 11px;
}

.step-arrow {
  font-size: 16px;
  color: #16a75a;
  font-weight: bold;
  flex-shrink: 0;
  margin: 0 4px;
}

/* Detailed Steps */
.detailed-steps {
  margin-bottom: 15px;
}

.detailed-steps h4 {
  margin: 0 0 10px 0;
  color: #16a75a;
  font-size: 14px;
}

.instructions ol {
  margin: 0 0 15px 0;
  padding-left: 20px;
}

.instructions li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Special Notes */
.discord-note, .installer-note {
  background: #0d4a30;
  border: 1px solid #16a75a;
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
}

.discord-note p, .installer-note p {
  margin: 0;
  font-size: 12px;
  color: #16a75a;
}

.workflow-note {
  background: #0d4a30;
  border: 1px solid #16a75a;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
}

.workflow-note p {
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.3;
  color: #b0b0b0;
}

.workflow-note strong {
  color: #16a75a;
}

.btn-link:hover {
  color: #0d8045;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.5);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  border: 2px solid #16a75a;
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #16a75a;
  background: #0d4a30;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-title {
  flex: 1;
  text-align: center;
}

.header-settings {
  position: relative;
}

.modal-header h3 {
  font-size: 18px;
  margin: 0;
  color: #16a75a;
  padding: 15px;
}

.modal-close {
  background: none;
  border: none;
  color: #16a75a;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  position: absolute;
  right: 15px;
  top: 15px;
}

.modal-close:hover {
  background: rgba(0, 255, 65, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-help {
  font-size: 14px;
  color: #b0b0b0;
  margin-bottom: 15px;
}

.slot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.slot-card {
  border: 2px solid #16a75a;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  background: #0d4a30;
}

.slot-card:hover {
  border-color: #16a75a;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
  transform: translateY(-2px);
}

.slot-card.empty {
  border-style: dashed;
  background: #1a1a1a;
}

.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slot-number {
  font-weight: 700;
  font-size: 16px;
  color: #16a75a;
}

.slot-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.slot-badge.empty {
  background: #0d4a30;
  border: 1px solid #16a75a;
  color: #16a75a;
}

.slot-badge.occupied {
  background: #16a75a;
  color: #000000;
}

.slot-info {
  font-size: 13px;
  color: #e0e0e0;
}

.slot-info.empty-text {
  color: #707070;
  font-style: italic;
}

.slot-details {
  font-size: 12px;
  color: #b0b0b0;
  margin-top: 4px;
}

/* Spell Slots Styles */
.spell-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.spell-slot-card {
  border: 2px solid #16a75a;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: #0d4a30;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.spell-slot-card:hover {
  border-color: #16a75a;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
  transform: translateY(-2px);
}

.spell-slot-card.empty {
  border-style: dashed;
  border-color: #16a75a;
  background: #1a1a1a;
  color: #707070;
}

.spell-slot-card.empty:hover {
  border-color: #bbb;
  box-shadow: none;
  transform: none;
}

.spell-slot-level {
  font-weight: 700;
  font-size: 14px;
  color: #16a75a;
  margin-bottom: 4px;
}

.spell-slot-card.empty .spell-slot-level {
  color: #707070;
}

.spell-slot-count {
  font-size: 16px;
  font-weight: bold;
  color: #e0e0e0;
}

.spell-slot-card.empty .spell-slot-count {
  color: #707070;
  font-style: italic;
}

/* Responsive adjustments for spell slots */
@media (max-width: 400px) {
  .spell-slots-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }

  .spell-slot-card {
    padding: 10px 8px;
  }

  .spell-slot-level {
  font-size: 12px;
  }

  .spell-slot-count {
    font-size: 14px;
  }
}

/* Auto Backwards Sync Toggle Styles */
#autoBackwardsSyncToggle {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #856404;
  border-radius: 3px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#autoBackwardsSyncToggle:checked {
  background: #856404;
  border-color: #856404;
}

#autoBackwardsSyncToggle:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

#autoBackwardsSyncToggle:hover {
  border-color: #6c520d;
}

#autoBackwardsSyncToggle:focus {
  outline: 2px solid #ffeaa7;
  outline-offset: 2px;
}

/* Settings Dropdown Styles */
.settings-dropdown {
  position: relative;
  display: inline-block;
}

.settings-btn {
  padding: 8px 12px !important;
  font-size: 16px !important;
  min-width: auto !important;
  width: auto !important;
}

.settings-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #0d4a30;
  border: 2px solid #16a75a;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
  z-index: 1000;
  min-width: 180px;
  overflow: hidden;
  margin-top: 8px;
}

.settings-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  color: #e0e0e0;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 0;
}

.settings-item:hover {
  background-color: #1a1a1a;
  color: #16a75a;
}

.settings-item.danger {
  color: #dc3545;
}

.settings-item.danger:hover {
  background-color: #f8d7da;
}

.settings-divider {
  height: 1px;
  background-color: #16a75a;
  margin: 4px 0;
}

/* Database Character Tabs Styles */
.database-tab {
  background: #0d4a30 !important;
  border: 2px solid #16a75a !important;
  position: relative;
}

.database-tab:hover {
  border-color: #16a75a !important;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.5) !important;
  transform: translateY(-2px);
}

.database-tab.active {
  background: #16a75a !important;
  border-color: #0d8045 !important;
  color: #000000 !important;
}

.database-tab.active .char-name,
.database-tab.active .char-details {
  color: #000000 !important;
}

.database-tab .slot-number {
  background: #16a75a !important;
  color: #000000 !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: bold !important;
}

.database-tab .char-details {
  font-size: 11px !important;
  color: #b0b0b0 !important;
  font-weight: 500 !important;
  margin-top: 2px !important;
}

.tab-separator {
  padding: 8px 16px !important;
  text-align: center !important;
  background: #0d4a30 !important;
  border-top: 1px solid #16a75a !important;
  border-bottom: 1px solid #16a75a !important;
  margin: 8px 0 !important;
  border-radius: 4px !important;
}

.tab-separator span {
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
  color: #16a75a !important;
}
