/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.header h1 i {
    margin-right: 15px;
}

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

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto 20px;
}

.info-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.input-section h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.input-section h2 i {
    margin-right: 10px;
    color: var(--primary-color);
}

#inputText {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    transition: border-color 0.3s;
    line-height: 1.8;
}

#inputText:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.convert-btn {
    width: 100%;
    padding: 18px;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: var(--shadow);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results Container */
.results-container {
    display: none;
}

/* Result Sections */
.result-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 600;
}

.section-header h2 i {
    margin-right: 10px;
}

.phonetic-section h2 {
    color: #3b82f6;
}

.slot-section h2 {
    color: #8b5cf6;
}

.reflex-section h2 {
    color: #f59e0b;
}

.copy-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #2563eb;
}

.explanation {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.explanation strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.explanation ul {
    margin-top: 15px;
    margin-left: 20px;
}

.explanation li {
    margin: 8px 0;
    color: var(--text-secondary);
}

/* Phonetic Result */
.result-content {
    line-height: 2;
}

.original-line {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 5px;
}

.phonetic-line {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-left: 20px;
}

/* SLOT Result */
.slot-card {
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
}

.slot-title {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.slot-original {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-style: italic;
    color: var(--text-secondary);
    border-left: 3px solid var(--secondary-color);
}

.slot-item {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.slot-label {
    min-width: 150px;
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
}

.slot-label.s {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.slot-label.l {
    background: linear-gradient(135deg, #10b981, #059669);
}

.slot-label.o {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.slot-label.t {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.slot-content {
    flex: 1;
}

.slot-content .english {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 1rem;
}

.slot-content .phonetic {
    color: var(--secondary-color);
    font-size: 1.05rem;
    font-weight: 600;
}

/* Reflex Result */
.reflex-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 40px;
    border-radius: 15px;
    border: 3px solid var(--warning-color);
}

.reflex-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.reflex-icon {
    width: 80px;
    height: 80px;
    background: var(--warning-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.reflex-text {
    flex: 1;
}

.english-reflex {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.phonetic-reflex {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--warning-color);
    line-height: 1.8;
}

.reflex-timer {
    text-align: center;
    margin-top: 25px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.reflex-timer i {
    margin-right: 8px;
    color: var(--warning-color);
}

/* Concept Section */
.concept-section {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.concept-section h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.concept-section h2 i {
    margin-right: 10px;
    color: var(--warning-color);
}

.concept-card {
    background: #f8fafc;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary-color);
}

.concept-card h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.concept-card h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.concept-card p {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 15px;
}

.concept-card ul {
    margin-left: 25px;
}

.concept-card li {
    margin: 10px 0;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Concept Flow */
.concept-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.flow-step {
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.flow-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0 auto 15px;
}

.flow-step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.flow-step strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.flow-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: white;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .input-section,
    .result-section,
    .concept-section {
        padding: 25px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
    }
    
    .slot-item {
        flex-direction: column;
    }
    
    .slot-label {
        width: 100%;
    }
    
    .reflex-content {
        flex-direction: column;
    }
    
    .reflex-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .english-reflex {
        font-size: 1.2rem;
    }
    
    .phonetic-reflex {
        font-size: 1.1rem;
    }
    
    .concept-flow {
        flex-direction: column;
    }
    
    .flow-arrow {
        transform: rotate(90deg);
    }
}

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

.result-section {
    animation: fadeIn 0.5s ease-out;
}

/* 에러 메시지 */
.error-message {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: var(--danger-color);
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.error-message p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 데이터 없음 */
.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
    font-style: italic;
}
