/* Стили для функциональности "Поделиться приложением" */

/* CSS переменные для единообразия с главной страницей */
:root {
    --base-bg: #151F28;
    --matrix-color: #00ff00;
    --active-color: #29fd53;
}

/* Кнопка "Поделиться приложением" */
.share-app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: var(--active-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
    margin: 10px 0;
    width: 100%;
    max-width: 300px;
    backdrop-filter: blur(10px);
}

.share-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.share-app-btn:active {
    transform: translateY(0);
}

.share-app-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Модальное окно */
.share-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
    /* Учитываем safe areas Telegram */
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    padding-bottom: max(90px, calc(70px + env(safe-area-inset-bottom, 0px)));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
}

.share-modal-content {
    background: rgba(21, 31, 40, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.4);
    margin: 0;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 88vh;
    box-shadow: 0 20px 60px rgba(0, 255, 0, 0.3);
    animation: slideIn 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 255, 0, 0.1);
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    color: var(--active-color);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.share-modal-close {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: var(--active-color);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.share-modal-close:hover {
    background: rgba(0, 255, 0, 0.2);
    border-color: var(--active-color);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.share-modal-body {
    padding: 20px 25px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Превью приложения */
.app-preview {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.app-preview-image {
    margin-right: 12px;
    flex-shrink: 0;
}

.app-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.3);
}

.app-preview-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--active-color);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.app-description {
    margin: 0 0 8px 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.3;
}

.app-features {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.feature-tag {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.4);
    color: var(--active-color);
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* QR-код секция */
.qr-section {
    flex-shrink: 0;
}

.qr-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--active-color);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

#qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 140px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    backdrop-filter: blur(10px);
}

#qr-code-container img,
#qr-code-container canvas {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.3);
    background: white;
    max-width: 140px;
    max-height: 140px;
}

.share-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.share-btn {
    padding: 8px 16px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.btn-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.copy-link-btn {
    background: rgba(0, 0, 0, 0.3);
    color: var(--active-color);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
}

.copy-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.copy-link-btn:active {
    transform: translateY(0);
}

.share-social-btn {
    background: rgba(0, 0, 0, 0.3);
    color: var(--active-color);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
}

.share-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.share-social-btn:active {
    transform: translateY(0);
}

/* Модальное окно соцсетей */
.social-share-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    /* Учитываем safe areas Telegram */
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    padding-bottom: max(90px, calc(70px + env(safe-area-inset-bottom, 0px)));
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
}

.social-share-content {
    background: rgba(21, 31, 40, 0.95);
    border: 1px solid rgba(0, 255, 0, 0.4);
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    box-shadow: 0 20px 60px rgba(0, 255, 0, 0.3);
    animation: slideIn 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
}

.social-share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 255, 0, 0.1);
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    color: var(--active-color);
}

.social-share-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.social-share-close {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: var(--active-color);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-share-close:hover {
    background: rgba(0, 255, 0, 0.2);
    border-color: var(--active-color);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.social-share-buttons {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    flex: 1;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--active-color);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 255, 0, 0.3);
    cursor: pointer;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.social-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.telegram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.instagram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.twitter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

.facebook-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.1);
    border-color: var(--active-color);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 480px) {
    .share-modal-content {
        width: 95%;
        max-height: 82vh;
    }
    
    .share-modal-header {
        padding: 10px 15px;
    }
    
    .share-modal-header h3 {
        font-size: 16px;
    }
    
    .share-modal-body {
        padding: 15px;
        gap: 12px;
    }
    
    .share-app-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .social-share-content {
        width: 95%;
        max-height: 65vh;
    }
    
    .social-share-header {
        padding: 10px 15px;
    }
    
    .social-share-header h4 {
        font-size: 14px;
    }
    
    .social-share-buttons {
        padding: 12px 15px;
        gap: 6px;
    }
    
    .social-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #qr-code-container {
        min-height: 120px;
    }
    
    #qr-code-container img,
    #qr-code-container canvas {
        max-width: 120px;
        max-height: 120px;
    }
}

/* Состояние загрузки */
.qr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    color: var(--active-color);
}

.qr-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-top: 2px solid var(--active-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 