:root {
    --primary-color: #2d2d2d;
    --secondary-color: #666666;
    --accent-color: #1a1a1a;
    --success-color: #666666;
    --danger-color: #999999;
    --bg-light: #1a1a1a;
    --bg-white: #ffffff;
    --bg-dark: #000000;
    --text-dark: #ffffff;
    --text-light: #999999;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    background: #000000;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #2d2d2d;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.trial-badge {
    background: rgba(76, 175, 80, 0.1);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.paid-badge {
    background: rgba(33, 150, 243, 0.1);
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.expired-badge {
    background: rgba(255, 152, 0, 0.1);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.top-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #333333;
    color: white;
    border-color: #666666;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    color: var(--text-dark);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.disclaimer {
    background: #2d2d2d;
    border-left: 4px solid #666666;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.disclaimer h3 {
    color: #999999;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.disclaimer ul {
    margin-left: 20px;
    color: var(--text-light);
}

.disclaimer li {
    margin-bottom: 8px;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.required {
    color: var(--danger-color);
}

.help-text {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: #666666;
    background: #0d0d0d;
}

.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: var(--bg-dark);
    color: var(--text-dark);
}

textarea:focus {
    outline: none;
    border-color: #666666;
}

.char-count {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-dark);
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #666666;
}

.voice-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-dark);
    color: var(--text-dark);
}

.radio-option:hover {
    border-color: #666666;
    background: #0d0d0d;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.radio-option span {
    font-size: 1rem;
    color: var(--text-dark);
}

.voice-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.voice-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    transition: all 0.3s ease;
}

.voice-option:hover {
    border-color: #666666;
    background: #0d0d0d;
}

.voice-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
}

.voice-radio input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.voice-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.voice-info strong {
    font-size: 1rem;
    color: var(--text-dark);
}

.voice-desc {
    font-size: 0.85rem;
    color: #888888;
}

.preview-btn {
    padding: 8px 16px;
    background: var(--bg-white);
    color: var(--bg-dark);
    border: 2px solid var(--bg-white);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.preview-btn:hover {
    background: var(--bg-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
}

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

.preview-btn.playing {
    background: #666666;
    color: var(--bg-white);
    border-color: #666666;
}

.voice-input-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.method-option {
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-light);
}

.method-divider {
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    padding: 10px 0;
}

.method-divider::before,
.method-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.method-divider::before {
    left: 0;
}

.method-divider::after {
    right: 0;
}

.method-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-white);
    color: var(--bg-dark);
    border: 2px solid var(--bg-white);
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.method-btn:hover {
    background: var(--bg-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
}

.file-name {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--success-color);
    font-weight: 500;
}

.recording-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #2d2d2d;
    border: 2px solid #666666;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

#recordingStatus {
    color: var(--danger-color);
    font-weight: 600;
}

#recordingTime {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-dark);
}

.stop-btn {
    width: 100%;
    padding: 12px;
    background: var(--border-color);
    color: var(--bg-white);
    border: 2px solid #666666;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stop-btn:hover {
    background: #666666;
    border-color: #999999;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--bg-white);
    color: var(--bg-dark);
    border: 2px solid var(--bg-white);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.submit-btn:hover {
    background: var(--bg-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loading-content h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.loading-message {
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 500;
}

.progress-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.progress-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 10px;
    color: white;
}

.loading-detail {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    min-height: 20px;
}

.loading-note {
    margin-top: 15px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.result-section {
    margin-top: 30px;
}

.video-container {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-container video {
    width: 100%;
    display: block;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-download {
    background: var(--bg-white);
    color: var(--bg-dark);
    border: 2px solid var(--bg-white);
}

.btn-download:hover {
    background: var(--bg-dark);
    color: var(--bg-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--bg-white);
    border: 2px solid #666666;
}

.btn-secondary:hover {
    background: #666666;
    border-color: #999999;
    transform: translateY(-2px);
}

.message-info {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.message-info h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.message-box {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #666666;
    color: var(--text-light);
    line-height: 1.8;
}

.info-box {
    background: #2d2d2d;
    border-left: 4px solid #666666;
    padding: 15px;
    border-radius: 8px;
}

.info-box p {
    margin: 5px 0;
    color: var(--text-light);
}

/* Sample text section */
.sample-text-section {
    margin-top: 15px;
    padding: 20px;
    background: #2d2d2d;
    border: 2px solid #666666;
    border-radius: 10px;
}

.sample-text-header {
    margin-bottom: 15px;
}

.sample-text-header strong {
    font-size: 1.1rem;
    color: var(--bg-white);
}

.sample-text-header .help-text {
    margin-top: 5px;
    font-size: 0.9rem;
}

.sample-texts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sample-text-item {
    background: var(--bg-dark);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #666666;
}

.sample-text-item strong {
    color: #999999;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 6px;
}

.sample-text-item p {
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
}

footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .result-actions {
        flex-direction: column;
    }
}
