/* CalendarEmbedBot Admin — minimal stylesheet */

:root {
  --bg: #1a1b1e;
  --surface: #25262b;
  --border: #373a40;
  --text: #c1c2c5;
  --text-muted: #6c7086;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --danger: #e03131;
  --success: #2f9e44;
  --warning: #e67700;
  --radius: 6px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.nav-links a { margin-left: 1.25rem; }

/* Container */
.container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.center-page { text-align: center; margin-top: 6rem; }
.center-page h1 { font-size: 2rem; margin-bottom: 1rem; }
.center-page p { margin-bottom: 1.5rem; color: var(--text-muted); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { font-size: 1.1rem; margin-bottom: 0.25rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
}
.form-group input[type="checkbox"] { width: auto; margin-right: 0.4rem; }
.form-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.form-row .flex-grow { flex: 1; }
.form-row .align-end { align-self: flex-end; }
textarea { resize: vertical; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 0.65rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table th { color: var(--text-muted); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: none; }
.table input.inline-edit {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: rgba(47,158,68,.2); color: #69db7c; }
.badge-warning { background: rgba(230,119,0,.2); color: #ffa94d; }
.badge-muted { background: var(--border); color: var(--text-muted); }

/* Misc */
.muted { color: var(--text-muted); }
.url { font-size: 0.8rem; word-break: break-all; }
.empty-state { color: var(--text-muted); padding: 1.5rem 0; }
code { background: var(--border); padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.85em; }

/* Guild list */
.guild-list { list-style: none; }
.guild-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.guild-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}
.guild-info {
  flex: 1;
  min-width: 0;
}
.guild-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-id { font-family: monospace; font-size: 0.8rem; color: var(--text-muted); }

h1 { font-size: 1.6rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }

/* Guild header (icon + name on settings page) */
.guild-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.guild-header h2 {
  margin: 0;
}
.guild-header .muted {
  margin: 0.15rem 0 0 0;
}

/* Searchable Select / Combobox */
.searchable-select {
    position: relative;
}

.channel-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.95rem;
}

.channel-search:focus {
    outline: none;
    border-color: var(--accent);
}

.searchable-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    z-index: 100;
    margin-top: 2px;
}

.searchable-select-dropdown.open {
    display: block;
}

.searchable-select-option {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
}

.searchable-select-option:hover,
.searchable-select-option.active {
    background: var(--accent);
    color: white;
}

.searchable-select-option.selected {
    font-weight: 600;
}

/* Emoji Input Group */
.emoji-input-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.emoji-input-group input {
    flex: 1;
    min-width: 0;
}

.emoji-picker-btn {
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
}

/* Emoji Picker Popup */
.emoji-picker {
    position: fixed;
    width: 350px;
    max-height: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker-header {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.emoji-search {
    flex: 1;
    padding: 0.4rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.85rem;
}

.emoji-search:focus {
    outline: none;
    border-color: var(--accent);
}

.emoji-picker-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.3rem;
}

.emoji-picker-close:hover {
    color: var(--text);
}

.emoji-picker-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.emoji-picker-tabs::-webkit-scrollbar {
    display: none;
}

.emoji-tab {
    padding: 0.4rem 0.6rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.emoji-tab:hover {
    color: var(--text);
}

.emoji-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    gap: 2px;
    padding: 0.5rem;
    overflow-y: auto;
    max-height: 280px;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: background 0.1s;
}

.emoji-item:hover {
    background: var(--accent);
}

.emoji-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.emoji-item.custom-emoji {
    font-size: 0.7rem;
}

.emoji-category-label {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0;
}

/* Discord custom emoji images in the roles table */
.discord-emoji-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

/* Alert banners */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.alert-error {
    background: rgba(224, 49, 49, 0.15);
    border: 1px solid rgba(224, 49, 49, 0.4);
    color: #ff8787;
}
.alert-success {
    background: rgba(47, 158, 68, 0.15);
    border: 1px solid rgba(47, 158, 68, 0.4);
    color: #69db7c;
}

/* Signup post action buttons in events table */
.signup-post-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
