@import url('https://fonts.googleapis.com/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@1,600&display=swap');

:root { 
    --cursor-x: 50%; 
    --cursor-y: 50%; 
    /* TikTok Brand Colors */
    --primary-color: #00f2ea; /* TikTok Cyan */
    --accent-color: #ff0050; /* TikTok Pink */
    --tiktok-black: #000000;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
}

html { scroll-behavior: smooth; }
body { 
    font-family: 'Pretendard', sans-serif; 
    background: #f0fdfa; /* 아주 연한 민트/시안 톤 배경 */
    color: var(--text-main); 
    overflow-x: hidden; 
    letter-spacing: -0.02em; 
}

nav { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%;
    /* 🔴 유튜브와 동일하게 80px 고정 */
    height: 80px !important; 
    padding: 0 4rem !important; /* 상하 패딩 제거, 좌우만 유지 */
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(10px); 
    border-bottom: 1px solid rgba(0,0,0,0.08); 
    z-index: 9999 !important; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; /* 내부 로고와 버튼을 세로 중앙 정렬 */
}

/* 🎵 틱톡 오로라 배경 */
.fluid-bg { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; 
    background: radial-gradient(circle at var(--cursor-x) var(--cursor-y), rgba(0, 242, 234, 0.15) 0%, transparent 40%), 
                radial-gradient(circle at 80% 20%, rgba(255, 0, 80, 0.1) 0%, transparent 50%); 
    transition: background 0.3s ease-out; 
}
.aurora-blur { 
    position: fixed; width: 140vw; height: 140vh; top: -20vh; left: -25vw; z-index: -2; 
    background: linear-gradient(135deg, #ecfeff 0%, #ffffff 40%, #fff1f2 100%); 
    filter: blur(80px); opacity: 0.8; 
}

/* 💎 글래스 카드 */
.mag-card { 
    background: rgba(255, 255, 255, 0.6); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid white; 
    border-radius: 24px; 
    padding: 2rem; 
    box-shadow: 0 10px 30px -5px rgba(0, 242, 234, 0.05); 
    transition: all 0.3s ease; 
    width: 100%; box-sizing: border-box;
}
.mag-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 20px 40px -10px rgba(0, 242, 234, 0.1); 
    border-color: rgba(0, 242, 234, 0.3);
}

/* 🎬 Player Canvas (흰색 테두리 적용) */
#studioContainer { 
    position: relative; width: 100%; max-width: 900px; margin: 0 auto; transition: all 0.5s ease; z-index: 10; 
}
.aspect-shorts { aspect-ratio: 9 / 16; max-width: 400px !important; }
.canvas-wrapper { 
    position: relative; width: 100%; height: 100%; background: #000; 
    border-radius: 40px; /* 폰 프레임처럼 둥글게 */
    overflow: hidden; 
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.25); 
    border: 14px solid #ffffff; /* [핵심] 인스타 스타일 흰색 프레임 */
}
canvas { width: 100%; height: 100%; display: block; object-fit: contain; }

/* 🖼️ 업로드 & 갤러리 */
#dropZone { 
    background: rgba(255, 255, 255, 0.5); 
    border: 2px dashed #99f6f4; 
    border-radius: 20px; padding: 3rem; cursor: pointer; text-align: center; transition: all 0.3s;
}
#dropZone:hover { 
    border-color: var(--primary-color); background: rgba(240, 253, 250, 0.8); transform: scale(1.01);
}
#galleryGrid { 
    display: flex; overflow-x: auto; gap: 10px; padding: 15px 0; width: 100%; box-sizing: border-box;
}
#galleryGrid::-webkit-scrollbar { display: none; }
.gallery-item { 
    flex: 0 0 auto; width: 70px; height: 70px; border-radius: 12px; overflow: hidden; 
    border: 2px solid white; transition: transform 0.2s; position: relative; 
    background: #ecfeff; box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.gallery-item:hover { transform: scale(1.05); border-color: var(--primary-color); z-index: 10; }
.btn-delete-img {
    background: rgba(0, 0, 0, 0.8); color: var(--primary-color); transition: all 0.2s;
    position: absolute; top: 0; right: 0; padding: 2px 5px; cursor: pointer;
}

/* 버튼 그리드 & 옵션 */
.motion-grid, .voice-opt-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(65px, 1fr)); gap: 10px; width: 100%;
}
.motion-opt, .voice-opt { 
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; 
    padding: 12px; border-radius: 18px; border: 2px solid transparent; 
    background: white; box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    cursor: pointer; transition: all 0.2s; height: 100%;
}
.motion-opt:hover, .voice-opt:hover { transform: translateY(-3px); border-color: #ccfbf1; }
.motion-opt.active, .voice-opt.active { 
    border-color: var(--primary-color) !important; background: #f0fdfa !important; 
    transform: scale(1.03); box-shadow: 0 8px 20px rgba(0, 242, 234, 0.25) !important;
}
.icon-box { 
    width: 40px; height: 40px; border-radius: 12px; background: #ccfbf1; 
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #0d9488;
}
.active .icon-box { background: var(--tiktok-black); color: var(--primary-color); }
.motion-opt span, .voice-opt span { font-size: 10px; font-weight: 700; color: #64748b; }
.active span { color: #0f766e; font-weight: 800; }

/* 🚀 AI Start 버튼 */
.btn-fluid { 
    width: 100%; background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%); 
    color: var(--primary-color); font-weight: 900; font-size: 18px; padding: 20px; border-radius: 99px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); border: 1px solid rgba(0, 242, 234, 0.3);
    cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-fluid:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(0, 242, 234, 0.2); }

/* 🎤 렌더링 버튼 */
.btn-render { 
    width: 100%; background: linear-gradient(90deg, #00f2ea, #00c2bb); color: black; 
    font-weight: 800; font-size: 13px; padding: 16px; border-radius: 16px;
    border: none; cursor: pointer; transition: all 0.2s; margin-top: 10px;
}

/* 🤖 AI Assist Button (4버튼) */
.ai-assist-btn {
    width: 100%; padding: 16px; background: white; border-radius: 16px; border: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    font-weight: 800; font-size: 12px; color: #334155; transition: all 0.2s; cursor: pointer;
}
.ai-assist-btn:hover { border-color: var(--primary-color); background: #f0fdfa; transform: translateX(5px); }
.ai-assist-btn i { width: 24px; text-align: center; font-size: 1.2rem; }

/* 📊 AI 결과 카드 */
.ai-result-card { 
    background: #0f172a; border: 1px solid #1e293b; border-radius: 16px; padding: 20px; margin-bottom: 12px; 
}
.ai-result-label { color: var(--primary-color); font-size: 11px; font-weight: 800; display: block; margin-bottom: 8px; }
.ai-result-content { color: #e2e8f0; font-size: 13px; line-height: 1.6; }
.ai-tag-bubble { 
    display: inline-block; background: rgba(0, 242, 234, 0.1); color: var(--primary-color); 
    border: 1px solid rgba(0, 242, 234, 0.3); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; margin: 4px 4px 0 0; 
}

/* 입력창 */
input, textarea, select { 
    width: 100%; background: rgba(255, 255, 255, 0.8); border: 1px solid #e2e8f0; 
    border-radius: 12px; padding: 14px 16px; font-size: 13px; outline: none; transition: all 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary-color); background: white; }

/* ======================================================== */
/* [1. 공통 & PC 스타일] - 화면 너비 769px 이상일 때 적용 */
/* ======================================================== */
@media (min-width: 769px) {
    header h2 {
        font-size: 3.5rem !important; /* PC는 시원하게 대형 폰트 */
        line-height: 1.1 !important;
        font-weight: 900 !important;
        letter-spacing: -0.05em !important;
        margin-bottom: 2rem !important;
        display: block !important;
        text-align: center;
    }
    header p {
        font-size: 1.25rem !important; /* PC 본문 크기 */
        line-height: 1.6 !important;
        padding: 0 2rem !important;
        text-align: center;
        opacity: 0.9;
    }
    /* 안내 박스 PC 크기 유지 */
    header .inline-flex { padding: 0.4rem 1rem !important; margin-bottom: 2rem !important; }
    header .bg-cyan-50, header .bg-white\/60 { padding: 1rem 2.5rem !important; }
}

/* ======================================================== */
/* [2. 모바일 스타일] - 화면 너비 768px 이하일 때만 적용 */
/* ======================================================== */
@media (max-width: 768px) {
    /* 상단 여백 및 내비게이션 최적화 */
    .h-24 { height: 0.5rem !important; } 
    .pt-20 { padding-top: 4.5rem !important; } 
    nav { padding: 0.6rem 1rem !important; }
    

    /* 헤더 50% 축소 */
    header.mb-12, header.mb-10 { margin-bottom: 1.2rem !important; }

    header h2 { 
        font-size: 0.9rem !important; /* 요청하신 대로 아주 작게 고정 */
        line-height: 1.2 !important; 
        margin-bottom: 0.4rem !important;
        letter-spacing: -0.02em !important;
        font-weight: 800 !important;
    }

    header p { 
        font-size: 0.45rem !important; /* 본문 50% 축소 */
        line-height: 1.4 !important;
        padding: 0 1rem !important;
        opacity: 0.8 !important;
    }

    /* 틱톡/유튜브/인스타 공통 요소들 모바일 축소 */
    header .inline-flex { padding: 0.2rem 0.6rem !important; margin-bottom: 0.8rem !important; }
    header .inline-flex span { font-size: 7px !important; }
    header i { font-size: 1rem !important; } /* 아이콘 크기 축소 */
    header .bg-cyan-50, header .bg-white\/60 { padding: 0.5rem 1rem !important; margin-bottom: 1rem !important; }
    header .text-sm { font-size: 8px !important; } /* 9:16 안내 텍스트 축소 */

    /* 4. 버튼 텍스트 중앙 정렬 */
    .format-btn {
        display: flex !important;
        justify-content: center !important; 
        align-items: center !important;     
        width: 100% !important;             
        padding: 14px 0 !important;         
        text-align: center !important;      
        gap: 8px !important;               
    }
    
    .format-toggle-container {
        display: flex !important;
        width: 100% !important;
        gap: 10px !important;
        padding: 0 !important;
    }

    /* 5. 가이드 텍스트 숨김 */
    #nextStepGuide, .next-step-guide, #guideLabel, #guideMainMsg {
        display: none !important;
    }
    body > p.text-slate-400.italic { display: none !important; }

    /* 6. 메인 컨테이너 여백 제거 (좌우 밀림 방지) */
    main.container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    main .px-12 { padding: 0 !important; } 

    /* 7. 카드 및 그리드 최적화 */
    .mag-card { 
        padding: 1.5rem 1.2rem !important; 
        width: 100% !important; 
        box-sizing: border-box !important;
    }
    .motion-grid, .voice-opt-grid { 
        grid-template-columns: repeat(4, 1fr) !important; 
        gap: 6px !important; 
    }
    .motion-opt, .voice-opt {
        padding: 8px 2px !important;
        min-height: 70px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    .icon-box { margin-bottom: 4px !important; }
    .motion-opt span, .voice-opt span {
        font-size: 9px !important;
        transform: scale(0.9);
        display: block !important;
        width: 100% !important;
        text-align: center !important;
    }
}