/* ==========================================================================
   ELSHEMY.ME 3D Games Hub — Reusable UI Components
   ========================================================================== */

/* Buttons */
.g3d-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-height: 44px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
}

.g3d-btn:active {
    transform: scale(0.97);
}

.g3d-btn--lg {
    padding: 13px 26px;
    font-size: 1.02rem;
}

.g3d-btn--sm {
    padding: 7px 14px;
    min-height: 36px;
    font-size: 0.85rem;
}

.g3d-btn--primary {
    background: var(--grad-brand);
    color: var(--text-on-accent);
    box-shadow: 0 8px 22px rgba(0, 229, 255, 0.28);
}

.g3d-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 229, 255, 0.38);
}

.g3d-btn--secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.g3d-btn--secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
}

.g3d-btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.g3d-btn--ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.09);
}

.g3d-btn--danger {
    background: var(--accent-coral-soft);
    color: #ff8ca1;
    border-color: rgba(255, 77, 109, 0.35);
}

.g3d-btn--danger:hover {
    background: rgba(255, 77, 109, 0.25);
}

.g3d-icon-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Badges & Pills */
.g3d-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.g3d-badge--accent {
    background: var(--accent-cyan-soft);
    color: var(--accent-cyan);
    border-color: rgba(0, 229, 255, 0.32);
}

.g3d-badge--gold {
    background: var(--accent-gold-soft);
    color: var(--accent-gold);
    border-color: rgba(255, 183, 3, 0.35);
}

.g3d-badge--emerald {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
    border-color: rgba(0, 230, 118, 0.35);
}

.g3d-badge--violet {
    background: var(--accent-violet-soft);
    color: #c2a8ff;
    border-color: rgba(124, 77, 255, 0.35);
}

.g3d-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: rgba(19, 34, 59, 0.72);
    border: 1px solid var(--border-subtle);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.g3d-stat-chip strong {
    color: var(--text-primary);
    font-weight: 800;
}

/* Category Chips */
.g3d-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.g3d-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    min-height: 42px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.g3d-cat-chip:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.g3d-cat-chip.is-active {
    background: var(--grad-brand);
    color: var(--text-on-accent);
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(0, 229, 255, 0.25);
}

.g3d-cat-chip__count {
    font-size: 0.76rem;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
}

/* Search & Filter Toolbar */
.g3d-toolbar {
    display: grid;
    grid-template-columns: 1.4fr repeat(2, minmax(150px, 0.6fr)) auto;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.g3d-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.g3d-input-wrap svg {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.g3d-input,
.g3d-select {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.94rem;
    transition: border-color var(--transition-fast);
}

.g3d-input--search {
    padding-right: 42px;
}

.g3d-input:focus,
.g3d-select:focus {
    border-color: var(--accent-cyan);
    outline: none;
}

/* Game Card */
.g3d-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.g3d-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg), 0 0 24px rgba(0, 229, 255, 0.14);
}

.g3d-card__media {
    position: relative;
    overflow: hidden;
    background: #091324;
}

.g3d-card__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.g3d-card:hover .g3d-card__media img {
    transform: scale(1.05);
}

.g3d-card__badges {
    position: absolute;
    top: 12px;
    right: 12px;
    left: 12px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.g3d-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 10px;
}

.g3d-card__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.g3d-card__desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    flex: 1;
}

.g3d-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.g3d-card__progress {
    font-size: 0.82rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.g3d-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

/* Mini Card (Recommended & Short Games) */
.g3d-mini-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.g3d-mini-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.g3d-mini-card img {
    width: 106px;
    height: 74px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.g3d-mini-card__body {
    min-width: 0;
}

.g3d-mini-card__meta {
    display: block;
    font-size: 0.76rem;
    color: var(--accent-cyan);
    font-weight: 700;
}

.g3d-mini-card h3 {
    margin: 2px 0 4px;
    font-size: 1rem;
    font-weight: 800;
}

.g3d-mini-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Notice & Empty State */
.g3d-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: rgba(19, 34, 59, 0.65);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.g3d-empty {
    text-align: center;
    padding: 44px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    border: 1px dashed var(--border-subtle);
}

/* Modal */
.g3d-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(4, 9, 18, 0.78);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.g3d-modal-backdrop[hidden] {
    display: none;
}

.g3d-modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.g3d-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.g3d-modal__head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.g3d-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

/* Toast Notifications */
.g3d-toasts {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: var(--z-toast);
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.g3d-toast {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.g3d-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.g3d-toast--success {
    border-color: var(--accent-emerald);
}

.g3d-toast--warning {
    border-color: var(--accent-gold);
}

.g3d-toast--error {
    border-color: var(--accent-coral);
}
