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

body {
    font-family: 'Arial', '맑은 고딕', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 20px;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pronunciation-module-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid white;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-block;
}

.pronunciation-module-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.content {
    padding: 30px;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    border-bottom: 3px solid #f0f0f0;
    flex-wrap: wrap;
}

.tab-btn {
    background: white;
    border: none;
    padding: 15px 25px;
    margin: 0 5px 5px 5px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60px;
    justify-content: center;
}

.tab-btn.active {
    background: #4ecdc4;
    color: white;
    border-bottom: 3px solid #4ecdc4;
}

.tab-btn .ko-text,
.tab-btn .vi-text {
    line-height: 1.2;
    text-align: center;
}

.tab-btn:hover:not(.active) {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
    display: block;
}

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

.sound-change-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.change-rule {
    background: white;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 5px solid #ff6b6b;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.change-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 24px;
    font-weight: bold;
    flex-wrap: wrap;
}

.before {
    background: #ff6b6b;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    margin: 5px;
}

.arrow {
    font-size: 30px;
    color: #4ecdc4;
    animation: pulse 2s infinite;
    margin: 5px;
}

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

.after {
    background: #4ecdc4;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    margin: 5px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.example-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-top: 5px solid #4ecdc4;
    transition: transform 0.3s ease;
}

.example-card:hover {
    transform: translateY(-5px);
}

.word-change {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.original {
    background: #ff6b6b;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.small-arrow {
    color: #4ecdc4;
    font-size: 20px;
}

.changed {
    background: #4ecdc4;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.interactive-demo {
    background: linear-gradient(135deg, #84fab0, #8fd3f4);
    padding: 10px;
    border-radius: 15px;
    margin: 10px 0;
    text-align: center;
}

.demo-input {
    background: white;
    border: 3px solid #4ecdc4;
    padding: 15px;
    border-radius: 25px;
    font-size: 18px;
    margin: 10px;
    text-align: center;
    width: 200px;
}

.demo-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
}

.demo-button:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.demo-result {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    font-size: 18px;
    font-weight: bold;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.input-container {
    margin-bottom: 20px;
}

.analysis-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.demo-result {
    flex: 1;
    min-width: 300px;
    order: 1;
}

.analysis-steps-sidebar {
    flex: 1;
    min-width: 300px;
    order: 2;
}

.analysis-process-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.analysis-placeholder {
    text-align: center;
    color: #666;
}

.analysis-content {
    width: 100%;
    text-align: left;
}

.analysis-header h3 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.3em;
}

.result-section {
    background: #f8f9fa;
    padding: 6px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.result-item {
    display: flex;
    align-items: center;
    margin: 4.5px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.word-text, .pronunciation-text, .rule-text {
    font-weight: bold;
    color: #333;
}

.pronunciation-text {
    color: #4ecdc4;
    font-size: 1.1em;
}

.tts-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.tts-btn:hover {
    background: #3bb8b0;
    transform: scale(1.05);
}

.analysis-steps-section {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #2196f3;
    margin-top: 0;
}

.analysis-process-section .analysis-steps-section {
    background: white;
    border-left: none;
    padding: 0;
    margin-top: 0;
}

.analysis-steps-section h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.steps-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.step-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 3px solid #2196f3;
}

.step-number {
    background: #2196f3;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    margin-right: 15px;
}

.step-content {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.4;
}

.result-original {
    color: #ff6b6b;
    font-size: 24px;
    margin: 5px;
}

.result-pronunciation {
    color: #4ecdc4;
    font-size: 28px;
    margin: 10px;
}

.result-explanation {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    color: #666;
    font-size: 16px;
    margin-top: 10px;
    border-left: 4px solid #4ecdc4;
}

.highlight {
    background: #ffeb3b;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
}

.korean-input {
    width: 100%;
    max-width: 400px;
    font-size: 20px;
    padding: 15px;
    border: 3px solid #4ecdc4;
    border-radius: 15px;
    text-align: center;
    margin: 10px;
}

.analysis-steps {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
}

.step {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.step-number {
    background: #4caf50;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.phonetic-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.phoneme-box {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.phoneme-box:hover {
    border-color: #4ecdc4;
    transform: scale(1.05);
}

.phoneme-original {
    font-size: 24px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 10px;
}

.phoneme-changed {
    font-size: 24px;
    color: #4ecdc4;
    font-weight: bold;
}

.examples-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
    clear: both;
}

.quick-example {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-example:hover {
    background: #e8f5e8;
    border-color: #4caf50;
    transform: translateY(-3px);
}

.example-word {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.example-pronunciation {
    font-size: 16px;
    color: #666;
}

.rule-box {
    background: #fff3e0;
    border: 2px solid #ff9800;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.rule-title {
    color: #e65100;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.condition-list {
    list-style: none;
    padding: 0;
}

.condition-list li {
    background: white;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    border-left: 4px solid #ff9800;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ef5350;
    margin: 10px 0;
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #66bb6a;
    margin: 10px 0;
}

.debug-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 14px;
    color: #0d47a1;
    border-left: 4px solid #2196f3;
}

.language-selector {
    margin: 0;
    text-align: right;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: white;
    color: #ff6b6b;
    border-color: white;
}

.vi-text {
    display: none;
}

.ko-text {
    display: block;
}

/* 언어별 텍스트 표시 */
.ko-active .ko-text {
    display: block !important;
}

.ko-active .vi-text {
    display: none !important;
}

.vi-active .vi-text {
    display: block !important;
}

.vi-active .ko-text {
    display: none !important;
}

.rule-explanation-box {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.2);
}

.rule-explanation-box h3 {
    color: #1565c0;
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center;
}

.rule-explanation-box p {
    color: #0d47a1;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.explanation-detail {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #2196f3;
}

.explanation-detail h4 {
    color: #1976d2;
    font-size: 1.2em;
    margin-bottom: 12px;
    font-weight: bold;
}

.explanation-detail ul {
    list-style: none;
    padding: 0;
}

.explanation-detail li {
    background: #f5f5f5;
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 8px;
    border-left: 3px solid #2196f3;
    font-size: 0.95em;
    line-height: 1.5;
}

.explanation-detail strong {
    color: #1565c0;
    font-weight: 600;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .analysis-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .demo-result,
    .analysis-steps-sidebar {
        min-width: auto;
    }
}
