/* bot_app/web_app/css/pages/friends.css */

/* Стили для страницы "Друзья" */
.friends-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.invite-friend-section {
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.invite-friend-section p {
    margin: 0 0 15px 0;
    font-size: 18px;
    line-height: 1.4;
}

.invite-friend-section p svg {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
}

.invite-link-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 5px;
    border: 1px solid var(--secondary-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#invite-link-text {
    padding: 0 10px;
    font-size: 14px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

#copy-invite-link-btn {
    background-color: var(--success-color);
    border: none;
    border-radius: 12px; /* Changed to 12px */
    width: 45px; /* Fixed width */
    height: 45px; /* Fixed height */
    padding: 0; /* Removed padding */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#copy-invite-link-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.promo-code-section {
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
}

#promo-creation-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#create-promo-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background-image: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.promo-code-display {
    width: 100%;
    text-align: center;
}

.promo-code-display p {
    margin: 0 0 10px 0;
    color: #aaa;
}

.promo-code-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 5px;
    border: 1px solid var(--secondary-color);
}

#promo-code-text {
    padding: 0 10px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 1px;
}

#edit-promo-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

#edit-promo-btn svg {
    width: 20px;
    height: 20px;
    color: #aaa;
}

.friends-list-section {
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
}

.friends-list-section h2 {
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 20px;
}

#friends-list-display .empty-message {
    text-align: center;
    color: #aaa;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--secondary-color);
}

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

.friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.friend-name {
    font-size: 16px;
}

.friend-reward {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: bold;
    color: var(--success-color);
}

.friend-reward svg {
    width: 16px;
    height: 16px;
}

/* Новый дизайн страницы "Друзья" */
.friends-container-redesigned {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    text-align: center;
    width: 100%; /* Убедимся, что занимает всю доступную ширину */
    box-sizing: border-box; /* Учитываем padding */
    padding: 0 15px; /* Добавляем горизонтальный отступ */
}

.friends-header-redesigned h2 {
    font-size: 22px;
    font-weight: 500;
    margin: 20px 0 8px 0; /* Added margin-top */
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.friends-header-redesigned p {
    font-size: 18px;
    color: #aaa;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.friends-header-redesigned p svg {
    width: 18px;
    height: 18px;
}

.promo-code-section-redesigned,
.friends-list-section-redesigned {
    width: 100%;
    padding: 0 15px; /* Добавляем горизонтальный отступ */
    box-sizing: border-box; /* Учитываем padding в ширине */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box; /* Учитываем padding в ширине */
}

.promo-code-section-redesigned h3 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 20px 0; /* Added margin-bottom for spacing */
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

#promo-code-display-redesigned {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-color);
    min-height: 25px; /* Reserve space */
}

#create-promo-btn-redesigned {
    width: 100%; /* Адаптивная ширина */
    max-width: 300px; /* Максимальная ширина */
    height: 55px; /* Fixed height */
    margin: 0 auto; /* Center the button */
    box-sizing: border-box; /* Учитываем padding в ширине */
}

#friends-list-display-redesigned .empty-message {
    color: #aaa;
}

.invite-actions-redesigned {
    display: flex;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.invite-button-group {
    display: flex;
    width: 320px; /* Соответствует ширине кнопки промокода */
    height: 60px;  /* Соответствует высоте кнопки промокода */
    border-radius: 12px;
    /* Тень убрана с контейнера */
}

#invite-friend-btn-redesigned {
    flex-grow: 1; /* Растет, чтобы занять место */
    width: 0;      /* Ключевое исправление: заставляет flex-grow работать корректно */
    height: 100%;
    border-radius: 12px 0 0 12px;
    border: none;
    background-image: linear-gradient(to right, #28a745, #218838);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    transition: filter 0.2s ease;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5); /* Тень перенесена на кнопку */
}
#invite-friend-btn-redesigned:hover {
    filter: brightness(1.15);
}


#copy-link-btn-redesigned {
    flex-shrink: 0;
    width: 65px;
    height: 100%;
    border-radius: 0 12px 12px 0;
    border: none;
    background-image: linear-gradient(to right, #28a745, #218838);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: filter 0.2s ease;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5); /* Тень перенесена на кнопку */
}

#copy-link-btn-redesigned:hover {
    filter: brightness(1.15);
}

#copy-link-btn-redesigned svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* New styles for redesigned friend list items */
.friends-list-section-redesigned {
    background-color: transparent;
    border: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Spacing between friend items */
}

.friends-list-section-redesigned h3 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 10px 0;
    color: var(--text-color);
    text-align: center;
}

.friend-item-redesigned {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--secondary-color);
}

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

.friend-counter-redesigned {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-color); /* Changed to white */
    width: 25px; /* Fixed width for alignment */
    text-align: center;
    flex-shrink: 0;
}

/* Removed .friend-avatar-redesigned styles */

.friend-details-redesigned {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allow details to take available space */
    text-align: left;
}

.friend-id-redesigned {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
}

.invitation-method-redesigned {
    font-size: 14px;
    color: #aaa;
    margin-top: 2px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
    .friends-container-redesigned {
        padding: 0 10px;
    }
    
    .promo-code-section-redesigned,
    .friends-list-section-redesigned {
        padding: 0 10px;
    }
    
    .invite-actions-redesigned {
        gap: 8px;
    }
    
    #invite-friend-btn-redesigned {
        min-width: 180px;
        max-width: 250px;
    }
    
    #copy-link-btn-redesigned {
     
    }
    
    #copy-link-btn-redesigned svg {
        width: 18px;
        height: 18px;
    }
}
