/* -------------------------------------------------------------------------- */
/* 5070 시니어 드라마 제작 시스템 - 핵심 CSS 테마 및 디자인 시스템               */
/* -------------------------------------------------------------------------- */

:root {
    /* Color Palette */
    --bg-base: #0B0B14;
    --bg-surface: rgba(22, 22, 38, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --primary-color: #7C4DFF;
    --primary-glow: rgba(124, 77, 255, 0.4);
    --accent-color: #FFE000; /* 황색 자막 컬러 포인트 */
    --accent-glow: rgba(255, 224, 0, 0.3);
    --success-color: #00E676;
    --danger-color: #FF1744;
    
    --text-main: #F5F5FA;
    --text-muted: #8E8EA0;
    --text-inverse: #0B0B14;

    /* Font Family */
    --font-sans: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Decos (For Premium Vibe) */
.glass-bg-deco-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 77, 255, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
    top: -150px;
    right: -100px;
    z-index: -1;
    pointer-events: none;
}

.glass-bg-deco-2 {
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(255, 224, 0, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -200px;
    left: -150px;
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* App Container */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
}

/* Header Area */
header {
    text-align: center;
    margin-bottom: 40px;
}

header .logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

header .logo .emoji {
    font-size: 2.2rem;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header h1 span {
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--primary-glow);
}

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

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    display: none; /* Default hidden */
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel.active {
    display: block; /* Show active panel */
    animation: fadeIn 0.4s ease-out;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.panel-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.panel-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 224, 0, 0.5);
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 12px;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn:active {
    transform: translateY(0);
}

/* Tags Layout */
.tag-categories {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.category-group h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

/* Tag Chip */
.tag-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px 8px;
    text-align: center;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    font-weight: 400;
}

.tag-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    transform: scale(1.03);
}

/* Selected states for tag chips */
.tag-chip.selected {
    background: rgba(124, 77, 255, 0.15);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
    box-shadow: 0 0 10px rgba(124, 77, 255, 0.25);
}

#tags-reversal .tag-chip.selected {
    background: rgba(255, 224, 0, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 224, 0, 0.2);
}

/* Inputs & Textareas */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

textarea, input[type="text"], input[type="password"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s ease;
}

textarea:focus, input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* API Key Config Row Styling */
.api-key-config-row {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.api-key-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.api-key-input-wrapper input[type="password"],
.api-key-input-wrapper input[type="text"] {
    padding-right: 48px; /* space for toggle button */
}

.btn-toggle-visibility {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    user-select: none;
}

.btn-toggle-visibility:hover {
    color: var(--text-main);
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.helper-text a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: all 0.2s ease;
}

.helper-text a:hover {
    color: var(--text-main);
    border-bottom: 1px solid var(--text-main);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* -------------------------------------------------------------------------- */
/* 2단계: 대본 에디터 UI 디자인                                                */
/* -------------------------------------------------------------------------- */

.script-editor-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.editor-header-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

/* Subtitle Style Configuration Panel */
.subtitle-style-config {
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.subtitle-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.subtitle-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.custom-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.custom-select:focus {
    border-color: var(--primary-color);
}

.custom-select option {
    background-color: var(--bg-base);
    color: var(--text-main);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    height: 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px 8px;
}

.color-picker-wrapper input[type="color"] {
    border: none;
    background: none;
    width: 100%;
    height: 100%;
    cursor: pointer;
    padding: 0;
}

.input-field label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Scene Card */
.scene-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: 3fr 2fr; /* Split layout: Left inputs, Right image preview */
    gap: 24px;
    transition: border-color 0.2s ease;
}

.scene-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.scene-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scene-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.scene-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border-left: 1px solid var(--border-color);
    padding-left: 24px;
}

/* Image Preview Container (16:9 Landscape Layout) */
.image-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16/9; /* 16:9 가로형 규격 시뮬레이션 */
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.image-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 8s ease-in-out; /* Ken Burns Effect Preview */
}

.image-preview-wrapper:hover img {
    transform: scale(1.12); /* 부드러운 줌인 효과 */
}

/* 실시간 자막 프리뷰 오버레이 */
.subtitle-overlay-preview {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 22%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    box-sizing: border-box;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    z-index: 5;
    pointer-events: none;
    word-break: keep-all;
    line-height: 1.3;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.9);
    transition: all 0.25s ease;
}

/* Image overlay loading spinner */
.image-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.image-preview-wrapper.loading .image-spinner {
    opacity: 1;
    pointer-events: all;
}

.image-spinner .small-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-spinner span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* -------------------------------------------------------------------------- */
/* 로딩 오버레이 & 진행상태 모니터                                              */
/* -------------------------------------------------------------------------- */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 6, 10, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-box {
    max-width: 500px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(124, 77, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.loading-box h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.loading-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 25px;
}

/* Progress bar inside loading box */
.progress-wrapper {
    width: 100%;
    display: none; /* Hidden by default during script draft gen */
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.progress-text {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success-color);
}

/* -------------------------------------------------------------------------- */
/* 최종 비디오 재생 화면                                                      */
/* -------------------------------------------------------------------------- */

.video-preview-box {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 16/9; /* 16:9 가로형 규격 플레이어 */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-preview-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-btn {
    text-decoration: none;
}

/* Footer styling */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .scene-card {
        grid-template-columns: 1fr; /* Stack items vertically on small screens */
    }
    
    .scene-right {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 24px;
    }
}

/* 이미지 컨트롤 레이아웃 (업로드 & AI 생성 버튼 동시 지원) */
.scene-image-controls {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-top: 5px;
}

.scene-image-controls .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 10px 8px;
    white-space: nowrap;
}

/* 이미지가 비어있는 경우 플레이스홀더 */
.image-preview-wrapper.empty {
    background: linear-gradient(135deg, #161626 0%, #090911 100%) !important;
    border: 2px dashed rgba(124, 77, 255, 0.25) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    text-align: center;
}

.image-preview-placeholder .placeholder-icon {
    font-size: 2rem;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

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

/* Header Actions & Mobile QR Button */
.header-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.mobile-qr-btn {
    background: rgba(124, 77, 255, 0.15) !important;
    border: 1px solid rgba(124, 77, 255, 0.4) !important;
    color: #F5F5FA !important;
    border-radius: 20px !important;
    padding: 8px 18px !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease;
}

.mobile-qr-btn:hover {
    background: var(--primary-color) !important;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Modal Overlay & Card Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 12, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    max-width: 440px;
    width: 100%;
    background: rgba(22, 22, 38, 0.95);
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 77, 255, 0.2);
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 24px;
}

.modal-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.qr-container {
    background: #FFFFFF;
    padding: 15px;
    border-radius: 16px;
    display: inline-block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

.qr-container img {
    width: 200px;
    height: 200px;
    display: block;
}

.mobile-url-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

#mobile-url-text {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--accent-color);
    word-break: break-all;
}

.pwa-install-tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(124, 77, 255, 0.1);
    border: 1px dashed rgba(124, 77, 255, 0.3);
    border-radius: 14px;
    padding: 14px;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.4;
}

.pwa-install-tip .tip-icon {
    font-size: 1.2rem;
}

/* Enhanced Mobile Responsive Styling */
@media (max-width: 768px) {
    .app-container {
        padding: 20px 12px;
    }

    header {
        margin-bottom: 25px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    header .subtitle {
        font-size: 0.9rem;
    }

    .glass-panel {
        padding: 18px 14px;
        border-radius: 16px;
    }

    .tag-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    .tag-chip {
        padding: 10px 12px;
        font-size: 0.88rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .action-bar {
        flex-direction: column;
        gap: 10px;
    }

    .action-bar .btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .scene-image-controls {
        max-width: 100%;
    }

    .result-media-container {
        flex-direction: column;
    }

    .result-media-box {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .tag-grid {
        grid-template-columns: 1fr 1fr;
    }

    .qr-container img {
        width: 160px;
        height: 160px;
    }
}

/* -------------------------------------------------------------------------- */
/* 모바일 접속 안내 모달 & Helper 스타일                                       */
/* -------------------------------------------------------------------------- */
.hidden {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.modal-card {
    background: #161622;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    max-width: 440px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #ffffff;
}

.btn-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    text-align: center;
}

.modal-desc {
    font-size: 0.95rem;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 20px;
}

.qr-container {
    background: #ffffff;
    padding: 15px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.qr-container img {
    width: 200px;
    height: 200px;
    display: block;
}

.mobile-url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    word-break: break-all;
}

#mobile-url-text {
    flex: 1;
    font-size: 0.9rem;
    color: #4dabf7;
    font-weight: 500;
}

.pwa-install-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #bbb;
    text-align: left;
    line-height: 1.4;
}

.pwa-install-tip .tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}


