/* ══════════════════════════════════
   AQUA GUILDS v2 — Premium Dark Theme
   ══════════════════════════════════ */

.ag-guild-list, .ag-leaderboard {
	max-width: 1000px;
	margin: 0 auto;
	padding: 20px;
	color: #fff;
}

/* ── Buttons ── */
.ag-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
	cursor: pointer; border: 1px solid rgba(255,255,255,0.1);
	background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7);
	text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.ag-btn:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
.ag-btn--join { background: var(--ag-color, #005F99); border-color: transparent; color: #fff; }
.ag-btn--join:hover { filter: brightness(1.15); }
.ag-btn--leave { background: rgba(231,76,60,0.15); border-color: rgba(231,76,60,0.3); color: #e74c3c; }
.ag-btn--leave:hover { background: rgba(231,76,60,0.25); }
.ag-btn--member {
	background: color-mix(in srgb, var(--ag-color, #27ae60) 15%, transparent);
	border-color: color-mix(in srgb, var(--ag-color, #27ae60) 30%, transparent);
	color: var(--ag-color, #27ae60); cursor: default;
}
.ag-btn--disabled { opacity: 0.4; cursor: not-allowed; }
.ag-btn--login { color: #48CAE4; }

/* ── Header ── */
.ag-guild-list__header, .ag-leaderboard__header { text-align: center; margin-bottom: 28px; }
.ag-guild-list__title, .ag-leaderboard__title { font-size: 28px; font-weight: 700; color: #fff; margin: 0 0 8px; }
.ag-guild-list__sub, .ag-leaderboard__sub { color: rgba(255,255,255,0.4); font-size: 14px; margin: 0; }

/* ── My guild banner ── */
.ag-my-guild-banner {
	display: flex; align-items: center; gap: 12px;
	background: color-mix(in srgb, var(--ag-color, #48CAE4) 8%, transparent);
	border: 1px solid color-mix(in srgb, var(--ag-color, #48CAE4) 25%, transparent);
	border-radius: 12px; padding: 14px 18px; margin-bottom: 24px;
}
.ag-my-guild-banner__icon { font-size: 28px; }
.ag-my-guild-banner__info { flex: 1; }
.ag-my-guild-banner__text { color: rgba(255,255,255,0.8); font-size: 14px; display: block; }
.ag-aura-hl { color: var(--ag-color, #48CAE4); }

/* Daily aura stats */
.ag-daily-stats {
	display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.ag-daily-stat {
	font-size: 11px; color: rgba(255,255,255,0.45);
	background: rgba(255,255,255,0.04); border-radius: 4px; padding: 2px 8px;
}
.ag-daily-stat--total { color: var(--ag-color, #48CAE4); font-weight: 600; }

/* Cooldown banner */
.ag-cooldown-banner {
	background: rgba(230,126,34,0.1); border: 1px solid rgba(230,126,34,0.25);
	border-radius: 10px; padding: 14px 18px; margin-bottom: 24px;
	color: rgba(255,255,255,0.7); font-size: 14px; text-align: center;
}
.ag-cooldown-banner strong { color: #e67e22; }

/* ══════════════════════════════════
   GUILD CARDS
   ══════════════════════════════════ */
.ag-guild-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.ag-guild-card {
	background: rgba(255,255,255,0.025);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 16px; padding: 24px 20px; text-align: center;
	position: relative; transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}
.ag-guild-card:hover {
	border-color: color-mix(in srgb, var(--ag-color, #48CAE4) 40%, transparent);
	transform: translateY(-3px);
	box-shadow: 0 8px 32px color-mix(in srgb, var(--ag-color, #48CAE4) 10%, transparent);
}
.ag-guild-card--mine {
	border-color: color-mix(in srgb, var(--ag-color, #48CAE4) 35%, transparent);
	background: color-mix(in srgb, var(--ag-color, #48CAE4) 5%, transparent);
}
.ag-guild-card__rank {
	position: absolute; top: 12px; right: 14px;
	font-size: 12px; color: rgba(255,255,255,0.2); font-weight: 700;
}
.ag-guild-card__icon { font-size: 52px; margin-bottom: 10px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.ag-guild-card__name { font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 8px; }
.ag-guild-card__desc {
	font-size: 12px; color: rgba(255,255,255,0.35); margin: 0 0 16px;
	line-height: 1.6; min-height: 40px;
}
.ag-guild-card__stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.ag-guild-card__stat { text-align: center; }
.ag-guild-card__stat-value { display: block; font-size: 20px; font-weight: 700; color: var(--ag-color, #48CAE4); }
.ag-guild-card__stat-label {
	display: block; font-size: 9px; color: rgba(255,255,255,0.3);
	text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px;
}
.ag-guild-card__actions { margin-top: 8px; }
.ag-guild-card__actions .ag-btn { width: 100%; }
.ag-guild-card__my-aura { font-size: 11px; color: rgba(255,255,255,0.35); text-align: center; margin-top: 8px; }
.ag-guild-card__my-aura strong { color: var(--ag-color, #48CAE4); }

/* Toggle button */
.ag-guild-card__toggle {
	background: none; border: none; color: var(--ag-color, #48CAE4);
	font-size: 12px; font-weight: 600; cursor: pointer;
	padding: 10px 0 0; width: 100%; text-align: center; transition: color 0.2s;
}
.ag-guild-card__toggle:hover { color: #fff; }

/* Members panel */
.ag-guild-card__members {
	margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 12px; text-align: left;
}
.ag-no-members { color: rgba(255,255,255,0.25); font-size: 12px; text-align: center; margin: 0; }

/* Mini member list (shared) */
.ag-mini-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.ag-mini-list::-webkit-scrollbar { width: 4px; }
.ag-mini-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.ag-mini-list::-webkit-scrollbar-track { background: transparent; }

.ag-mini-member {
	display: flex; align-items: center; gap: 8px; padding: 6px 8px;
	border-radius: 6px; text-decoration: none; transition: background 0.15s;
}
.ag-mini-member:hover { background: rgba(255,255,255,0.04); }
.ag-mini-member--top { background: rgba(244,208,63,0.06); }
.ag-mini-member__rank {
	font-size: 11px; color: rgba(255,255,255,0.25); min-width: 20px; text-align: center;
}
.ag-mini-member--top .ag-mini-member__rank { font-size: 14px; }
.ag-mini-member__avatar { border-radius: 50%; flex-shrink: 0; }
.ag-mini-member__name {
	flex: 1; font-size: 12px; color: rgba(255,255,255,0.8);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ag-mini-member--top .ag-mini-member__name { color: #fff; font-weight: 600; }
.ag-mini-member__aura { font-size: 11px; color: var(--ag-color, #48CAE4); font-weight: 600; flex-shrink: 0; }

/* Activity feed */
.ag-activity { margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.04); padding-top: 8px; }
.ag-activity__label {
	display: block; font-size: 9px; color: rgba(255,255,255,0.25);
	text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px;
}
.ag-activity__item {
	display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 11px;
}
.ag-activity__avatar { border-radius: 50%; flex-shrink: 0; }
.ag-activity__text { flex: 1; color: rgba(255,255,255,0.5); }
.ag-activity__text strong { color: rgba(255,255,255,0.7); }
.ag-activity__time { color: rgba(255,255,255,0.2); font-size: 10px; flex-shrink: 0; }

/* ══════════════════════════════════
   LEADERBOARD
   ══════════════════════════════════ */
.ag-podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-bottom: 32px; }
.ag-podium__item {
	background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06);
	border-radius: 16px; padding: 20px 16px; text-align: center; width: 200px;
	transition: transform 0.2s, box-shadow 0.3s;
}
.ag-podium__item:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px color-mix(in srgb, var(--ag-color, #48CAE4) 15%, transparent);
}
.ag-podium__item--gold {
	border-color: rgba(244,208,63,0.3); background: rgba(244,208,63,0.05); padding: 28px 16px;
}
.ag-podium__item--silver { border-color: rgba(189,195,199,0.3); background: rgba(189,195,199,0.03); }
.ag-podium__item--bronze { border-color: rgba(205,127,50,0.3); background: rgba(205,127,50,0.03); }
.ag-podium__place { font-size: 28px; margin-bottom: 6px; }
.ag-podium__icon { font-size: 44px; margin-bottom: 6px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
.ag-podium__name { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.ag-podium__aura { font-size: 20px; font-weight: 700; color: var(--ag-color, #48CAE4); }
.ag-podium__members { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px; }

/* Leaderboard rows */
.ag-leaderboard__list { display: flex; flex-direction: column; }
.ag-leaderboard__item { border-bottom: 1px solid rgba(255,255,255,0.04); }
.ag-leaderboard__row {
	display: flex; align-items: center; gap: 14px; padding: 14px 16px;
	border-radius: 8px; text-decoration: none; transition: background 0.15s;
}
.ag-leaderboard__row:hover { background: rgba(255,255,255,0.03); }
.ag-leaderboard__rank { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.25); min-width: 28px; text-align: center; }
.ag-leaderboard__icon { font-size: 28px; }
.ag-leaderboard__name { flex: 1; color: #fff; font-size: 15px; font-weight: 600; }
.ag-leaderboard__members { font-size: 12px; color: rgba(255,255,255,0.3); }
.ag-leaderboard__aura {
	font-size: 13px; font-weight: 700; padding: 4px 14px; border-radius: 20px;
}
.ag-leaderboard__chevron {
	font-size: 12px; color: rgba(255,255,255,0.25); transition: transform 0.2s;
}
.ag-leaderboard__row.is-open .ag-leaderboard__chevron { transform: rotate(180deg); }
.ag-leaderboard__member-panel {
	padding: 6px 16px 14px 56px; background: rgba(255,255,255,0.015);
}

/* ── Toast ── */
.ag-toast {
	position: fixed; bottom: 24px; left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: #1a1a2e; border: 1px solid rgba(72,202,228,0.3);
	border-radius: 10px; padding: 14px 24px; color: #fff;
	font-size: 14px; font-weight: 500; z-index: 99999; opacity: 0;
	transition: all 0.3s ease; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.ag-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.ag-toast--error { border-color: rgba(231,76,60,0.3); }

/* ── Confirm modal ── */
.ag-confirm-overlay {
	position: fixed; top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.7); z-index: 99998;
	display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ag-confirm-modal {
	background: #1a1a2e; border: 1px solid rgba(255,255,255,0.1);
	border-radius: 14px; padding: 28px; text-align: center;
	max-width: 360px; width: 100%;
}
.ag-confirm-modal__text { color: rgba(255,255,255,0.8); font-size: 16px; margin: 0 0 20px; line-height: 1.5; }
.ag-confirm-modal__text strong { color: #fff; }
.ag-confirm-modal__btns { display: flex; gap: 10px; }
.ag-confirm-modal__btns .ag-btn { flex: 1; justify-content: center; }

/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */
@media (max-width: 767px) {
	.ag-guild-grid { grid-template-columns: 1fr; gap: 12px; }
	.ag-podium { flex-direction: column; align-items: center; }
	.ag-podium__item { width: 100%; max-width: 300px; }
	.ag-guild-list__title, .ag-leaderboard__title { font-size: 22px; }
	.ag-my-guild-banner { flex-direction: column; text-align: center; gap: 8px; }
	.ag-leaderboard__row { gap: 8px; padding: 12px 10px; }
	.ag-leaderboard__member-panel { padding-left: 16px; }
}
@media (min-width: 768px) and (max-width: 992px) {
	.ag-guild-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Fallbacks for color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
	.ag-guild-card:hover { border-color: rgba(72,202,228,0.3); }
	.ag-guild-card--mine { border-color: rgba(72,202,228,0.25); background: rgba(72,202,228,0.04); }
	.ag-my-guild-banner { background: rgba(72,202,228,0.08); border-color: rgba(72,202,228,0.2); }
	.ag-btn--member { background: rgba(39,174,96,0.15); border-color: rgba(39,174,96,0.25); color: #27ae60; }
	.ag-podium__item:hover { box-shadow: 0 8px 24px rgba(72,202,228,0.1); }
}
