/* ==========================================================================
   Gemini TTS Creator - CSS 스타일시트
   ========================================================================== */

/* 1. 변수 선언 (HSL 기반 조화로운 색상 체계) */
:root {
    --bg-dark: hsl(230, 25%, 6%);
    --card-bg: hsla(230, 25%, 10%, 0.55);
    --card-border: hsla(230, 25%, 20%, 0.4);
    
    --primary-grad: linear-gradient(135deg, hsl(243, 75%, 66%), hsl(270, 76%, 63%));
    --hover-grad: linear-gradient(135deg, hsl(243, 75%, 72%), hsl(270, 76%, 70%));
    --text-main: hsl(230, 100%, 97%);
    --text-muted: hsl(230, 15%, 70%);
    
    --neon-blue: hsl(190, 90%, 55%);
    --neon-purple: hsl(270, 90%, 65%);
    --error-red: hsl(350, 80%, 60%);
    --success-green: hsl(145, 80%, 50%);
    
    --font-primary: 'Outfit', 'Noto Sans KR', sans-serif;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 2. 전역 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* 3. 백그라운드 디자인 오브제 (서서히 움직이는 빛무리 효과) */
.background-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    animation: floating 20s infinite alternate ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: var(--neon-blue);
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: var(--neon-purple);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.circle-3 {
    width: 300px;
    height: 300px;
    background: hsl(243, 75%, 66%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 30s;
    opacity: 0.15;
}

/* 4. 레이아웃 컨테이너 */
.app-container {
    width: 100%;
    max-width: 650px;
    padding: 2rem 1.5rem;
    z-index: 10;
    position: relative;
}

/* 5. 헤더 스타일 */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: var(--primary-grad);
    box-shadow: 0 10px 25px hsla(243, 75%, 66%, 0.35);
    margin-bottom: 1.2rem;
}

.logo-wrapper i {
    font-size: 2rem;
    color: white;
}

.app-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* 6. 글래스모피즘 카드 컨테이너 */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
}

/* 7. 폼 구성 요소 */
form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.full-width {
    grid-column: 1 / -1;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

@media (max-width: 500px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
}

label i {
    color: var(--neon-blue);
    font-size: 0.95rem;
}

/* 입력 필드 공통 */
textarea, select, input[type="text"] {
    width: 100%;
    background: hsla(230, 25%, 4%, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-primary);
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

textarea:focus, select:focus, input[type="text"]:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px hsla(190, 90%, 55%, 0.2);
    background: hsla(230, 25%, 4%, 0.6);
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* 글자 수 카운터 */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* 셀렉트 화살표 커스텀 스타일링 추가 */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='hsl(230, 15%, 70%)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* 슬라이더 컨트롤 */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tooltip-icon {
    position: relative;
    cursor: help;
}

.tooltip-icon i {
    color: var(--text-muted);
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: hsl(230, 25%, 15%);
    color: var(--text-main);
    text-align: center;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    right: 0;
    opacity: 0;
    font-size: 0.75rem;
    font-family: var(--font-primary);
    line-height: 1.4;
    transition: opacity 0.3s;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: hsla(230, 25%, 4%, 0.4);
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-grad);
    cursor: pointer;
    box-shadow: 0 0 8px hsla(243, 75%, 66%, 0.5);
    transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 8. 상태창 콘텐트 (로더, 에러메시지) */
.status-container {
    display: none;
    margin-top: 0.5rem;
}

/* 오디오 음파 춤추는 애니메이션 스피너 */
.loading-spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0;
}

.audio-waves {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
}

.audio-waves span {
    display: block;
    width: 4px;
    height: 8px;
    background: var(--primary-grad);
    border-radius: 2px;
    animation: wave-loading 1.2s infinite ease-in-out;
}

.audio-waves span:nth-child(1) { animation-delay: 0.1s; }
.audio-waves span:nth-child(2) { animation-delay: 0.2s; }
.audio-waves span:nth-child(3) { animation-delay: 0.3s; }
.audio-waves span:nth-child(4) { animation-delay: 0.4s; }
.audio-waves span:nth-child(5) { animation-delay: 0.5s; }

.status-msg {
    font-size: 0.85rem;
    color: var(--neon-blue);
    animation: pulse 1.5s infinite alternate ease-in-out;
}

/* 에러 배너 */
.error-banner {
    display: none;
    background: hsla(350, 80%, 60%, 0.1);
    border: 1px solid var(--error-red);
    color: var(--error-red);
    padding: 0.9rem 1.2rem;
    border-radius: 12px;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 9. 기본 및 기본 버튼 스타일 */
.button-wrapper {
    margin-top: 0.5rem;
}

.btn-primary {
    width: 100%;
    background: var(--primary-grad);
    border: none;
    border-radius: 14px;
    color: white;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    padding: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 8px 20px hsla(243, 75%, 66%, 0.3);
    transition: var(--transition-smooth);
}

.btn-primary:hover:not(:disabled) {
    background: var(--hover-grad);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px hsla(243, 75%, 66%, 0.45);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* 10. 디스코드 이용 팁 레이아웃 */
.discord-tips {
    background: hsla(230, 25%, 10%, 0.3);
    border: 1px solid hsla(230, 25%, 15%, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
}

.discord-tips h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: hsl(235, 86%, 65%);
}

.discord-tips ul {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.discord-tips li {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    position: relative;
    padding-left: 1.2rem;
}

.discord-tips li::before {
    content: "•";
    color: var(--neon-blue);
    font-size: 1.2rem;
    position: absolute;
    left: 0.2rem;
    top: -0.1rem;
}

.footer-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: hsla(230, 15%, 40%, 0.8);
    margin-top: 1.5rem;
}

/* ==========================================================================
   11. 애니메이션 정의 (Keyframes)
   ========================================================================== */

@keyframes floating {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(20px) rotate(5deg); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.pulse-animation {
    animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes wave-loading {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(3); }
}


/* ==========================================================================
   12. 인증 관련 추가 스타일 (로그인 & 로그아웃)
   ========================================================================== */

/* 비밀번호 필드 스타일 추가 지정 */
input[type="password"] {
    width: 100%;
    background: hsla(230, 25%, 4%, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-primary);
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="password"]:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px hsla(190, 90%, 55%, 0.2);
    background: hsla(230, 25%, 4%, 0.6);
}

/* 상단 네비게이션 영역 */
.top-nav {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    width: 100%;
}

/* 로그아웃 버튼 */
.btn-logout {
    background: hsla(230, 25%, 15%, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-logout:hover {
    color: var(--text-main);
    border-color: var(--error-red);
    background: hsla(350, 80%, 60%, 0.15);
    box-shadow: 0 4px 12px hsla(350, 80%, 60%, 0.15);
}

.btn-logout i {
    font-size: 0.85rem;
}

/* 필드 힌트 정보 텍스트 */
.field-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
    padding-left: 0.2rem;
}
