/* ═══════════════════════════════════════════════════════════
   SteamVault — Request a Game Page Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Page Layout ─────────────────────────────────────────── */
.request-hero {
    padding: 140px 0 60px;
    text-align: center;
    position: relative;
}

.request-hero .hero-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(48, 115, 240, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.request-hero .wrap {
    position: relative;
    z-index: 1;
}

.request-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 30%, rgba(255, 255, 255, 0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.request-hero .hero-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* ── Search Section ──────────────────────────────────────── */
.request-search-wrap {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.request-search-input-wrap {
    position: relative;
}

.request-search-input-wrap .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 2;
}

.request-search-input {
    width: 100%;
    padding: 18px 20px 18px 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.request-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(48, 115, 240, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.request-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Search spinner */
.search-spinner {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.search-spinner.active {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Search Results Dropdown ─────────────────────────────── */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(22, 22, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    display: none;
}

.search-results-dropdown.active {
    display: block;
    animation: dropdownIn 0.2s ease-out;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(48, 115, 240, 0.1);
}

.search-result-item img {
    width: 120px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-appid {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Selected Game Card ──────────────────────────────────── */
.selected-game-card {
    max-width: 640px;
    margin: 32px auto 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    display: none;
    animation: cardIn 0.3s ease-out;
}

.selected-game-card.active {
    display: block;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.selected-game-header {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.selected-game-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-game-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(22, 22, 25, 1), transparent);
}

.selected-game-body {
    padding: 24px;
}

.selected-game-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.selected-game-meta {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.selected-game-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Key status section */
.key-status {
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.key-status-checking {
    background: rgba(48, 115, 240, 0.1);
    border: 1px solid rgba(48, 115, 240, 0.2);
    color: var(--accent);
}

.key-status-found {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: #34D399;
}

.key-status-missing {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #FBBF24;
}

.key-status i, .key-status svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.key-status-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Request button */
.request-game-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent), #5B93FF);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    font-family: 'Inter', sans-serif;
}

.request-game-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(48, 115, 240, 0.3);
}

.request-game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.request-game-btn.success {
    background: linear-gradient(135deg, #059669, #34D399);
    pointer-events: none;
}

.already-supported-btn {
    width: 100%;
    padding: 16px;
    background: rgba(52, 211, 153, 0.1);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

/* ── Request List Section ────────────────────────────────── */
.request-list-section {
    padding: 60px 0 100px;
}

.request-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.request-list-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.request-stats-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.request-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.request-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.request-stat-value.accent {
    color: var(--accent);
}

.request-stat-value.success {
    color: #34D399;
}

/* Filter tabs */
.request-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.filter-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Request cards grid */
.request-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.request-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.request-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.request-card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.request-card-body {
    padding: 16px;
}

.request-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-card-appid {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 12px;
}

.request-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.12);
    color: #FBBF24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-badge.added {
    background: rgba(52, 211, 153, 0.12);
    color: #34D399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-badge.declined {
    background: rgba(248, 113, 113, 0.12);
    color: #F87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Vote button */
.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.vote-btn:hover:not(.voted) {
    background: rgba(48, 115, 240, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.vote-btn.voted {
    background: rgba(48, 115, 240, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    cursor: default;
}

.vote-btn i, .vote-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Empty State ─────────────────────────────────────────── */
.request-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.request-empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.request-empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}

/* ── Loading State ───────────────────────────────────────── */
.request-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.request-loading .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* ── Toast Notification ──────────────────────────────────── */
.request-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(22, 22, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    color: var(--text);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.request-toast.show {
    transform: translateX(-50%) translateY(0);
}

.request-toast.success {
    border-color: rgba(52, 211, 153, 0.3);
}

.request-toast.error {
    border-color: rgba(248, 113, 113, 0.3);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .request-hero {
        padding: 120px 0 40px;
    }

    .request-cards-grid {
        grid-template-columns: 1fr;
    }

    .request-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .selected-game-header {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .request-search-input {
        padding: 14px 16px 14px 44px;
        font-size: 0.95rem;
    }

    .selected-game-body {
        padding: 16px;
    }

    .selected-game-title {
        font-size: 1.2rem;
    }
}
