/* Tournament Details Page Styles */

/* Hero & Badges */
.th-hero-badge {
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.75rem;
}

.th-invite-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
}

/* Teams Tab */
.th-team-level-badge {
    font-size: 0.7rem;
}

/* Bracket Tab */
.th-bracket-col-bronze {
    background: #f59e0b;
    border-color: #d97706;
}

.th-match-card-bronze {
    border-left-color: #f59e0b;
}

.th-bracket-col-loser {
    background: #b91c1c;
}

.th-grand-final-col {
    min-width: 200px;
    position: relative;
}

.th-final-team-name {
    font-weight: 700;
}

/* Match History Tab */
.th-match-row {
    background: #f8f7ff;
    border: 1.5px solid #e0e7ff;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.th-match-team-name {
    font-size: 0.95rem;
    transition: color 0.2s;
}

.th-match-vs {
    font-size: 0.65rem;
    font-weight: 900;
    color: #6b7280;
    text-transform: lowercase;
    letter-spacing: 0.05em;
    padding: 0 12px;
}

.th-match-meta {
    font-size: 0.62rem;
    font-weight: 800;
    color: #6b7280;
    background: #ffffff;
    border: 1.5px solid #e0e7ff;
    padding: 5px 14px;
    border-radius: 99px;
    text-transform: uppercase;
}

.th-match-outcome {
    font-size: 1.1rem;
    font-weight: 950;
    color: #1e1b4b;
}

/* Modals */
.th-search-modal {
    max-width: 500px;
}

.th-search-results-wrap {
    max-height: 300px;
}

.th-search-avatar {
    width: 40px;
    height: 40px;
    margin-left: 0;
    font-size: 0.8rem;
}

/* General Layout Utilities */
.fw-900 { font-weight: 900; }
.scale-on-hover:hover { transform: scale(1.02); transition: transform 0.2s; }
.hover-bg-light:hover { background: #f8f7ff; cursor: pointer; }
.btn-close-custom { background: none; border: none; font-size: 1.5rem; color: #6b7280; cursor: pointer; }

/* =====================================================
   Terms & Conditions Modal — Polished Rewrite
   ===================================================== */

/* Override the global vn-modal-header icon for terms modal only */
.th-terms-modal .vn-modal-header {
    align-items: flex-start;
    gap: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex-direction: column;
}

/* Hide the blue square icon box entirely in this modal */
.th-terms-modal .vn-header-icon {
    display: none;
}

/* Clean header layout */
.th-terms-modal .vn-header-text {
    flex: 1;
    width: 100%;
}

.th-terms-modal .vn-header-text h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}


.th-terms-modal .vn-header-text p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

/* Position the close button inline with the title */
.th-terms-modal .vn-modal-header .btn-close-custom {
    position: absolute;
    top: 1.15rem;
    right: 1.25rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #9ca3af;
    transition: color 0.15s;
}
.th-terms-modal .vn-modal-header .btn-close-custom:hover {
    color: #1e1b4b;
}

.vn-modal-card.th-terms-modal,
#termsModal .vn-modal-card.th-terms-modal {
    display: flex;
    flex-direction: column;
    max-width: 540px;
    width: min(540px, calc(100vw - 1.5rem));
    max-height: calc(100dvh - 1.5rem);
    height: auto;
    padding: 0 !important;
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    overflow: hidden;
    border-radius: 20px;
    animation: none;
}

.th-terms-modal .vn-modal-header {
    flex-shrink: 0;
    padding: 1.35rem 1.5rem 0;
    margin-bottom: 0;
}

.th-terms-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.5rem 0.5rem;
}

.th-terms-modal-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.35rem;
    margin: 0;
    border-top: 1.5px solid #f0f0f8;
    background: #fff;
}

#termsModal.vn-modal-backdrop {
    display: none;
    align-items: stretch;
    justify-content: stretch;
    padding: 0 !important;
    overflow: hidden !important;
}

#termsModal.vn-modal-backdrop.open {
    display: block !important;
}

/* Tournament banner */
.th-terms-tournament-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8faff;
    border: 1.5px solid #e0e7ff;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* Scrollable Rules Area */
.th-terms-scroll-area {
    max-height: none;
    overflow-y: visible;
    background: #fafbfc;
    border: 1.5px solid #e8ecf4;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.th-terms-scroll-area::-webkit-scrollbar { width: 4px; }
.th-terms-scroll-area::-webkit-scrollbar-track { background: transparent; }
.th-terms-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}

.th-terms-section + .th-terms-section {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid #f0f1f5;
}

.th-terms-section-title {
    font-weight: 800;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #64748b;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.th-terms-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.th-terms-rules-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    font-size: 0.83rem;
    color: #374151;
    line-height: 1.55;
    font-weight: 500;
}

.th-terms-rules-list li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: #6366f1;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 900;
}

.th-terms-body-text {
    font-size: 0.83rem;
    color: #4b5563;
    margin-bottom: 8px;
    font-weight: 500;
    line-height: 1.5;
}

/* ─── Agreement Checkbox Box ─── */
.th-agreement-box {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.th-agreement-box:has(.th-terms-checkbox:checked) {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.th-agreement-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Native checkbox — fully reset and custom styled */
.th-terms-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    margin: 0;
    margin-top: 2px;
    display: grid;
    place-content: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* The checkmark drawn as a CSS clip path — NOT a font icon */
.th-terms-checkbox::before {
    content: '';
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform 0.15s ease-in-out;
    box-shadow: inset 10px 10px #16a34a;
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.th-terms-checkbox:checked {
    border-color: #16a34a;
    background-color: #f0fdf4;
}

.th-terms-checkbox:checked::before {
    transform: scale(1);
}

.th-terms-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.th-agreement-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
    line-height: 1.55;
    cursor: pointer;
    user-select: none;
}

.th-terms-link {
    color: #4f46e5;
    font-weight: 700;
    text-decoration: none;
}

/* ─── Proceed Button ─── */
#btnProceed {
    transition: all 0.2s ease;
}

#btnProceed:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

#btnProceed:not(:disabled) {
    box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
}

#btnProceed:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

/* Category tabs (pill style, horizontal scroll) */
.th-cat-tabs {
    margin-bottom: 1.25rem;
}

.th-cat-tabs-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 0.45rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.th-cat-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.th-cat-tab-btn {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.th-cat-tab-btn:hover {
    color: #1e1b4b;
    background: #e8ecf4;
}

.th-cat-tab-btn.active {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 27, 75, 0.22);
}

/* ─── Mobile: tournament agreement modal & hero (from responsive pack) ─── */
@media (max-width: 768px) {
    .th-hero {
        padding: 1.75rem 1.15rem 1.5rem;
        min-height: auto;
        border-radius: 20px;
    }

    .th-hero-title,
    .th-hero .display-4 {
        font-size: clamp(1.35rem, 6vw, 2rem) !important;
    }

    .th-hero-badges {
        gap: 0.45rem !important;
    }

    .th-hero-badge {
        font-size: 0.62rem !important;
        padding: 0.35rem 0.65rem !important;
    }

    .th-hero-meta {
        gap: 0.5rem;
        margin-top: 0.85rem;
    }

    .th-glass-chip {
        padding: 0.5rem 0.85rem;
        font-size: 0.72rem;
        width: auto;
        max-width: 100%;
    }

    .th-action-corner {
        margin-top: 1rem;
        width: 100%;
    }

    .th-action-corner .btn,
    .th-action-corner a.btn {
        width: 100%;
    }

    .th-tabs-nav {
        top: 68px;
    }

    .th-tab-btn {
        padding: 0.65rem 0.85rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .vn-modal-card.th-terms-modal,
    #termsModal .vn-modal-card.th-terms-modal {
        width: calc(100vw - 1rem) !important;
        max-width: none !important;
        max-height: calc(100dvh - 1rem) !important;
    }

    .th-terms-modal-body {
        padding: 0.85rem 1rem 0.35rem;
    }

    .th-terms-modal-actions {
        flex-direction: column;
        padding: 0.85rem 1rem 1rem;
    }

    .th-terms-modal-actions .btn {
        width: 100%;
    }

    .th-hero .display-4 {
        font-size: clamp(1.35rem, 6vw, 2rem);
    }

    .th-hero-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .th-id-photo-input {
        font-size: 0.875rem;
    }
}


