/* 랭킹 영상 제작 페이지 스타일 */

/* 메인 컨테이너 */
.ranking-main {
    flex: 1;
    display: block;
    padding: 0;
    background-color: #000;
    min-height: calc(100vh - 200px);
}

.ranking-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
}

.page-title i {
    color: #ff6b00;
    margin-right: 0.5rem;
}

/* 섹션 카드 - 어두운 테마로 변경 */
.section-card {
    background: rgba(20, 20, 20, 0.9);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.section-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #ff6b00;
    border-bottom: 2px solid rgba(255, 107, 0, 0.3);
    padding-bottom: 0.5rem;
    font-weight: 700;
}

/* 타이틀 설정 */
.title-settings {
    display: grid;
    gap: 1.5rem;
}

.title-settings input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    transition: all 0.3s ease;
}

.title-settings input[type="text"]:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.style-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ff6b00;
    font-size: 0.95rem;
}

.form-group input[type="range"] {
    width: 100%;
    background: linear-gradient(to right, #ff6b00 0%, #ff6b00 50%, rgba(255,107,0,0.2) 50%, rgba(255,107,0,0.2) 100%);
    height: 8px;
    border-radius: 4px;
    outline: none;
}

.form-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    transition: all 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.form-group select option {
    background: #1a1a1a;
    color: #fff;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #888;
    font-size: 0.85rem;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    transition: all 0.3s ease;
}

/* 랭킹 아이템 */
.ranking-items {
    display: grid;
    gap: 1.5rem;
}

.ranking-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 107, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    border-color: #ff6b00;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.2);
}

.rank-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ff6b00;
    min-width: 50px;
}

.rank-content {
    flex: 1;
}

.rank-title {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.rank-title:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

/* 재생 순서 선택 */
.playback-order {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 107, 0, 0.05);
    border: 1px solid rgba(255, 107, 0, 0.2);
    border-radius: 8px;
}

.playback-order label {
    color: #ff6b00;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.playback-order-select {
    flex: 1;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playback-order-select:hover {
    border-color: #ff6b00;
    background: rgba(255, 107, 0, 0.1);
}

.playback-order-select:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.2);
}

.playback-order-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 0.5rem;
}

/* 비디오 업로드 박스 */
.video-upload-box {
    position: relative;
    border: 2px dashed rgba(255, 107, 0, 0.3);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.video-upload-box:hover {
    border-color: #ff6b00;
    background: rgba(255, 107, 0, 0.05);
}

.video-input {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
}

.upload-label:hover {
    color: #ff6b00;
}

.upload-label i {
    font-size: 2rem;
}

.video-preview {
    margin-top: 1rem;
}

.video-preview video {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.remove-video {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ff3333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.remove-video:hover {
    background: #ff5555;
}

/* 추가 설정 */
.additional-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* 미리보기 섹션 */
.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.phone-mockup {
    background: #333;
    border-radius: 30px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.phone-screen {
    background: #000;
    border-radius: 20px;
    overflow: hidden;
}

#previewCanvas {
    display: block;
    max-width: 100%;
}

/* 버튼 스타일 */
.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #ff6b00;
    border: 2px solid #ff6b00;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #ff6b00;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 0, 0.4);
}

.btn-generate {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #ff6b00, #ff8500);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 5px 20px rgba(255, 107, 0, 0.4);
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 0, 0.5);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-download {
    padding: 0.75rem 1.5rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* 액션 버튼 */
.action-buttons {
    text-align: center;
    margin: 3rem 0;
}

/* 진행 상태 */
.progress-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b00, #ff8500);
    border-radius: 15px;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
}

.progress-text {
    text-align: center;
    color: #fff;
    font-size: 1.1rem;
}

/* 결과 섹션 */
.result-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.result-container h2 {
    color: #ff6b00;
    margin-bottom: 2rem;
    font-size: 2rem;
}

#resultVideo {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 로딩 스피너 */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 107, 0, 0.3);
    border-top-color: #ff6b00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    margin-top: 1rem;
    color: #fff;
    font-size: 1.1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer 스타일 */
footer {
    background: rgba(255, 107, 0, 0.1);
    border-top: 2px solid rgba(255, 107, 0, 0.3);
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.company-info {
    text-align: center;
    margin-bottom: 20px;
}

.company-info h4 {
    color: #ff6b00;
    font-size: 20px;
    margin-bottom: 15px;
}

.company-info p {
    color: #aaa;
    font-size: 14px;
    margin: 5px 0;
}

.footer-links {
    text-align: center;
    margin-bottom: 20px;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ff6b00;
}

.footer-links .separator {
    color: #666;
    margin: 0 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 107, 0, 0.2);
}

.footer-bottom p {
    color: #888;
    font-size: 12px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .ranking-container {
        padding: 20px;
    }
    
    .style-controls,
    .additional-settings {
        grid-template-columns: 1fr;
    }
    
    .ranking-item {
        flex-direction: column;
    }
    
    .rank-number {
        text-align: center;
    }
    
    .phone-mockup {
        transform: scale(0.8);
    }
    
    .nav-right {
        flex-wrap: wrap;
    }
    
    .nav-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}