/* Server admin: server icons and banner, channel row gears and user limits, Channel Settings,
   Server Settings' Overview and Bans tabs, and the ban dialog (client/js/guildAdmin.js).
   Uses the theme tokens from styles.css. */

/* Server icons in the rail fill the round button and follow its hover/active rounding. */
.guild-icon:has(.guild-icon-img) { background: none; overflow: visible; }
.guild-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* The banner sits at the top of the channel list. */
.guild-banner { margin: -12px -8px 8px; aspect-ratio: 16 / 9; max-height: 136px; overflow: hidden; background: var(--bg-rail); }
.guild-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
#guild-header .guild-header-name { cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#guild-header .guild-header-name:hover { color: var(--text); }

/* Channel rows: the gear (Manage Channels) shows on hover, focus and on the open channel. */
.channel-row { position: relative; }
.channel-row.manageable .channel { padding-right: 32px; }
.voice-channel-row.manageable .channel { padding-right: 62px; }
.channel-settings-button { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text-muted); opacity: 0; }
.voice-channel-row .channel-settings-button { right: 34px; }
.channel-row:hover .channel-settings-button, .voice-channel-row:hover .channel-settings-button,
.channel-row:has(.channel.active) .channel-settings-button, .channel-settings-button:focus-visible { opacity: 1; }
.channel-settings-button:hover { color: var(--text-strong); }
.user-limit-pill { flex: none; margin-left: auto; padding: 0 6px; border-radius: 8px; background: var(--bg-rail); color: var(--text-muted); font-size: 11px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; }
.user-limit-pill.full { color: var(--danger); }

/* Channel Settings and the Server Settings tabs. */
.channel-settings-title { display: flex; align-items: center; gap: 4px; color: var(--text-strong); font-weight: 700; overflow-wrap: anywhere; }
.channel-settings-title .icon { flex: none; color: var(--text-muted); }
.channel-settings-kind { padding: 0 10px 8px; text-transform: uppercase; font-weight: 700; font-size: 11px; }
.settings-nav-separator { height: 1px; margin: 8px 10px; background: var(--border); }
.settings-nav button:disabled { opacity: 0.5; cursor: not-allowed; }
.channel-settings .settings-content { display: flex; flex-direction: column; }
.channel-settings .settings-form { max-width: 560px; }
.channel-topic-input, .channel-name-input, .server-name-input, .ban-reason { width: 100%; }
.char-count { align-self: flex-end; }
.user-limit-input { flex: 1; max-width: 360px; accent-color: var(--accent); }
.user-limit-value { min-width: 72px; color: var(--text-strong); font-weight: 600; }
.save-bar { position: sticky; bottom: 0; margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: var(--radius); background: var(--bg-rail); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
.save-bar > span { flex: 1; color: var(--text-strong); }
.save-bar button.primary { padding: 8px 14px; }

.server-overview-row { display: flex; align-items: center; gap: 20px; margin: 8px 0 24px; }
.server-icon-preview { width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--accent); color: #fff; font-size: 28px; font-weight: 700; }
.server-icon-preview .guild-icon-img { border-radius: 0; }
.server-overview-text { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.server-overview-row .settings-row button.secondary { padding: 8px 14px; }
.server-name-input { max-width: 360px; }
.server-banner-preview { width: min(100%, 420px); aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-rail); display: grid; place-items: center; }
.server-banner-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ban-list { display: flex; flex-direction: column; }
.ban-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ban-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.ban-row button.revoke-ban { padding: 6px 12px; flex: none; }
.ban-row button.revoke-ban:hover { background: var(--danger); color: #fff; }

/* Ban and delete confirmations. */
.guild-admin-modal .settings-field { margin-top: 12px; }
.guild-admin-modal select, .guild-admin-modal textarea { width: 100%; }
.guild-admin-modal textarea { resize: vertical; }
.guild-admin-modal .modal-actions .danger-button { padding: 10px 16px; }

/* The server header keeps its buttons on one line; the name gives way (with an ellipsis). */
#guild-header > .guild-header-name { flex: 1; }
#guild-header > span:last-child { flex: none; display: inline-flex; align-items: center; }
.channel-settings-title { text-transform: none; font-size: 15px; }
.save-server-name:disabled { opacity: 0.5; cursor: not-allowed; }
.guild-admin-modal .modal-actions button.danger-button { background: var(--danger); color: #fff; border-radius: 4px; padding: 10px 16px; }
.guild-admin-modal .modal-actions button.danger-button:disabled { opacity: 0.6; }
.guild-admin-modal select { font: inherit; color: var(--text); background: var(--bg-rail); border: 0; border-radius: 4px; padding: 10px; outline: none; }
.guild-admin-modal select:focus { box-shadow: 0 0 0 2px var(--accent); }
