/* ============================================================
   GIVEAWAY — GalaxySeven Member Giveaways Page
   Premium, futuristic, tier-themed styling
   ============================================================ */

:root {
    --gw-bg: #070b14;
    --gw-bg-card: rgba(17, 24, 39, 0.92);
    --gw-bg-card-hover: rgba(23, 32, 52, 0.95);
    --gw-border: #374151;
    --gw-text: #e5e7eb;
    --gw-text-dim: #9ca3af;
    --gw-text-muted: #6b7280;
    --gw-accent: #9333ea;
    --gw-silver: #c0c0c0;
    --gw-gold: #ffd700;
    --gw-diamond: #b9f2ff;
    --gw-green: #22c55e;
    --gw-red: #ef4444;
    --gw-transition: 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── Body ─────────────────────────────────────── */
.gw-body {
    background: var(--gw-bg);
    color: var(--gw-text);
    font-family: "Montserrat", sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ── Page Container ───────────────────────────── */
.gw-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    padding-top: 80px;
}

/* ── Header ───────────────────────────────────── */
.gw-header {
    text-align: center;
    margin-bottom: 40px;
}

.gw-title {
    font-family: "Orbitron", sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0 0 10px;
    color: var(--gw-text);
}

.gw-title span {
    background: linear-gradient(135deg, #f0c040, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gw-subtitle {
    font-size: 1.1rem;
    color: var(--gw-text-dim);
    margin: 0;
}

/* ── Tier Tabs ────────────────────────────────── */
.gw-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.gw-tab {
    padding: 12px 32px;
    border: 1px solid var(--gw-border);
    background: rgba(17, 24, 39, 0.6);
    color: var(--gw-text-dim);
    font-family: "Montserrat", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--gw-transition);
    backdrop-filter: blur(8px);
    clip-path: polygon(8% 0, 100% 0, 92% 100%, 0% 100%);
}

.gw-tab:hover {
    background: rgba(23, 32, 52, 0.8);
    color: var(--gw-text);
    transform: translateY(-2px);
}

.gw-tab.active {
    background: rgba(147, 51, 234, 0.15);
    border-color: var(--gw-accent);
    color: var(--gw-text);
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.2);
}

.gw-tab[data-tier="silver"].active {
    background: rgba(192, 192, 192, 0.12);
    border-color: var(--gw-silver);
    color: var(--gw-silver);
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.2);
}

.gw-tab[data-tier="gold"].active {
    background: rgba(255, 215, 0, 0.12);
    border-color: var(--gw-gold);
    color: var(--gw-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.gw-tab[data-tier="diamond"].active {
    background: rgba(185, 242, 255, 0.12);
    border-color: var(--gw-diamond);
    color: var(--gw-diamond);
    box-shadow: 0 0 20px rgba(185, 242, 255, 0.2);
}

.gw-tab-icon {
    margin-right: 4px;
}

/* ── Member Banner ────────────────────────────── */
.gw-member-banner {
    max-width: 700px;
    margin: 0 auto 32px;
    padding: 14px 24px;
    border: 1px solid #555;
    background: rgba(17, 24, 39, 0.7);
    text-align: center;
    font-size: 0.95rem;
    color: var(--gw-text-dim);
    backdrop-filter: blur(8px);
}

.gw-member-banner a {
    color: var(--gw-gold);
    text-decoration: underline;
}

/* ── Admin Panel ──────────────────────────────── */
.gw-admin-panel {
    max-width: 700px;
    margin: 0 auto 32px;
    padding: 24px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(12px);
}

.gw-admin-panel h3 {
    margin: 0 0 16px;
    font-family: "Orbitron", sans-serif;
    font-size: 1.1rem;
    color: var(--gw-accent);
}

.gw-admin-panel h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: var(--gw-text-dim);
}

.gw-admin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gw-admin-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gw-admin-row label {
    min-width: 110px;
    font-size: 0.9rem;
    color: var(--gw-text-dim);
    font-weight: 500;
}

.gw-admin-row select,
.gw-admin-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--gw-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--gw-text);
    font-family: "Montserrat", sans-serif;
    font-size: 0.9rem;
    transition: border-color var(--gw-transition);
}

.gw-admin-row select:focus,
.gw-admin-row input:focus {
    outline: none;
    border-color: var(--gw-accent);
}

.gw-admin-msg {
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
}

/* ── Giveaway Container ───────────────────────── */
.gw-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.gw-loading,
.gw-error,
.gw-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gw-text-dim);
    font-size: 1.1rem;
}

.gw-error {
    color: var(--gw-red);
}

/* ── Giveaway Card ────────────────────────────── */
.gw-card {
    position: relative;
    border: 1px solid var(--gw-border);
    background: rgba(17, 24, 39, 0.85);
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: all var(--gw-transition);
    overflow: hidden;
}

.gw-card:hover {
    transform: translateY(-4px);
    background: var(--gw-bg-card-hover);
}

.gw-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gw-accent), transparent);
    opacity: 0.3;
}

.gw-card-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* ── Card Item Display ────────────────────────── */
.gw-card-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.gw-card-item-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
}

.gw-card-item-info {
    flex: 1;
    min-width: 0;
}

.gw-card-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gw-text);
    margin-bottom: 4px;
    word-wrap: break-word;
}

.gw-card-item-value {
    font-size: 1.2rem;
    font-weight: 800;
    font-family: "Orbitron", sans-serif;
}

.gw-card-item-wear {
    font-size: 0.72rem;
    color: #9a8abc;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
}

/* ── Timer ────────────────────────────────────── */
.gw-card-timer {
    text-align: center;
    margin-bottom: 12px;
}

.gw-timer-countdown {
    font-family: "Orbitron", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gw-text);
}

.gw-timer-ended {
    font-family: "Orbitron", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gw-text-muted);
}

/* ── Participants ─────────────────────────────── */
.gw-card-participants {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gw-text-dim);
    margin-bottom: 14px;
}

/* ── Winner ───────────────────────────────────── */
.gw-card-winner {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--gw-green);
}

.gw-card-winner-badge {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gw-gold);
}

/* ── Buttons ──────────────────────────────────── */
.gw-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-family: "Montserrat", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--gw-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gw-btn-join {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.gw-btn-join:hover:not(:disabled) {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5);
    transform: translateY(-2px);
}

.gw-btn-join:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gw-btn-joined {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3) !important;
    cursor: default !important;
}

.gw-btn-create {
    background: linear-gradient(135deg, #f0c040, #f59e0b);
    color: #000;
    box-shadow: 0 4px 15px rgba(240, 192, 64, 0.3);
}

.gw-btn-create:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 20px rgba(240, 192, 64, 0.5);
    transform: translateY(-2px);
}

.gw-btn-resolve {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.gw-btn-resolve:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.gw-btn-cancel {
    background: transparent;
    color: var(--gw-red);
    border: 1px solid rgba(239, 68, 68, 0.35);
    margin-top: 8px;
    box-shadow: none;
}

.gw-btn-cancel:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--gw-red);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* ── Item Picker (Admin) ─────────────────────── */
.gw-admin-item-row {
    align-items: flex-start !important;
}

.gw-item-picker {
    flex: 1;
    position: relative;
}

.gw-item-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gw-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--gw-text);
    font-family: "Montserrat", sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color var(--gw-transition);
}

.gw-item-search:focus {
    outline: none;
    border-color: var(--gw-accent);
}

.gw-item-picker-list {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid var(--gw-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: rgba(147, 51, 234, 0.3) transparent;
}

.gw-item-picker-list::-webkit-scrollbar { width: 5px; }
.gw-item-picker-list::-webkit-scrollbar-track { background: transparent; }
.gw-item-picker-list::-webkit-scrollbar-thumb { background: rgba(147, 51, 234, 0.35); border-radius: 3px; }

.gw-item-picker-empty,
.gw-item-picker-more {
    padding: 16px;
    text-align: center;
    color: var(--gw-text-dim);
    font-size: 0.85rem;
}

.gw-item-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.gw-item-picker-item:hover {
    background: rgba(147, 51, 234, 0.15);
}

.gw-item-picker-item img {
    width: 36px; height: 36px;
    border-radius: 4px;
    object-fit: contain;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.gw-item-picker-item-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--gw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gw-item-picker-item-wear {
    font-size: 0.7rem;
    color: #9a8abc;
    background: rgba(255,255,255,0.06);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.gw-item-picker-item-value {
    font-family: "Orbitron", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.gw-item-picker-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 8px;
}

.gw-item-picker-selected img {
    width: 36px; height: 36px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

.gw-item-picker-selected span {
    font-size: 0.85rem;
    color: var(--gw-text);
}

#gw-picked-value {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    margin-left: auto;
}

#gw-picked-clear {
    background: none;
    border: none;
    color: var(--gw-text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

#gw-picked-clear:hover {
    color: var(--gw-red);
}

/* ── Previous Winners Panel ─────────────────── */
.gw-winners-panel {
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 24px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
}

.gw-winners-title {
    margin: 0 0 20px;
    font-family: "Orbitron", sans-serif;
    font-size: 1.2rem;
    color: var(--gw-gold);
    text-align: center;
}

.gw-winners-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.gw-winners-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: var(--gw-text-dim);
    font-size: 0.95rem;
}

.gw-winner-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    transition: background var(--gw-transition);
}

.gw-winner-card:hover {
    background: rgba(0, 0, 0, 0.35);
}

.gw-winner-tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.gw-winner-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gw-winner-name {
    font-size: 0.9rem;
    color: var(--gw-text);
    font-weight: 500;
}

.gw-winner-id {
    font-size: 0.7rem;
    color: var(--gw-text-muted);
    margin-left: 6px;
}

.gw-winner-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gw-winner-item-img {
    width: 28px; height: 28px;
    border-radius: 4px;
    object-fit: contain;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.gw-winner-item-name {
    font-size: 0.8rem;
    color: var(--gw-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gw-winner-item-value {
    font-family: "Orbitron", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    margin-left: auto;
}

.gw-winner-date {
    font-size: 0.72rem;
    color: var(--gw-text-muted);
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .gw-title { font-size: 2rem; }
    .gw-tabs { flex-wrap: wrap; }
    .gw-tab { padding: 10px 20px; font-size: 0.85rem; }
    .gw-container { grid-template-columns: 1fr; }
    .gw-card-item-img { width: 60px; height: 60px; }
    .gw-admin-row { flex-direction: column; align-items: stretch; }
    .gw-admin-row label { min-width: auto; }
    .gw-winners-list { grid-template-columns: 1fr; }
}
