/* Instagram Style Inline Comments CSS */
/* 게시물 바로 아래에 표시되는 인라인 댓글 시스템 */

/* ========================================
   인라인 댓글 컨테이너
   ======================================== */
.instagram-inline-comments {
    margin-top: 8px;
    padding: 12px 16px;
    background: transparent;
}

/* ========================================
   댓글 목록
   ======================================== */
.instagram-inline-comments-list {
    margin-bottom: 8px;
}

.instagram-inline-comment {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.instagram-inline-comment:last-child {
    margin-bottom: 0;
}

/* 댓글 아바타 - KEYWORK 브랜드 컬러 */
.instagram-inline-comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    overflow: hidden;
}

.instagram-inline-comment-avatar .profile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1428A0, #2B4CB8);
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.instagram-inline-comment-avatar img.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 댓글 내용 */
.instagram-inline-comment-content {
    flex: 1;
    min-width: 0;
}

.instagram-inline-comment-text {
    font-size: 13px;
    line-height: 1.3;
    color: #262626;
    word-wrap: break-word;
    margin-bottom: 2px;
}

.instagram-inline-comment-author {
    font-weight: 600;
    color: #262626;
    margin-right: 4px;
}

/* 댓글 메타 정보 */
.instagram-inline-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.instagram-inline-comment-time {
    font-size: 11px;
    color: #8e8e8e;
    font-weight: 400;
}

.instagram-inline-comment-like,
.instagram-inline-comment-reply,
.instagram-inline-comment-delete {
    background: none;
    border: none;
    font-size: 11px;
    color: #8e8e8e;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    transition: color 0.2s ease;
}

.instagram-inline-comment-like:hover,
.instagram-inline-comment-reply:hover {
    color: #262626;
}

.instagram-inline-comment-delete:hover {
    color: #ed4956;
}

/* ========================================
   댓글 액션 (더보기/접기)
   ======================================== */
.instagram-comments-actions {
    margin-bottom: 8px;
}

.instagram-comments-toggle {
    background: none;
    border: none;
    color: #8e8e8e;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
    transition: color 0.2s ease;
}

.instagram-comments-toggle:hover {
    color: #262626;
}

/* ========================================
   댓글 입력 영역
   ======================================== */
.instagram-comment-input-section {
    border-top: 1px solid #efefef;
    padding-top: 8px;
}

.instagram-comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.instagram-comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
    overflow: hidden;
}

.instagram-comment-avatar .profile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1428A0, #2B4CB8);
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.instagram-comment-avatar img.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.instagram-comment-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    color: #262626;
    background: transparent;
    padding: 6px 0;
    font-family: inherit;
}

.instagram-comment-input::placeholder {
    color: #8e8e8e;
}

.instagram-comment-submit {
    background: none;
    border: none;
    color: #0095f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.instagram-comment-submit:hover {
    color: #00376b;
}

/* ========================================
   빈 상태 및 에러 상태
   ======================================== */
.instagram-comment-empty,
.instagram-comment-error {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: #8e8e8e;
    font-style: italic;
}

.instagram-comment-error {
    color: #ed4956;
}

/* ========================================
   애니메이션
   ======================================== */
@keyframes slideInComment {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.instagram-inline-comment {
    animation: slideInComment 0.2s ease;
}

/* ========================================
   모바일 반응형
   ======================================== */
@media (max-width: 767px) {
    .instagram-inline-comments {
        padding: 8px 12px;
    }
    
    .instagram-inline-comment {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .instagram-inline-comment-avatar,
    .instagram-comment-avatar {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
    
    .instagram-inline-comment-text {
        font-size: 12px;
    }
    
    .instagram-inline-comment-meta {
        gap: 6px;
    }
    
    .instagram-inline-comment-time,
    .instagram-inline-comment-like,
    .instagram-inline-comment-reply,
    .instagram-inline-comment-delete {
        font-size: 10px;
    }
    
    .instagram-comment-input {
        font-size: 14px; /* iOS 줌 방지 */
    }
}

/* ========================================
   다크 모드 지원
   ======================================== */
@media (prefers-color-scheme: dark) {
    .instagram-inline-comment-text,
    .instagram-inline-comment-author {
        color: #ffffff;
    }
    
    .instagram-inline-comment-time {
        color: #a8a8a8;
    }
    
    .instagram-inline-comment-like,
    .instagram-inline-comment-reply,
    .instagram-inline-comment-delete {
        color: #a8a8a8;
    }
    
    .instagram-inline-comment-like:hover,
    .instagram-inline-comment-reply:hover {
        color: #ffffff;
    }
    
    .instagram-comments-toggle {
        color: #a8a8a8;
    }
    
    .instagram-comments-toggle:hover {
        color: #ffffff;
    }
    
    .instagram-comment-input-section {
        border-top-color: #363636;
    }
    
    .instagram-comment-input {
        color: #ffffff;
    }
    
    .instagram-comment-input::placeholder {
        color: #a8a8a8;
    }
    
    .instagram-comment-empty,
    .instagram-comment-error {
        color: #a8a8a8;
    }
}

/* ========================================
   접근성 개선
   ======================================== */
.instagram-comment-submit:focus,
.instagram-inline-comment-like:focus,
.instagram-inline-comment-reply:focus,
.instagram-inline-comment-delete:focus,
.instagram-comments-toggle:focus {
    outline: 2px solid #0095f6;
    outline-offset: 1px;
    border-radius: 2px;
}

.instagram-comment-input:focus {
    outline: none;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .instagram-inline-comment-text,
    .instagram-inline-comment-author {
        color: #000;
    }
    
    .instagram-comment-submit {
        color: #0066cc;
    }
    
    .instagram-comment-input-section {
        border-top: 2px solid #000;
    }
}

/* 애니메이션 감소 모드 */
@media (prefers-reduced-motion: reduce) {
    .instagram-inline-comment,
    .instagram-inline-comment-like,
    .instagram-inline-comment-reply,
    .instagram-inline-comment-delete,
    .instagram-comments-toggle,
    .instagram-comment-submit {
        transition: none;
        animation: none;
    }
}