/* ===== ПОЛНЫЕ СТИЛИ ДЛЯ STARS СИСТЕМЫ ===== */
/* Все стили для функциональности Stars в одном файле */

/* ===== MODAL OVERLAY ===== */
.stars-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: fadeIn 0.3s ease-out;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
}

/* Специально для Telegram WebApp */
body.telegram-webapp .stars-modal-overlay {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(8px) !important;
}

/* ===== MODAL WINDOW ===== */
.stars-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--modal-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    color: var(--text-primary);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.stars-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: space-between; /* ИЗМЕНЕНО */
    align-items: center; /* ДОБАВЛЕНО */
}

.stars-modal-header h3 {
    margin: 0; /* ДОБАВЛЕНО */
    flex: 1; /* ДОБАВЛЕНО */
    text-align: center; /* ДОБАВЛЕНО */
}

.stars-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.stars-close-btn:hover {
    background: var(--hover-bg, #f3f4f6);
    color: var(--text-primary, #1f2937);
}

.stars-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* ===== PAYMENT TYPE SELECTOR ===== */
.payment-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.payment-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.payment-type-btn.active {
    border-color: #3b82f6;
    background: rgba(59,130,246,0.2);
}

.payment-type-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-type-icon {
    font-size: 20px;
}

.payment-type-info {
    text-align: left;
}

.payment-type-title {
    font-weight: bold;
    font-size: 14px;
}

.payment-type-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.payment-info {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
}

.payment-info > div {
    display: none;
}

.payment-info > div.active {
    display: block;
}

.payment-info i {
    color: #3b82f6;
}

/* ===== LEADERS SECTION ===== */
.stars-leaders-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 160px;
    overflow-y: auto;
}

.leaders-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: center;
}

.leaders-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.leader-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.leader-position {
    font-size: 16px;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.leader-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leader-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.leader-info {
    flex: 1;
    min-width: 0;
}

.leader-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-amount {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.no-leaders,
.leaders-error,
.loading-leaders {
    text-align: center;
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

.leaders-error {
    color: #ef4444;
}

/* ===== SLIDER ===== */
.stars-amount-selector {
    margin-bottom: 20px;
}

.stars-slider-container {
    position: relative;
    padding: 20px 0;
}

.stars-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #374151; /* Серый фон для корректного отображения */
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.stars-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.stars-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.stars-amount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 24px;
    font-weight: bold;
    color: #f59e0b;
}

/* ===== QUICK AMOUNT BUTTONS ===== */
.stars-quick-amounts {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.quick-amount-btn {
    background: var(--button-secondary-bg, #f3f4f6);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary, #1f2937);
    min-width: 48px;
}

.quick-amount-btn:hover {
    background: #fbbf24;
    color: white;
    transform: translateY(-1px);
}

.quick-amount-btn.active {
    background: #f59e0b;
    color: white;
    border-color: #d97706;
}

/* ===== SEND BUTTON ===== */
.stars-send-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stars-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.stars-send-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===== STARS SUMMARY (для отображения под ответами) ===== */
.stars-summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

.stars-icon {
    font-size: 14px;
}

.stars-amount {
    font-weight: bold;
}

.stars-text {
    opacity: 0.8;
    font-size: 10px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* ===== LIGHT THEME OVERRIDES ===== */
.light .stars-leaders-section {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
}

.light .leader-item:hover {
    background: var(--card-hover);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.light .payment-type-btn {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    color: var(--text-primary);
}

.light .payment-type-btn.active {
    border-color: #3b82f6;
    background: rgba(59,130,246,0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.light .payment-info {
    background: var(--bg-surface);
    border: 2px solid var(--card-border);
}

.light .stars-modal {
    background: var(--modal-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .stars-modal {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .stars-modal-content {
        padding: 15px;
        overflow-y: auto;
        max-height: calc(95vh - 60px);
    }
    
    .payment-type-selector {
        flex-direction: column;
    }
    
    .stars-quick-amounts {
        gap: 6px;
    }
    
    .quick-amount-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}