/**
 * 방송 모달 플레이어 스타일
 * 
 * @package    Joyn_Broadcast
 * @since      1.0.0
 */

/* 모달 오버레이 */
.joyn-modal-overlay {
    position: fixed;
    top: 0; /* JavaScript로 동적 설정 */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    padding-top: 20px;
    opacity: 0;
    transition: opacity 0.3s ease, top 0.1s ease;
    overflow-y: auto;
}

.joyn-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* 모달 컨테이너 */
.joyn-modal-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh; /* JavaScript로 동적 조정 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin-top: 20px; /* 기본 여백 */
}

.joyn-modal-overlay.active .joyn-modal-container {
    transform: scale(1);
}

/* 모달 헤더 */
.joyn-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.joyn-modal-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.joyn-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: color 0.2s;
}

.joyn-modal-close:hover {
    color: #ef4444;
}

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

/* 플레이어 영역 */
.joyn-modal-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 비율 */
    background: #000;
}

.joyn-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.joyn-modal-player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
}

/* 댓글 영역 */
.joyn-modal-comments {
    background: #1a1a1a;
    border-top: 1px solid #333;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.joyn-modal-comments-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    color: #fff;
    font-weight: 600;
}

.joyn-modal-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 300px;
}

.joyn-modal-comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.joyn-modal-comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.joyn-modal-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.joyn-modal-comment-content {
    flex: 1;
}

.joyn-modal-comment-author {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.joyn-modal-comment-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 5px;
}

.joyn-modal-comment-date {
    color: #666;
    font-size: 12px;
}

/* 댓글 입력 폼 */
.joyn-modal-comments-form {
    padding: 20px;
    border-top: 1px solid #333;
    background: #1a1a1a;
}

/* 삭제 버튼 섹션 */
.joyn-modal-delete-section {
    padding: 20px;
    border-top: 1px solid #333;
    background: #1a1a1a;
    text-align: center;
}

.joyn-modal-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.joyn-modal-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.joyn-modal-delete-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.joyn-modal-delete-btn i {
    font-size: 18px;
}

.joyn-modal-comment-form-group {
    margin-bottom: 10px;
}

.joyn-modal-comment-form-group label {
    display: block;
    color: #ccc;
    font-size: 12px;
    margin-bottom: 5px;
}

.joyn-modal-comment-form-group input,
.joyn-modal-comment-form-group textarea {
    width: 100%;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
}

.joyn-modal-comment-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.joyn-modal-comment-form-group input:focus,
.joyn-modal-comment-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.joyn-modal-comment-submit {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.joyn-modal-comment-submit:hover {
    background: #5a67d8;
}

.joyn-modal-comment-submit:disabled {
    background: #444;
    cursor: not-allowed;
}

/* 로그인 사용자 댓글 폼 */
.joyn-modal-comments-form.logged-in .joyn-modal-comment-form-group:not(:last-child) {
    display: none;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .joyn-modal-overlay {
        padding: 10px;
        padding-top: 0; /* JavaScript로 동적 설정 */
    }
    
    .joyn-modal-container {
        max-width: 100%;
        max-height: 90vh; /* JavaScript로 동적 조정 */
        border-radius: 0;
        margin-top: 10px; /* 기본 여백 */
    }
    
    .joyn-modal-header {
        padding: 12px 15px;
    }
    
    .joyn-modal-title {
        font-size: 16px;
    }
    
    .joyn-modal-comments {
        max-height: 300px;
    }
    
    .joyn-modal-comments-list {
        padding: 15px;
        max-height: 200px;
    }
    
    .joyn-modal-comments-form {
        padding: 15px;
    }
}

