/* ==== DonutBot Light Theme ==== */
:root {
  --bg-primary: #88d4eb;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --bg-nav: #fef5ed;
  --accent-orange: #ff9656;
  --accent-orange-hover: #ff8642;
  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-orange: #ff9656;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
}

/* ==== Reset & Base ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==== Typography ==== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-orange);
}

h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ==== Container ==== */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem 1.5rem;
  }
}

/* ==== Navigation Bar ==== */
.nav-bar {
  background: var(--bg-nav);
  padding: 1rem 1.5rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px var(--shadow);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.nav-logo span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-orange);
}

/* ==== Header/Hero Sections ==== */
.guild-header,
.server-header {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px var(--shadow);
}

.guild-header img,
.server-header img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.3s ease;
}

.guild-header img:hover,
.server-header img:hover {
  transform: scale(1.05);
}

.guild-header h1,
.server-header h1 {
  margin-bottom: 1rem;
  color: var(--text-orange);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
}

.guild-header p,
.server-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .guild-header,
  .server-header {
    padding: 3rem 2.5rem;
  }
  
  .guild-header img,
  .server-header img {
    width: 120px;
    height: 120px;
  }
}

/* ==== Server Cards ==== */
.server-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.3s ease;
}

.server-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-hover);
}

.server-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.server-info img {
  width: 56px;
  height: 56px;
  border-radius: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--shadow);
}

.server-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== Module Grid ==== */
.modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .modules {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .modules {
    grid-template-columns: repeat(2, 1fr);
  }
}

.module,
.module-card {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  transition: all 0.3s ease;
  width: 100%;
  max-width: none;
  margin: 0;
  box-shadow: 0 4px 12px var(--shadow);
  text-align: center;
}

.module:hover,
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-hover);
}

.module h3,
.module-card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--text-orange);
}

.module p,
.module-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ==== Buttons ==== */
.btn,
button[type="submit"],
input[type="submit"],
.module a,
.module-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent-orange);
  color: white;
  border: none;
  border-radius: 3rem;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255, 150, 86, 0.3);
  -webkit-appearance: none;
  width: auto;
  max-width: none;
}

@media (min-width: 640px) {
  .btn,
  button[type="submit"],
  input[type="submit"] {
    width: auto;
    min-width: 180px;
  }
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.module a:hover,
.module-card a:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 150, 86, 0.4);
}

.btn:active,
button[type="submit"]:active,
input[type="submit"]:active,
.module a:active,
.module-card a:active {
  transform: translateY(0);
}

.btn.small,
.btn-small {
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  width: auto;
  min-width: auto;
}

.btn.danger {
  background: #e74c3c;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn.danger:hover {
  background: #c0392b;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* ==== Forms ==== */
form {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px var(--shadow);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-orange);
  background: white;
  box-shadow: 0 4px 12px rgba(255, 150, 86, 0.15);
}

input[type="text"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  background: white;
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  line-height: 1.5;
}

small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* ==== Lists ==== */
.joinroles-list,
.counter-list,
.panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.joinroles-item,
.counter-item,
.panel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-secondary);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px var(--shadow);
  transition: all 0.3s ease;
}

.joinroles-item:hover,
.counter-item:hover,
.panel-item:hover {
  background: white;
  box-shadow: 0 4px 12px var(--shadow-hover);
  transform: translateX(4px);
}

.joinroles-role,
.counter-info {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  font-size: 1rem;
}

.joinroles-form,
.counter-form,
.panel-form {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}

.joinroles-remove {
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  width: auto;
  border-radius: 0.75rem;
}

/* ==== Panel Items ==== */
.panel-info {
  flex: 1;
  min-width: 0;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.panel-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.panel-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.panel-actions {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .panel-item {
    flex-direction: column;
    align-items: stretch;
  }
  
  .panel-actions {
    flex-direction: row;
    width: 100%;
  }
  
  .panel-actions button,
  .panel-actions .edit-details {
    flex: 1;
  }
}

.edit-details summary {
  cursor: pointer;
  list-style: none;
  padding: 0.625rem 1.25rem;
  background: var(--accent-orange);
  color: white;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255, 150, 86, 0.3);
}

.edit-details summary::-webkit-details-marker {
  display: none;
}

.edit-details summary:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 150, 86, 0.4);
}

.edit-details[open] summary {
  margin-bottom: 1rem;
}

.panel-edit-form {
  background: var(--bg-secondary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 2px 6px var(--shadow);
}

/* ==== Stats ==== */
.stats {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
}

.stats h3 {
  text-align: left;
  margin-bottom: 1rem;
  color: var(--text-orange);
}

.stats p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* ==== Back Link ==== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 0;
  transition: all 0.3s ease;
  margin-top: 1.5rem;
  font-size: 1rem;
}

.back-link::before {
  content: '←';
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.back-link:hover {
  color: var(--accent-orange-hover);
}

.back-link:hover::before {
  transform: translateX(-4px);
}

/* ==== Page Sections ==== */
.page-section,
.content-area {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
}

/* ==== Add Role Section ==== */
.add-role-section {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
}

.add-role-section h3 {
  margin-bottom: 1.25rem;
  color: var(--text-orange);
}

.add-role-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px var(--shadow);
}

.add-role-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  background: white;
  box-shadow: 0 4px 12px rgba(255, 150, 86, 0.15);
}

/* ==== Responsive Utilities ==== */
@media (max-width: 640px) {
  .container {
    padding: 1rem 0.75rem;
  }
  
  .guild-header,
  .server-header,
  form,
  .stats,
  .page-section,
  .content-area,
  .add-role-section {
    padding: 1.5rem 1.25rem;
  }
  
  .server-card {
    padding: 1rem 1.25rem;
  }
  
  .server-info img {
    width: 48px;
    height: 48px;
  }
  
  .module,
  .module-card {
    padding: 1.75rem 1.5rem;
  }
}

/* ==== Accessibility ==== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

/* ==== Scrollbar ==== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-orange);
}

/* ==== HR Separator ==== */
hr {
  border: none;
  border-top: 2px solid rgba(0, 0, 0, 0.08);
  margin: 1.5rem 0;
}