/* ========================================
   기본 설정
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Noto Sans KR', sans-serif;
}

/* ========================================
   그라데이션 배경
   ======================================== */
.gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    }
    50% {
        background: linear-gradient(135deg, #2a5298 0%, #7e22ce 50%, #1e3c72 100%);
    }
}

.gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* ========================================
   메인 컨테이너
   ======================================== */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ========================================
   타이틀 & 서브타이틀
   ======================================== */
.title-font {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    letter-spacing: 0.2em;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: white;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.75rem;
}

.subtitle {
    color: white;
    text-align: center;
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* ========================================
   애니메이션
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 1s ease-out;
}

.fade-in-up-delay-1 {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.fade-in-up-delay-2 {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.fade-in-up-delay-3 {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.fade-in-up-delay-4 {
    animation: fadeInUp 1s ease-out 0.8s both;
}

/* ========================================
   편집 섹션
   ======================================== */
.edit-section {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   유리 모피즘 카드
   ======================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ========================================
   텍스트 입력
   ======================================== */
.text-input {
    width: 100%;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-family: 'Noto Sans KR', sans-serif;
    color: white;
    line-height: 1.8;
    resize: vertical;
    transition: all 0.3s;
}

.text-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* ========================================
   컨트롤 섹션
   ======================================== */
.control-section {
    margin-bottom: 1.5rem;
}

.control-label {
    display: block;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.control-label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* ========================================
   슬라이더
   ======================================== */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    white-space: nowrap;
}

.custom-slider {
    flex: 1;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.custom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider-value {
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    min-width: 40px;
    text-align: center;
}

/* ========================================
   프라이머리 버튼
   ======================================== */
.primary-button {
    position: relative;
    width: 100%;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 1rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.primary-button:hover::before {
    width: 400px;
    height: 400px;
}

.primary-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.primary-button span {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

/* ========================================
   프롬프터 섹션
   ======================================== */
.prompter-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000;
    z-index: 1000;
}

.prompter-display {
    flex: 1;
    overflow-y: hidden;
    overflow-x: hidden;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    scroll-behavior: smooth;
}

.prompter-display.scroll-enabled {
    overflow-y: auto;
}

/* 스크롤바 스타일링 */
.prompter-display::-webkit-scrollbar {
    width: 12px;
}

.prompter-display::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.prompter-display::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
}

.prompter-display::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.prompter-content {
    padding: 3rem;
    padding-bottom: 100vh; /* 마지막 텍스트가 화면 상단까지 올라올 수 있도록 */
    font-size: 2.5rem;
    line-height: 1.8;
    color: white;
    white-space: pre-wrap;
    word-wrap: break-word;
    transform: scaleX(-1);
    text-align: left;
    width: 100%;
    max-width: 1200px;
}

/* ========================================
   프롬프터 컨트롤 패널
   ======================================== */
.prompter-controls-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
}

/* 재생 제어 버튼 */
.control-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pause-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.pause-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.resume-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

.resume-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.stop-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stop-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.scroll-lock-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.scroll-lock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.scroll-lock-btn.unlocked {
    background: linear-gradient(135deg, #64748b, #475569);
}

.scroll-lock-btn.unlocked:hover {
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.5);
}

/* 아이콘 버튼 */
.icon-button {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.icon-button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 인라인 컨트롤 */
.control-label-inline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.inline-slider {
    width: 120px;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.inline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.inline-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
}

.inline-value {
    color: white;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* ========================================
   푸터
   ======================================== */
.footer {
    text-align: center;
    color: white;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 2rem;
}

.footer kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    margin: 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ========================================
   반응형 디자인
   ======================================== */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .text-input {
        min-height: 200px;
        font-size: 1rem;
    }

    .prompter-content {
        font-size: 1.8rem;
        padding: 1.5rem;
    }

    .prompter-controls-panel {
        gap: 1rem;
    }

    .control-button {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .icon-button {
        width: 35px;
        height: 35px;
    }

    .control-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .prompter-content {
        font-size: 1.5rem;
        padding: 1rem;
    }
}
