/* Referral System Styles - CS2Red Style */
.beta {
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.main-subtitle {
    font-size: 1.2rem;
    color: #a0a0a0;
    margin-bottom: 40px;
}

/* Referral Blocks */
.referral-block {
    background: linear-gradient(135deg, #2a2d3a 0%, #212529 100%);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #3a3f47;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Выравнивание колонок по высоте */
.col-lg-6 {
    display: flex;
    flex-direction: column;
}

.col-lg-6 .referral-block:last-child {
    flex-grow: 1;
}

.block-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
}

.block-description {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Cards */
.referral-code-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.1) 0%, rgba(72, 187, 120, 0.1) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* Referral Code Block */
.referral-code-block {
    text-align: center;
}

.code-display {
    position: relative;
}

.code-display input {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border: 2px dashed var(--border-color);
    padding: 15px;
    border-radius: 8px;
}

.copy-code-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
}

.copy-code-btn .icon {
    width: 16px;
    height: 16px;
}

/* Create Code Block */
.create-code-block p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Statistics */
.stats-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Referral List */
.referral-list h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.list-group-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: var(--bg-hover);
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

/* How it Works */
.how-it-works {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-text {
    flex: 1;
    padding-top: 8px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Rewards Available */
.rewards-available {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(66, 153, 225, 0.1) 100%);
    border: 2px solid #48bb78;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(72, 187, 120, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
    }
}

.rewards-available .icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Top Referrers Table */
.rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e4a853 100%);
    color: #fff;
}

.rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.player-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.player-link:hover {
    color: var(--primary-color);
}

/* Admin Panel */
.referral-admin {
    padding: 20px 0;
}

.admin-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Table */
.table {
    color: var(--text-primary);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 12px;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background: var(--bg-hover);
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.bg-success {
    background-color: #48bb78 !important;
}

.bg-warning {
    background-color: #ed8936 !important;
}

.bg-secondary {
    background-color: #718096 !important;
}

.bg-danger {
    background-color: #f56565 !important;
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.page-link {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .how-it-works {
        gap: 15px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.9rem;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: #1a202c;
        --bg-secondary: #2d3748;
        --bg-hover: #4a5568;
        --border-color: #4a5568;
        --text-primary: #e2e8f0;
        --text-secondary: #a0aec0;
        --primary-color: #667eea;
    }
}

/* Notifications */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-toast.success {
    border-left: 4px solid #48bb78;
}

.notification-toast.error {
    border-left: 4px solid #f56565;
}

.notification-toast.warning {
    border-left: 4px solid #ed8936;
}

/* Statistics Styles */
.stat-box {
    padding: 15px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color, #4299e1);
    line-height: 1.2;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
    font-weight: 500;
    line-height: 1.3;
}

/* Events List */
.event-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #dee2e6);
}

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

/* Input Groups */
.input-group .form-control {
    background: #1a1d23;
    border: 1px solid #3a3f47;
    color: #ffffff;
    border-radius: 8px 0 0 8px;
    padding: 12px 16px;
}

.input-group .form-control:focus {
    background: #1a1d23;
    border-color: #4a9eff;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25);
}

.input-group .btn {
    border-radius: 0 8px 8px 0;
    padding: 12px 20px;
    font-weight: 500;
}

/* Bonus Grid */
.bonus-grid {
    margin-bottom: 16px;
}

.bonus-item {
    text-align: center;
    padding: 20px;
    background: rgba(74, 158, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(74, 158, 255, 0.3);
}

.bonus-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #4a9eff;
    margin-bottom: 8px;
}

.bonus-label {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.bonus-description {
    color: #a0a0a0;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* Top Referrers */
.top-referrer-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #3a3f47;
}

.top-referrer-item:last-child {
    border-bottom: none;
}

.referrer-rank {
    width: 30px;
    height: 30px;
    background: #4a9eff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
}

.referrer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    transition: transform 0.2s ease;
}

.referrer-avatar:hover {
    transform: scale(1.1);
}

.referrer-info {
    flex-grow: 1;
}

.referrer-name {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
}

.referrer-name:hover {
    color: #4a9eff;
}

.referrer-role {
    color: #a0a0a0;
    font-size: 0.85rem;
}

.referrer-count {
    color: #4a9eff;
    font-weight: 500;
}

/* How It Works Steps */
.how-it-works {
    margin-bottom: 20px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.step-number {
    width: 24px;
    height: 24px;
    background: #4a9eff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-text {
    color: #a0a0a0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Code Display */
.your-code-block {
    margin-top: 20px;
}

.code-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.code-display-group {
    display: flex;
    gap: 12px;
}

.code-input {
    flex-grow: 1;
    background: #1a1d23;
    border: 1px solid #3a3f47;
    color: #4a9eff;
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 8px;
}

.create-code-block .input-group {
    margin-bottom: 8px;
}

.create-code-block .input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.create-code-block .input-group .btn:first-of-type {
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.create-code-block .input-group .btn:last-of-type {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

/* Statistics */
.stats-row {
    display: flex;
    margin-bottom: 16px;
}

.stats-row:last-child {
    margin-bottom: 0;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 0 12px;
}

.stat-item:not(:last-child) {
    border-right: 1px solid #3a3f47;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4a9eff;
    margin-bottom: 4px;
}

.stat-name {
    color: #a0a0a0;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Events Container */
.events-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.events-container::-webkit-scrollbar {
    width: 6px;
}

.events-container::-webkit-scrollbar-track {
    background: #1a1d23;
    border-radius: 3px;
}

.events-container::-webkit-scrollbar-thumb {
    background: #4a9eff;
    border-radius: 3px;
}

.events-container::-webkit-scrollbar-thumb:hover {
    background: #3d8bdb;
}

/* Events */
.event-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #3a3f47;
}

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

.event-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    transition: transform 0.2s ease;
}

.event-avatar:hover {
    transform: scale(1.1);
}

.event-info {
    flex-grow: 1;
}

.event-name {
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.event-name:hover {
    color: #4a9eff;
    text-decoration: none;
}

.event-time {
    color: #a0a0a0;
    font-size: 0.8rem;
}

.event-status {
    background: #3a3f47;
    color: #a0a0a0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.event-status.success {
    background: #28a745;
    color: white;
}

/* Buttons */
.btn-primary {
    background: #4a9eff;
    border-color: #4a9eff;
    color: white;
    font-weight: 500;
}

.btn-primary:hover {
    background: #3d8bdb;
    border-color: #3d8bdb;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
    color: white;
    font-weight: 500;
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
}

.btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

.btn-outline-primary {
    color: #4a9eff;
    border-color: #4a9eff;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #4a9eff;
    border-color: #4a9eff;
    color: white;
}

/* Processing state for buttons */
.btn.processing {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стили для автозаполнения кода */
.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.25);
    border-radius: 8px;
    color: var(--bs-info, #0dcaf0);
}

.alert-info i {
    margin-right: 5px;
}

/* Анимация для кнопки активации с автозаполненным кодом */
#activate-code-btn.btn-success {
    animation: pulse-success 2s infinite;
}

@keyframes pulse-success {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

