/* Social Image Viewer Styles */

.siv-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.siv-modal.active {
    display: flex;
}

.siv-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.siv-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.siv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
    flex-shrink: 0;
}

.siv-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0 10px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.siv-close:hover {
    opacity: 1;
}

.siv-counter {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.siv-prev,
.siv-next {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.siv-prev:hover,
.siv-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.siv-position {
    font-size: 14px;
    opacity: 0.8;
}

/* Scroll Container */
.siv-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Content */
.siv-content {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.siv-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.siv-image {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 8px;
}

.siv-nav-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25%;
    cursor: pointer;
}

.siv-nav-left {
    left: 0;
    cursor: w-resize;
}

.siv-nav-right {
    right: 0;
    cursor: e-resize;
}

/* Info */
.siv-info {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.siv-caption {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.siv-stats {
    display: flex;
    gap: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Scroll Hint */
.siv-scroll-hint {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    animation: sivBounce 2s infinite;
    transition: opacity 0.3s;
}

.siv-scroll-hint.hidden {
    opacity: 0;
}

@keyframes sivBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Comments Section - Hidden by default */
.siv-comments-section {
    background: white;
    padding: 20px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s, max-height 0.3s, padding 0.3s;
}

.siv-comments-section.visible {
    opacity: 1;
    max-height: 2000px;
    padding: 20px;
}

.siv-comments-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
}

.siv-comments-list {
    margin-bottom: 20px;
}

.siv-comment {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.siv-comment:last-child {
    border-bottom: none;
}

.siv-comment-author {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.siv-comment-text {
    color: #475569;
    line-height: 1.5;
    margin-bottom: 4px;
}

.siv-comment-date {
    font-size: 12px;
    color: #94a3b8;
}

/* Ответ администратора */
.siv-admin-reply {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 3px solid #0284c7;
    border-radius: 0 8px 8px 0;
}

.siv-admin-reply-header {
    font-weight: 600;
    font-size: 12px;
    color: #0369a1;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.siv-admin-reply-text {
    color: #0c4a6e;
    line-height: 1.5;
    margin-bottom: 6px;
}

.siv-admin-reply-date {
    font-size: 11px;
    color: #7dd3fc;
}

/* Вложенные ответы пользователей */
.siv-replies {
    margin-top: 12px;
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid #e2e8f0;
}

.siv-reply {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.siv-reply:last-child {
    border-bottom: none;
}

.siv-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.siv-reply-author {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
}

.siv-reply-date {
    font-size: 11px;
    color: #94a3b8;
}

.siv-reply-text {
    color: #64748b;
    font-size: 14px;
    line-height: 1.4;
}

/* Действия с комментарием */
.siv-comment-actions {
    margin-top: 8px;
}

.siv-reply-btn {
    background: transparent;
    border: 1px solid #B89F51;
    color: #B89F51;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.siv-reply-btn:hover {
    background: #B89F51;
    color: white;
}

/* Форма inline ответа */
.siv-inline-reply-form {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.siv-inline-reply-form input,
.siv-inline-reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.siv-inline-reply-form input:focus,
.siv-inline-reply-form textarea:focus {
    outline: none;
    border-color: #B89F51;
}

.siv-inline-reply-form textarea {
    min-height: 60px;
    resize: vertical;
}

.siv-reply-author,
.siv-reply-email {
    /* стили применяются из общих правил выше */
}

.siv-reply-content {
    /* стили применяются из общих правил выше */
}

.siv-inline-reply-actions {
    display: flex;
    gap: 8px;
}

.siv-reply-submit {
    background: #B89F51;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.siv-reply-submit:hover {
    background: #9b843b;
}

.siv-reply-cancel {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.siv-reply-cancel:hover {
    background: #f1f5f9;
}

/* Улучшенный заголовок комментария */
.siv-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.siv-no-comments,
.siv-loading,
.siv-error {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
}

/* Comment Form */
.siv-comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.siv-comment-form input,
.siv-comment-form textarea {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.siv-comment-form input:focus,
.siv-comment-form textarea:focus {
    outline: none;
    border-color: #B89F51;
}

.siv-comment-form textarea {
    min-height: 80px;
    resize: vertical;
}

.siv-comment-form button {
    background: #B89F51;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-end;
}

.siv-comment-form button:hover {
    background: #9b843b;
}

.siv-comment-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Message */
.siv-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.siv-message-success {
    background: #dcfce7;
    color: #166534;
}

.siv-message-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Mobile */
@media (max-width: 768px) {
    .siv-content {
        min-height: calc(100vh - 200px);
        padding: 10px;
    }
    
    .siv-image {
        max-height: calc(100vh - 250px);
    }
    
    .siv-header {
        padding: 12px 16px;
    }
    
    .siv-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .siv-comment-form button {
        width: 100%;
    }
    
    .siv-scroll-hint {
        padding: 15px;
        font-size: 13px;
    }
}

/* Animation */
.siv-modal .siv-container {
    animation: sivSlideUp 0.3s ease;
}

@keyframes sivSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
