/* =============================================
   Модальное окно входа в коллект
   Стили в едином дизайн-коде с основным сайтом
   ============================================= */

/* Overlay для модального окна */
.collect-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
}

.collect-modal-overlay .collect-modal-card {
    position: relative;
    max-width: 850px;
    width: 100%;
    margin: auto;
}

/* Кнопка закрытия */
.collect-modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.collect-modal-close-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.collect-modal-close-btn i {
    color: #333;
    font-size: 1.25rem;
}

.collect-modal-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    position: relative;
    align-items: stretch;
}

/* Секция с аватаркой (слева) */
.collect-modal-avatar-section {
    flex: 0 0 auto;
    width: auto;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    align-self: stretch;
    aspect-ratio: 1 / 1;
}

/* Секция с информацией (справа) */
.collect-modal-info-section {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.collect-modal-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Аватарка коллекта */
.collect-avatar-container {
    flex: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 0;
    aspect-ratio: 1 / 1;
}

.collect-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Тело модального окна */
.collect-modal-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    justify-content: flex-start;
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
}

/* Заголовок */
.collect-modal-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

/* Элементы информации */
.collect-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.collect-info-item:last-of-type {
    border-bottom: none;
}

.collect-info-icon {
    font-size: 1.25rem;
    color: #7231FF;
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.collect-info-icon-danger {
    color: #dc3545;
}

.collect-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.collect-info-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.collect-info-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

/* Дедлайн с обратным отсчетом */
.collect-deadline-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.collect-countdown {
    font-size: 0.875rem;
    font-weight: 700;
    color: #dc3545;
    padding: 0.5rem;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
}

/* Ассортимент */
#collect-categories {
    max-height: 120px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Ссылки на диск и чат */
.collect-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.collect-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(114, 49, 255, 0.1);
    color: #7231FF;
    border: 2px solid #7231FF;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.collect-link-btn:hover {
    background: #7231FF;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 49, 255, 0.3);
}

/* Кнопка вступления */
.collect-modal-actions {
    margin-top: 0.5rem;
    padding-top: 1rem;
    flex-shrink: 0;
    width: 100%;
}

.collect-modal-actions button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 18px 36px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Unbounded', sans-serif;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.collect-modal-actions button i {
    font-size: 1rem;
    display: inline-block;
}

.collect-modal-actions .btn-success {
    background: white;
    color: #7231FF;
    border: 2px solid #7231FF;
    box-shadow: 0 4px 16px rgba(114, 49, 255, 0.2);
}

.collect-modal-actions .btn-success:hover {
    background: #7231FF;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(114, 49, 255, 0.3);
}

.collect-modal-actions .btn-success i {
    color: inherit;
}

.btn-join-collect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 18px 36px;
    background: white;
    color: #7231FF;
    border: 2px solid #7231FF;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Unbounded', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(114, 49, 255, 0.2);
}

.btn-join-collect:hover:not(:disabled) {
    background: #7231FF;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(114, 49, 255, 0.3);
}

.btn-join-collect:active:not(:disabled) {
    transform: translateY(-1px);
}

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

/* Сообщение об ошибке */
.collect-error-message {
    padding: 1rem;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-top: 1rem;
    position: relative;
    z-index: 10001;
}

/* Адаптивность */
@media (max-width: 768px) {
    .collect-modal-overlay {
        padding: 1rem;
    }
    
    .collect-modal-overlay .collect-modal-card {
        max-width: 100%;
    }
    
    .collect-modal-card {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .collect-modal-avatar-section {
        flex: 0 0 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .collect-modal-info-section {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .collect-modal-body {
        padding: 1.25rem;
        min-height: auto;
    }
    
    .collect-modal-title {
        font-size: 1.25rem;
    }
    
    .collect-info-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .collect-info-icon {
        margin-top: 0;
    }
    
    .btn-join-collect {
        padding: 14px 28px;
        font-size: 16px;
    }
}

/* Поле ввода пароля */
.collect-password-container {
    margin-bottom: 0;
    margin-top: 0.5rem;
    padding: 1rem;
    background: rgba(114, 49, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(114, 49, 255, 0.2);
    flex-shrink: 0;
}

.collect-password-label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.collect-password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.collect-password-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.collect-password-input:focus {
    outline: none;
    border-color: #7231FF;
    box-shadow: 0 0 0 3px rgba(114, 49, 255, 0.15);
}

.collect-password-input::placeholder {
    color: #999;
    font-size: 0.95rem;
}

.collect-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
}

.collect-password-toggle:hover {
    color: #7231FF;
    background: rgba(114, 49, 255, 0.1);
}

.collect-password-toggle:focus {
    outline: none;
    color: #7231FF;
    background: rgba(114, 49, 255, 0.1);
}

.collect-password-toggle i {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .collect-modal-body {
        padding: 1.25rem;
    }
    
    .collect-modal-title {
        font-size: 1.25rem;
    }
    
    .collect-links {
        flex-direction: column;
    }
    
    .collect-link-btn {
        width: 100%;
        justify-content: center;
    }
}
