/* css/push.css - НЕОФОРМИЗМ СТИЛЬ */

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    color: #e0e0e0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: notificationSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.notification-info {
    border-left: 3px solid #64b5f6;
}

.notification-success {
    border-left: 3px solid #81c784;
}

.notification-error {
    border-left: 3px solid #e57373;
}

.notification-warning {
    border-left: 3px solid #ffb74d;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #b0b0b0;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    font-size: 14px;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

.notification-exiting {
    animation: notificationSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #b0b0b0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

.modal-body {
    padding: 24px;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== ФОРМЫ И КНОПКИ ===== */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section h4 {
    margin: 0 0 16px 0;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #b0b0b0;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(100, 181, 246, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-primary {
    background: rgba(100, 181, 246, 0.2);
    color: #64b5f6;
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.btn-primary:hover {
    background: rgba(100, 181, 246, 0.3);
    border-color: rgba(100, 181, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #b0b0b0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.btn-danger {
    background: rgba(229, 115, 115, 0.2);
    color: #e57373;
    border: 1px solid rgba(229, 115, 115, 0.3);
}

.btn-danger:hover {
    background: rgba(229, 115, 115, 0.3);
    border-color: rgba(229, 115, 115, 0.5);
}

/* ===== СПИСКИ ПРАВ ===== */
.permissions-list {
    margin: 16px 0;
    max-height: 400px;
    overflow-y: auto;
}

.permission-item {
    margin: 8px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.permission-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.permission-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
}

.permission-label input[type="checkbox"] {
    margin-top: 2px;
    transform: scale(1.1);
}

.permission-description {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    margin-left: 28px;
    line-height: 1.4;
}

/* ===== УПРАВЛЕНИЕ ССЫЛКАМИ ===== */
.invite-links-container {
    max-height: 300px;
    overflow-y: auto;
}

.invite-link-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.invite-link-full {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.invite-link-full:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.link-header strong {
    color: #b0b0b0;
    font-size: 13px;
    font-weight: 500;
}

.copy-indicator {
    font-size: 11px;
    color: #888;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.invite-link-full:hover .copy-indicator {
    opacity: 1;
}

.link-content {
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #e0e0e0;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.empty-invites {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.empty-invites p {
    margin: 8px 0;
}

/* ===== КОНТЕКСТНОЕ МЕНЮ ===== */
.context-menu {
    position: fixed;
    background: rgba(25, 25, 25, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: 180px;
    padding: 8px;
    font-size: 14px;
    animation: contextMenuAppear 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.context-menu-item.hidden {
    display: none;
}

.context-menu.hidden {
    display: none;
}

@keyframes contextMenuAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== ОКНО УДАЛЕНИЯ ===== */
.delete-warning {
    text-align: center;
    padding: 24px;
}

.warning-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.delete-warning h4 {
    color: #e57373;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
}

.delete-warning p {
    color: #b0b0b0;
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 14px;
}

.chat-info-preview {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #e57373;
}

.chat-info-preview strong {
    color: #e57373;
    font-weight: 500;
}

.delete-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ===== ССЫЛКИ В СООБЩЕНИЯХ ===== */
.internal-link {
    color: #64b5f6;
    text-decoration: none;
    cursor: pointer;
    word-break: break-all;
    border-bottom: 1px solid rgba(100, 181, 246, 0.3);
    transition: all 0.2s ease;
}

.internal-link:hover {
    color: #90caf9;
    border-bottom-color: rgba(144, 202, 249, 0.6);
}

.external-link {
    color: #888;
    cursor: pointer;
    word-break: break-all;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.external-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #b0b0b0;
}

.link-copied-indicator {
    position: absolute;
    background: rgba(100, 181, 246, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    animation: fadeOut 2s ease-in-out forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== ОКНО ПРИГЛАШЕНИЯ ===== */
.invite-chat-info {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.invite-chat-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.invite-chat-details {
    flex: 1;
}

.invite-chat-details h4 {
    margin: 0 0 6px 0;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
}

.invite-chat-type {
    color: #888;
    font-size: 13px;
    margin: 0 0 8px 0;
}

.invite-chat-description {
    color: #b0b0b0;
    margin: 0 0 8px 0;
    line-height: 1.4;
    font-size: 14px;
}

.invite-chat-members {
    color: #888;
    font-size: 13px;
    margin: 0;
}

/* ===== УПРАВЛЕНИЕ ВИДИМОСТЬЮ ===== */
.info-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-action-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: all 0.2s ease;
}

.info-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.info-action-btn.danger {
    border-color: rgba(229, 115, 115, 0.3);
    color: #e57373;
}

.info-action-btn.danger:hover {
    background: rgba(229, 115, 115, 0.1);
    border-color: rgba(229, 115, 115, 0.5);
}

.ownerControls.hidden {
    display: none;
}

.info-action-btn[style*="display: none"] {
    display: none !important;
}

/* Скрытые элементы */
.hidden {
    display: none !important;
}

/* Адаптивность для контекстного меню на мобильных */
@media (max-width: 768px) {
    .context-menu {
        min-width: 200px;
        transform-origin: top center;
        animation: mobileMenuAppear 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .context-menu-item {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    @keyframes mobileMenuAppear {
        from {
            opacity: 0;
            transform: scale(0.9) translateY(-10px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}

/* Запрещаем выделение текста при долгом тапе на мобильных */
.message {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* На мобильных даем визуальный фидбек при тапе */
@media (max-width: 768px) {
    .message:active {
        background: rgba(255, 255, 255, 0.05);
        transition: background 0.1s ease;
    }
}

/* Стили для PWA уведомлений */
.in-app-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 350px;
    max-width: 90vw;
    transform: translateX(120%);
    animation: slideInRight 0.3s ease forwards;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.in-app-notification.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Индикатор соединения */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.connection-status.online {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.connection-status.offline {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.connection-status.connecting {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #4CAF50;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #F44336;
}

.status-dot.connecting {
    background: #FFC107;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}