/* invite-styles.css */

/* Use variables from styles.css and leaderboard-styles.css */

/* --- Base Body & Container --- */
body {
    /* Ensure background from styles.css shows */
    background-color: transparent;
    /* Allow scrolling if content overflows */
    overflow-y: auto;
}

.container {
    max-width: 95%; /* Match leaderboard */
    padding: 15px;
    background-color: var(--leaderboard-bg, rgba(25, 35, 55, 0.9)); /* Use leaderboard bg */
    border: 1px solid var(--leaderboard-border, rgba(93, 156, 236, 0.3)); /* Use leaderboard border */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    margin: 20px auto; /* Center with margin */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}

/* --- Header & Explanation --- */
.page-title { /* h1 */
    font-size: 28px;
    color: var(--spy-gold-accent);
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    border-bottom: 1px solid var(--leaderboard-border);
    padding-bottom: 15px;
}

.explanation { /* p */
    text-align: center;
    margin-bottom: 25px;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
    line-height: 1.5;
}

/* --- Sections & Section Headers --- */
.section {
    margin-bottom: 25px;
}
.section:last-of-type {
    margin-bottom: 15px; /* Less margin before buttons */
}

.section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0 0 12px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3); /* Subtle gold underline */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invite-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--tg-theme-hint-color);
}

/* --- User Info Box --- */
.user-info {
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info .username { /* Class inside user-info */
    font-weight: 600;
    font-size: 15px;
    color: var(--tg-theme-text-color);
}

.status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.premium {
    background-color: var(--spy-gold-accent);
    color: #111;
    box-shadow: 0 0 5px var(--spy-gold-glow);
}

.status.free {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--tg-theme-text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Referral Link Input --- */
.referral-link {
    width: 100%;
    height: 44px; /* Slightly taller */
    font-size: 14px;
    padding: 0 15px;
    border-radius: 6px;
    border: 1px solid var(--leaderboard-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--tg-theme-text-color);
    margin-bottom: 12px;
    font-family: inherit;
    font-weight: 500;
}

.referral-link:read-only {
    opacity: 1;
    color: var(--tg-theme-hint-color); /* Make read-only dimmer */
}

/* --- Button Group & Buttons --- */
.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* Use base .button style from styles.css but override specifics */
.button-group .button {
    flex: 1;
    padding: 12px; /* Maintain original padding */
    font-size: 14px; /* Maintain original size */
    border-radius: 6px; /* Match base button */
    font-weight: 700;
}

.button.copy-button {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-link-color);
    border: 1px solid var(--tg-theme-link-color);
}
.button.copy-button:hover {
    background-color: rgba(93, 156, 236, 0.15);
    border-color: var(--tg-theme-link-color);
    filter: brightness(1.1);
}

.button.share-button {
    background-color: var(--tg-theme-button-color); /* Use primary button color */
    color: var(--tg-theme-button-text-color);
    border: none;
}
.button.share-button:hover {
    filter: brightness(1.15);
}

/* --- Invites List --- */
.invites-container {
    flex: 1; /* Allow list to take remaining space */
    min-height: 150px; /* Minimum height */
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.referral-list {
    background: rgba(0, 0, 0, 0.25); /* Match user-info bg */
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Match user-info border */
    overflow-y: auto;
    flex: 1;
    padding: 5px 0; /* Add some vertical padding */
}

.referral-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--leaderboard-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.referral-item:last-child {
    border-bottom: none;
}
.referral-item .username { /* Class inside item */
    color: var(--tg-theme-text-color);
    font-weight: 500;
}
/* Reuse status styling from above */
.referral-item .status {
    margin-left: 10px; /* Add space */
}

/* --- Bottom Buttons --- */
/* Apply base .button styling and specific overrides */
.button.leaderboard-button,
.button.back-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    margin-top: 10px;
}

.button.leaderboard-button {
    background-color: var(--spy-gold-accent); /* Gold */
    color: #111;
    border: none;
}
.button.leaderboard-button:hover {
    background-color: #fffacd; /* Lighter gold */
    color: #000;
    filter: brightness(1);
    box-shadow: 0 0 10px var(--spy-gold-glow);
}

.button.back-button {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-link-color);
    border: 1px solid var(--tg-theme-link-color);
}
.button.back-button:hover {
     background-color: rgba(93, 156, 236, 0.15);
     filter: brightness(1.1);
}

/* Loading state - inherits from styles.css if linked */
.loading { 
     padding: 30px 20px;
     text-align: center;
     color: var(--tg-theme-hint-color); 
     font-size: 14px;
     font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .container {
        padding: 10px;
        margin: 10px auto;
    }
    .page-title { font-size: 22px; }
    .explanation { font-size: 13px; margin-bottom: 20px; }
    .section h2 { font-size: 16px; }
    .user-info { padding: 10px 12px; }
    .user-info .username { font-size: 14px; }
    .referral-link { height: 40px; padding: 0 12px; }
    .button-group .button { padding: 10px; font-size: 13px; }
    .referral-item { padding: 8px 12px; font-size: 13px; }
    .button.leaderboard-button, .button.back-button { padding: 12px; font-size: 14px; }
}

.tournament-section {
    background: rgba(var(--tg-theme-button-color-rgb, 38, 120, 182), 0.1);
    border: 1px solid rgba(var(--tg-theme-button-color-rgb, 38, 120, 182), 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.tournament-info {
    margin-bottom: 10px;
}

.tournament-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--tg-theme-link-color, #2678b6);
    margin-bottom: 5px;
}

.tournament-dates {
    color: var(--tg-theme-hint-color, #999);
    font-size: 12px;
    margin-bottom: 10px;
}

.tournament-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--tg-theme-link-color, #2678b6);
}

.view-button {
    display: block;
    text-align: center;
} 