/* Стили для отображения публикаций в сообщениях */

.message-repost-content {
    margin: 8px 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.repost-news-content,
.repost-photo-content,
.repost-video-content {
    padding: 12px;
}

.repost-media {
    margin-bottom: 8px;
}

.repost-media-item {
    margin-bottom: 8px;
}

.repost-media-item:last-child {
    margin-bottom: 0;
}

.repost-media-item img,
.repost-media-item video {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 6px;
    display: block;
}

.repost-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.repost-text {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.repost-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
    font-size: 12px;
}

.repost-author {
    color: var(--color-text-tertiary);
    font-weight: 500;
}

.repost-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.repost-link:hover {
    text-decoration: underline;
}

.repost-loading {
    padding: 16px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
}

.repost-error {
    padding: 16px;
    text-align: center;
    color: var(--color-error);
    font-size: 13px;
}

/* Стили для модального окна поделиться */
#repostmodalparent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#repostmodal {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    max-width: 440px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

#closerepostmodal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

#closerepostmodal:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

#closerepostmodal:before {
    content: "×";
    font-size: 24px;
    font-weight: 300;
    color: #333;
    line-height: 1;
}

#chooserepostplaceparent {
    padding: 24px;
    padding-top: 20px;
}

.repostitem-icon {
    font-size: 22px;
    margin-right: 16px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#reposttomsg,
#reposttogroups,
#repostcopylink,
#reposttoshare {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

#reposttomsg:before,
#reposttogroups:before,
#repostcopylink:before,
#reposttoshare:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

#reposttomsg:hover:before,
#reposttogroups:hover:before,
#repostcopylink:hover:before,
#reposttoshare:hover:before {
    width: 100%;
}

#reposttomsg:hover,
#reposttogroups:hover,
#repostcopylink:hover,
#reposttoshare:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 126, 234, 0.2);
}

#reposttomsg:hover .repostitem-icon,
#reposttogroups:hover .repostitem-icon,
#repostcopylink:hover .repostitem-icon,
#reposttoshare:hover .repostitem-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#reposttomsg span,
#reposttogroups span,
#repostcopylink span,
#reposttoshare span {
    font-weight: 500;
    font-size: 15px;
    color: #2d3748;
    position: relative;
    z-index: 1;
}

#reposttomsg .repostitem-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

#reposttogroups .repostitem-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

#repostcopylink .repostitem-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 12px rgba(250, 112, 154, 0.3);
}

#reposttoshare .repostitem-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#sendtomessageblock,
#sendtogroupsblock {
    padding: 24px;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.repost-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.15);
    flex-shrink: 0;
}

.repost-section-title i {
    font-size: 20px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
}

#returntochooserepostplaceparent {
    background: rgba(102, 126, 234, 0.08);
    border: none;
    padding: 10px 16px;
    margin-bottom: 20px;
    cursor: pointer;
    color: #667eea;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#returntochooserepostplaceparent:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(-4px);
}

#returntochooserepostplaceparent:before {
    content: "←";
    font-size: 16px;
    font-weight: 600;
}

#returntochooserepostplaceparent:after {
    content: "Назад";
    font-size: 14px;
}

#allrepostingchats,
#allrepostinggroupchats {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 249, 250, 0.8) 100%);
    backdrop-filter: blur(12px);
    box-shadow: 
        inset 0 1px 3px rgba(102, 126, 234, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 4px;
    min-height: 0;
}

#allrepostingchats::-webkit-scrollbar,
#allrepostinggroupchats::-webkit-scrollbar {
    width: 8px;
}

#allrepostingchats::-webkit-scrollbar-track,
#allrepostinggroupchats::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    margin: 4px 0;
}

#allrepostingchats::-webkit-scrollbar-thumb,
#allrepostinggroupchats::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

#allrepostingchats::-webkit-scrollbar-thumb:hover,
#allrepostinggroupchats::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.7) 0%, rgba(118, 75, 162, 0.7) 100%);
    background-clip: padding-box;
}

.userdialog-repost,
.groupdialog-repost {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    margin-bottom: 2px;
}

.userdialog-repost:last-child,
.groupdialog-repost:last-child {
    border-bottom: none;
}

.userdialog-repost:hover,
.groupdialog-repost:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateX(2px);
}

.userdialog-repost.selected,
.groupdialog-repost.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.18) 100%);
    border-left: 4px solid #667eea;
    padding-left: 32px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.userdialog-repost.selected:before,
.groupdialog-repost.selected:before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.userdialog-repost.selected:after,
.groupdialog-repost.selected:after {
    content: '✓';
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.dialoguserheader,
.dialoggroupheader {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    width: 100%;
}

.userdialog-repost .dialoguserheader img, .groupdialog-repost .dialoggroupheader img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid rgba(102, 126, 234, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.userdialog-repost:hover .dialoguserheader img,
.groupdialog-repost:hover .dialoggroupheader img {
    border-color: rgba(102, 126, 234, 0.35);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.userdialog-repost.selected .dialoguserheader img,
.groupdialog-repost.selected .dialoggroupheader img {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.disalogusersn,
.disaloggroupname {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.repostdialogstext,
.repostgrouptext {
    width: 100%;
    min-height: 80px;
    max-height: 120px;
    padding: 14px 16px;
    border: 2px solid rgba(102, 126, 234, 0.12);
    border-radius: 14px;
    resize: none;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    color: #2d3748;
    flex-shrink: 0;
}

.repostdialogstext::placeholder,
.repostgrouptext::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.repostdialogstext:focus,
.repostgrouptext:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.12),
        0 4px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

#toreposttodialogs,
#toreposttogroups {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(102, 126, 234, 0.35),
        0 2px 8px rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

#toreposttodialogs:before,
#toreposttogroups:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#toreposttodialogs:hover:before,
#toreposttogroups:hover:before {
    left: 100%;
}

#toreposttodialogs:hover,
#toreposttogroups:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 28px rgba(102, 126, 234, 0.45),
        0 4px 12px rgba(102, 126, 234, 0.3);
}

#toreposttodialogs:active,
#toreposttogroups:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(102, 126, 234, 0.35),
        0 2px 8px rgba(102, 126, 234, 0.2);
}

#toreposttodialogs i,
#toreposttogroups i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

#toreposttodialogs:hover i,
#toreposttogroups:hover i {
    transform: translateX(4px);
}

.sendrepostparentblock {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

/* Пустое состояние диалогов */
.repost-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 14px;
    border: 2px dashed rgba(102, 126, 234, 0.2);
}

.repost-empty-state i {
    font-size: 48px;
    color: rgba(102, 126, 234, 0.4);
    margin-bottom: 16px;
}

.repost-empty-state p {
    margin: 0;
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

/* Счетчик выбранных диалогов */
.repost-selection-counter {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    animation: slideDown 0.3s ease-out;
    flex-shrink: 0;
}

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

.repost-selection-counter.active {
    display: flex;
}

.repost-selection-counter i {
    font-size: 16px;
    color: #667eea;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.repost-selection-counter strong {
    color: #764ba2;
    font-size: 14px;
}


/* Адаптивные стили */
@media (max-width: 480px) {
    #repostmodal {
        width: 96%;
        max-width: none;
        border-radius: 16px;
        max-height: 92vh;
    }
    
    #chooserepostplaceparent,
    #sendtomessageblock,
    #sendtogroupsblock {
        padding: 20px 16px;
        padding-top: 18px;
    }
    
    .repostitem-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    #reposttomsg,
    #reposttogroups,
    #repostcopylink,
    #reposttoshare {
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    
    #reposttomsg span,
    #reposttogroups span,
    #repostcopylink span,
    #reposttoshare span {
        font-size: 14px;
    }
    
    .repost-media-item img,
    .repost-media-item video {
        max-width: 100%;
    }
    
    .userdialog-repost .dialoguserheader img, .groupdialog-repost .dialoggroupheader img {
        width: 46px;
        height: 46px;
    }
    
    .disalogusersn,
    .disaloggroupname {
        font-size: 14px;
    }
    
    .repost-section-title {
        font-size: 15px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }
    
    .repost-section-title i {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    #toreposttodialogs,
    #toreposttogroups {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .repostdialogstext,
    .repostgrouptext {
        min-height: 70px;
        max-height: 100px;
        padding: 12px 14px;
        font-size: 13px;
    }
    
    #returntochooserepostplaceparent {
        padding: 8px 14px;
        font-size: 13px;
    }
}