/* YouTube 영상 분석 팝업 레이어 스타일 */

.video-analyzer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.video-analyzer-popup {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 1200px;
    overflow: hidden;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid #e0e0e0;
}

.popup-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-content {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    padding: 0;
}

/* 로딩 섹션 */
.loading-section {
    padding: 60px 30px;
    text-align: center;
    color: #212529;
    font-weight: 500;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 분석 섹션 */
.analysis-section {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.analysis-section:last-child {
    border-bottom: none;
}

.analysis-section h3 {
    margin: 0 0 20px 0;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-card h4 {
    margin: 0 0 15px 0;
    color: #212529;
    font-size: 1.1rem;
    font-weight: 600;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.metric-label {
    color: #343a40;
    font-weight: 500;
}

.metric-value {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 1.05rem;
}

/* 키워드 관련 스타일 */
.keyword-list {
    margin-top: 15px;
}

.keyword-list h5 {
    margin: 0 0 10px 0;
    color: #212529;
    font-size: 0.95rem;
    font-weight: 600;
}

.keyword-tag {
    display: inline-block;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    margin: 2px 4px 2px 0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.keyword-tag:hover {
    transform: scale(1.05);
}

/* 썸네일 관련 스타일 */
.thumbnail-preview {
    text-align: center;
    margin-bottom: 15px;
}

.thumbnail-image {
    max-width: 200px;
    max-height: 112px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.analysis-details {
    margin-top: 15px;
}

.color-palette {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 액션 버튼 */
.analysis-actions {
    padding: 30px;
    background: #f8f9fa;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-outline {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #343a40;
    border: 2px solid #343a40;
    font-weight: 600;
}

.btn-outline:hover {
    background: #343a40;
    color: white;
    transform: translateY(-2px);
}

/* 에러 섹션 */
.error-section {
    text-align: center;
    padding: 60px 30px;
}

.error-section h3 {
    color: #dc3545;
    margin-bottom: 20px;
}

.error-section p {
    color: #343a40;
    margin-bottom: 30px;
    font-weight: 500;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .video-analyzer-popup {
        width: 95vw;
        max-height: 95vh;
    }
    
    .popup-header {
        padding: 15px 20px;
    }
    
    .popup-header h2 {
        font-size: 1.2rem;
    }
    
    .analysis-section {
        padding: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .analysis-actions {
        padding: 20px;
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary, .btn-outline {
        width: 100%;
    }
}

/* 스크롤바 스타일링 */
.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .video-analyzer-popup {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .info-card {
        background: #4a5568;
        border-color: #718096;
    }
    
    .analysis-section {
        border-bottom-color: #4a5568;
    }
    
    .metric-label {
        color: #cbd5e0;
    }
    
    .metric-value {
        color: #f7fafc;
    }
    
    .info-card h4 {
        color: #f7fafc;
    }
    
    .keyword-list h5 {
        color: #f7fafc;
    }
    
    .loading-section {
        color: #f7fafc;
    }
    
    .error-section p {
        color: #cbd5e0;
    }
    
    .analysis-actions {
        background: #4a5568;
    }
}
