/* Comment Modal - 독립적인 댓글 모달 스타일 */

/* 기본 변수 */
:root {
    --comment-modal-bg: rgba(0, 0, 0, 0.6);
    --comment-modal-backdrop-blur: blur(4px);
    --comment-modal-border-radius: 16px;
    --comment-modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --comment-modal-primary: #3b82f6;
    --comment-modal-primary-hover: #2563eb;
    --comment-modal-text: #111827;
    --comment-modal-text-secondary: #6b7280;
    --comment-modal-border: #e5e7eb;
    --comment-modal-bg-light: #f9fafb;
    --comment-modal-bg-white: #ffffff;
    --comment-modal-danger: #ef4444;
    --comment-modal-warning: #f59e0b;
}

/* 모달 오버레이 */
.comment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--comment-modal-bg);
    backdrop-filter: var(--comment-modal-backdrop-blur);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-modal-overlay.comment-modal-visible {
    opacity: 1;
    visibility: visible;
}

/* 모달 컨테이너 */
.comment-modal-container {
    background: var(--comment-modal-bg-white);
    border-radius: var(--comment-modal-border-radius);
    box-shadow: var(--comment-modal-shadow);
    width: 90%;
    max-width: 500px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-modal-visible .comment-modal-container {
    transform: scale(1) translateY(0);
}

/* 모달 헤더 */
.comment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--comment-modal-border);
    background: var(--comment-modal-bg-light);
    flex-shrink: 0;
}

.comment-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--comment-modal-text);
}

.comment-modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--comment-modal-text-secondary);
    transition: all 0.2s ease;
}

.comment-modal-close:hover {
    background: var(--comment-modal-border);
    color: var(--comment-modal-text);
    transform: scale(1.1);
}

/* 모달 바디 */
.comment-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 댓글 목록 컨테이너 */
.comment-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 280px;
    max-height: 280px;
}

/* 스크롤바 스타일 */
.comment-list-container::-webkit-scrollbar {
    width: 6px;
}

.comment-list-container::-webkit-scrollbar-track {
    background: var(--comment-modal-bg-light);
    border-radius: 3px;
}

.comment-list-container::-webkit-scrollbar-thumb {
    background: var(--comment-modal-border);
    border-radius: 3px;
}

.comment-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--comment-modal-text-secondary);
}

/* 댓글 아이템 - 인스타그램 스타일 */
.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: none;
    transition: all 0.2s ease;
    min-height: 70px;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item:hover {
    background: rgba(59, 130, 246, 0.03);
    border-radius: 8px;
    margin: 0 -8px;
    padding: 12px 8px;
}

/* 댓글 아바타 */
.comment-avatar-wrapper {
    flex-shrink: 0;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--comment-modal-bg-light);
    border: 2px solid var(--comment-modal-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--comment-modal-text);
    overflow: hidden;
}

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

/* 댓글 내용 - 인스타그램 스타일 */
.comment-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-text {
    color: var(--comment-modal-text);
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    margin: 0;
}

.comment-text .comment-author {
    font-weight: 600;
    color: var(--comment-modal-text);
    margin-right: 8px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}

.comment-time {
    font-size: 12px;
    color: var(--comment-modal-text-secondary);
    font-weight: 500;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-like-btn,
.comment-reply-btn {
    font-size: 12px;
    color: var(--comment-modal-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    color: var(--comment-modal-text);
}

/* 빈 상태 */
.comment-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    height: 100%;
    min-height: 300px;
}

.comment-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.comment-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--comment-modal-text);
    margin-bottom: 8px;
}

.comment-empty-desc {
    font-size: 14px;
    color: var(--comment-modal-text-secondary);
    max-width: 280px;
    line-height: 1.5;
}

/* 모달 푸터 */
.comment-modal-footer {
    border-top: 1px solid var(--comment-modal-border);
    padding: 12px 16px;
    background: var(--comment-modal-bg-white);
    flex-shrink: 0;
}

/* 댓글 입력 섹션 */
.comment-input-section {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
}

.comment-input-field {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    border: 2px solid var(--comment-modal-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    background: var(--comment-modal-bg-light);
    color: var(--comment-modal-text);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.comment-input-field:focus {
    border-color: var(--comment-modal-primary);
    background: var(--comment-modal-bg-white);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-input-field::placeholder {
    color: var(--comment-modal-text-secondary);
}

.comment-char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: var(--comment-modal-text-secondary);
    background: var(--comment-modal-bg-white);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.comment-input-field:focus + .comment-char-counter {
    opacity: 1;
}

/* 전송 버튼 */
.comment-submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--comment-modal-primary);
    color: var(--comment-modal-bg-white);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 80px;
    height: 44px;
}

.comment-submit-button:hover:not(:disabled) {
    background: var(--comment-modal-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.comment-submit-button:disabled {
    background: var(--comment-modal-border);
    color: var(--comment-modal-text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 로딩 스피너 */
.comment-loading-spinner {
    animation: comment-spin 1s linear infinite;
}

@keyframes comment-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .comment-modal-container {
        width: 96%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .comment-modal-header,
    .comment-modal-footer {
        padding: 16px 20px;
    }

    .comment-list-container {
        padding: 16px 20px;
        min-height: 250px;
        max-height: 350px;
    }

    .comment-item {
        padding: 14px 0;
    }

    .comment-item:hover {
        margin: 0 -8px;
        padding: 14px 8px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .comment-author-name {
        font-size: 14px;
    }

    .comment-text {
        font-size: 13px;
        padding: 10px 14px;
    }

    .comment-input-field {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .comment-submit-button {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 70px;
        height: 40px;
    }

    .comment-empty-state {
        padding: 40px 20px;
        min-height: 250px;
    }

    .comment-empty-icon {
        font-size: 40px;
    }

    .comment-empty-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .comment-modal-container {
        width: 98%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .comment-modal-title {
        font-size: 16px;
    }

    .comment-input-section {
        gap: 8px;
    }

    .comment-submit-button {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 60px;
        height: 36px;
    }

    .comment-input-field {
        min-height: 36px;
        padding: 8px 12px;
    }
}