/* ============================================================================
   home.css — styles scoped to index.php (home page)
   Loaded AFTER style.css, so selectors here override shared defaults.
   ============================================================================ */

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero-section-home {
    position: relative;
    padding: 5rem 0 3rem !important;
    overflow: hidden;
    background: transparent !important;
}

/* soft radial glow behind the hero text — not a flat color */
.hero-section-home::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(0, 217, 255, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 40% 60% at 85% 30%, rgba(74, 222, 128, 0.06) 0%, transparent 60%);
}

.hero-section-home .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-section-home h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 14px;
    background: linear-gradient(180deg, #ffffff 0%, #bcd3ea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-section-home p {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.55;
}

.hero-section-home .hero-cta-row {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 14px 26px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
    border: 1px solid transparent;
    line-height: 1;
}

.hero-btn i { font-size: 1em; }

.hero-btn-primary {
    background: linear-gradient(135deg, #00D9FF 0%, #0099cc 100%);
    color: #04141e !important;
    box-shadow: 0 6px 22px rgba(0, 217, 255, 0.28);
}

.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.45);
    color: #04141e !important;
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-primary);
    border-color: rgba(0, 217, 255, 0.28);
}

.hero-btn-secondary:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.5);
    transform: translateY(-2px);
}

/* ── Section headers (shared pattern across home) ────────────────────────── */
.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 14px;
}

.home-section-head h2 {
    margin: 0;
    padding: 0;
    font-size: clamp(1.25rem, 2.3vw, 1.6rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Circular refresh button — unified */
.home-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .18s;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.home-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.5);
    color: #fff;
}

.home-icon-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Combined "player count + refresh" pill (for the server section) */
.home-counter-pill {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    cursor: pointer;
    overflow: hidden;
    transition: background .18s, border-color .18s;
    font-family: inherit;
    flex-shrink: 0;
}

.home-counter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 222, 128, 0.45);
}

.home-counter-pill .counter-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.home-counter-pill .counter-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.home-counter-pill .counter-right {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: rgba(255, 255, 255, 0.45);
}

/* ── Rental cards (pricing) ─────────────────────────────────────────────── */
.rental-services-banner {
    padding: 2rem 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

.rental-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.rental-card {
    position: relative;
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.85) 0%, rgba(18, 22, 34, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.75rem 1.5rem 1.5rem;
    transition: transform .22s, border-color .22s, box-shadow .22s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* subtle top highlight line */
.rental-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.5), transparent);
    opacity: 0;
    transition: opacity .3s;
}

.rental-card:hover::before { opacity: 1; }

.rental-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 217, 255, 0.35);
    box-shadow: 0 16px 40px -10px rgba(0, 217, 255, 0.25);
}

.rental-card-premium {
    border-color: rgba(255, 215, 0, 0.22);
}

.rental-card-premium::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.55), transparent);
}

.rental-card-premium:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 16px 40px -10px rgba(255, 215, 0, 0.22);
}

.rental-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.rental-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rental-badge-standard {
    background: rgba(0, 217, 255, 0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 217, 255, 0.25);
}

.rental-badge-premium {
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.rental-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}

.price-amount {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--accent-primary);
    letter-spacing: -0.02em;
}

.rental-card-premium .price-amount { color: #FFD700; }

.price-period {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rental-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.rental-features {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    padding: 2px 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.feature-item i {
    color: #4ade80;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.rental-button {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform .18s, box-shadow .18s;
    text-decoration: none;
}

.rental-button-primary {
    background: linear-gradient(135deg, #00D9FF, #0099cc);
    color: #04141e !important;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.rental-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 217, 255, 0.45);
    color: #04141e !important;
}

.rental-button-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #2a1a00 !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
}

.rental-button-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255, 215, 0, 0.4);
    color: #2a1a00 !important;
}

/* Light theme overrides kept from the original */
html[data-theme="light"] .rental-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .rental-card:hover {
    box-shadow: 0 12px 30px rgba(0, 153, 204, 0.15);
}
html[data-theme="light"] .price-amount { color: #0099cc; }
html[data-theme="light"] .rental-card-premium .price-amount { color: #ff8c00; }
html[data-theme="light"] .rental-badge-premium {
    background: rgba(255, 140, 0, 0.08);
    color: #ff8c00;
    border-color: rgba(255, 140, 0, 0.25);
}

/* ── Server down state (used from loadServers) ──────────────────────────── */
.server-down-card {
    opacity: 0.65;
    cursor: not-allowed !important;
}

.server-bg-overlay-dark {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 1;
}

.server-down-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.92rem;
    margin-top: 0.5rem;
}

.server-down-status i { font-size: 1.1rem; }

/* ── Recent matches list ─────────────────────────────────────────────────── */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0;
}

.match-list-item {
    display: flex;
    align-items: stretch;
    padding: 0;
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.85) 0%, rgba(18, 22, 34, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    text-decoration: none;
    overflow: hidden;
}

html[data-theme="light"] .match-list-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.match-list-item:hover {
    transform: translateX(4px);
    border-color: rgba(0, 217, 255, 0.4);
    box-shadow: 0 6px 22px rgba(0, 217, 255, 0.15);
}

.match-map-image {
    flex-shrink: 0;
    width: 180px;
    height: auto;
    min-height: 110px;
    position: relative;
    overflow: hidden;
}

.match-map-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.match-list-item:hover .match-map-image img {
    transform: scale(1.06);
}

.map-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px 12px;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
    pointer-events: none;
}

.map-name {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.match-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem 1.25rem;
    min-width: 0;
}

.match-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.match-id {
    font-size: 0.78rem;
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.match-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.match-list-teams {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    transition: background .15s;
}

html[data-theme="light"] .team-row { background: rgba(0, 0, 0, 0.03); }

.team-row.winner {
    background: rgba(74, 222, 128, 0.08);
    border-left-color: #4ade80;
}

html[data-theme="light"] .team-row.winner {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: #10b981;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-row.winner .team-name { color: #4ade80; }
html[data-theme="light"] .team-row.winner .team-name { color: #10b981; }

.team-score {
    font-size: 1.35rem;
    font-weight: 800;
    min-width: 42px;
    text-align: right;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.team-row.winner .team-score { color: #4ade80; }
html[data-theme="light"] .team-row.winner .team-score { color: #10b981; }

.match-list-arrow {
    display: flex;
    align-items: center;
    padding-right: 1.25rem;
    color: var(--text-muted);
    transition: color .2s, transform .2s;
}

.match-list-item:hover .match-list-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background .18s, border-color .18s;
}

.pagination-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.4);
    color: var(--accent-primary);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Admin-only section accents ─────────────────────────────────────────── */
.admin-section-title {
    color: #5b9cff !important;
}

/* second admin header needs extra top spacing */
.admin-head-spaced { margin-top: 2rem; }

/* Generic "loading..." and "no matches" placeholders */
.home-loading-text,
.home-empty-text {
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
    font-size: 0.88rem;
    margin: 0;
}

.home-empty-text { padding: 2.5rem 1rem; }

/* ── Mobile tweaks ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-section-home { padding: 3rem 0 2rem !important; }

    .hero-btn {
        padding: 13px 22px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }

    .hero-section-home .hero-cta-row { flex-direction: column; }

    .rental-grid { grid-template-columns: 1fr; gap: 1rem; }
    .rental-card { padding: 1.25rem; }
    .price-amount { font-size: 1.3rem; }
    .rental-title { font-size: 1.05rem; }

    /* Match list stacks on mobile */
    .match-list-item { flex-direction: column; }
    .match-map-image { width: 100%; height: 130px; }
    .match-list-content { padding: 0.85rem 1rem; }
    .match-list-arrow { display: none; }

    .team-score { font-size: 1.15rem; min-width: 36px; }
}

@media (max-width: 480px) {
    .home-section-head h2 { font-size: 1.15rem; }
    .match-list-header { gap: 4px; }
    .match-date { font-size: 0.68rem; }
}

/* ── Login required modal ──────────────────────────────────────────────── */
.login-required-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 18, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    opacity: 0;
    transition: opacity .18s ease;
}

.login-required-overlay.is-open {
    display: flex;
    opacity: 1;
}

.login-required-modal {
    position: relative;
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.98) 0%, rgba(18, 22, 34, 0.99) 100%);
    border: 1px solid rgba(0, 217, 255, 0.22);
    border-radius: 18px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(0, 217, 255, 0.08);
    animation: loginModalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes loginModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-required-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
    font-family: inherit;
}

.login-required-close:hover { color: #fff; }

.login-required-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #00D9FF, #0099cc);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.35);
}

.login-required-icon i {
    font-size: 1.7rem;
    color: #04141e;
}

.login-required-title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

.login-required-body {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 22px;
}

.login-required-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.login-required-btn {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s, background .15s, box-shadow .15s, border-color .15s;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
}

.login-required-btn:active { transform: translateY(1px); }

.login-required-btn-primary {
    background: linear-gradient(135deg, #00D9FF, #0099cc);
    color: #04141e;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.3);
}

.login-required-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 217, 255, 0.45);
    color: #04141e;
}

.login-required-btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

.login-required-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

@media (max-width: 420px) {
    .login-required-actions { grid-template-columns: 1fr; }
    .login-required-modal { padding: 28px 22px 22px; }
    .login-required-title { font-size: 1.2rem; }
}

/* ==================== HOME MOBILE POLISH ==================== */

@media (max-width: 768px) {
    /* Hero buttons stack cleanly */
    .hero-cta-row { gap: 10px; }
    .hero-btn { min-height: 48px; border-radius: 10px; }

    /* Match list items */
    .match-list-item { border-radius: 10px; }
    .match-list-content { padding: 0.75rem; }
    .match-team-row { gap: 6px; }
    .team-name-home { font-size: 0.85rem; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .team-score { font-size: 1.05rem; min-width: 28px; }

    /* Rental cards on home */
    .rental-card { border-radius: 10px; }
    .rental-title { font-size: 1rem; }
    .price-amount { font-size: 1.2rem; }
    .rental-book-btn { min-height: 44px; font-size: 0.9rem; }

    /* Section header row */
    .home-section-head { margin-bottom: 1rem; }
    .home-section-head h2 { font-size: 1.15rem; }
}

@media (max-width: 375px) {
    .match-list-header { padding: 0.5rem 0.75rem; }
    .match-date { font-size: 0.65rem; }
    .home-section-head h2 { font-size: 1rem; }
    .match-map-image { height: 110px; }
    .rental-grid { gap: 0.75rem; }
}