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

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    padding-top: 80px; /* 네비게이션 높이만큼 여백 추가 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: none;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.header-content i {
    margin-right: 10px;
    color: #3498db;
}

/* 단축키 안내 스타일 */
.shortcuts-info {
    margin-top: 15px;
    opacity: 0.7;
}

.shortcuts-info small {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.shortcuts-info kbd {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: monospace;
    margin: 0 2px;
    color: #2c3e50;
}

/* 옵션 패널 */
.options-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.options-group h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-group i {
    color: #3498db;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

/* 체크박스와 라디오 버튼 스타일 */
.option-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.option-item:hover {
    background: rgba(52, 152, 219, 0.1);
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
    display: none;
}

.checkmark,
.radiomark {
    width: 18px;
    height: 18px;
    border: 2px solid #bdc3c7;
    margin-right: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.checkmark {
    border-radius: 4px;
}

.radiomark {
    border-radius: 50%;
}

.option-item input[type="checkbox"]:checked + .checkmark {
    background: #3498db;
    border-color: #3498db;
}

.option-item input[type="radio"]:checked + .radiomark {
    background: #3498db;
    border-color: #3498db;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.radiomark::after {
    content: '';
    position: absolute;
    display: none;
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.option-item input[type="checkbox"]:checked + .checkmark::after,
.option-item input[type="radio"]:checked + .radiomark::after {
    display: block;
}

/* 입력 영역 */
.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.input-group {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.input-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-header i {
    color: #3498db;
}

.input-actions {
    display: flex;
    gap: 8px;
}

.input-actions .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

textarea {
    width: 100%;
    min-height: 300px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: white;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.text-info {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-align: right;
}

/* 버튼 스타일 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* 액션 섹션 */
.action-section {
    text-align: center;
    margin-bottom: 30px;
}

.action-section .btn {
    margin: 0 10px;
}

/* 결과 영역 */
.result-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.result-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-header i {
    color: #27ae60;
}

.result-stats {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.result-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.diff-container {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.diff-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.diff-panel {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.diff-panel:first-child {
    border-right: 2px solid #e9ecef;
}

.diff-panel h4 {
    background: #f8f9fa;
    padding: 10px 15px;
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.diff-line {
    padding: 1px 8px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    border-left: 4px solid transparent;
    position: relative;
    line-height: 0.6;
}

.diff-line.added {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
}

.diff-line.removed {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
}

.diff-line.modified {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.diff-line.unchanged {
    background: rgba(108, 117, 125, 0.1);
    border-left: 3px solid #6c757d;
}

.diff-unified .diff-line {
    padding-left: 40px;
}

.diff-unified .diff-line::before {
    position: absolute;
    left: 15px;
    width: 20px;
    text-align: center;
    font-weight: bold;
}

.diff-unified .diff-line.added::before {
    content: '+';
    color: #28a745;
}

.diff-unified .diff-line.removed::before {
    content: '-';
    color: #dc3545;
}

.diff-unified .diff-line.modified::before {
    content: '~';
    color: #ffc107;
}

.diff-unified .diff-line.unchanged::before {
    content: ' ';
    color: #6c757d;
}

.line-number {
    display: inline-block;
    width: 40px;
    text-align: right;
    color: #6c757d;
    font-size: 0.8rem;
    margin-right: 10px;
    user-select: none;
    border-right: 1px solid #dee2e6;
    padding-right: 8px;
}

/* 범례 */
.legend {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.legend h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend i {
    color: #3498db;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-color.added {
    background: rgba(40, 167, 69, 0.3);
    border-color: #28a745;
}

.legend-color.removed {
    background: rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
}

.legend-color.modified {
    background: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
}

.legend-color.unchanged {
    background: rgba(233, 236, 239, 0.5);
    border-color: #e9ecef;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .options-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .input-section {
        grid-template-columns: 1fr;
    }

    .diff-side-by-side {
        grid-template-columns: 1fr;
    }

    .diff-panel:first-child {
        border-right: none;
        border-bottom: 2px solid #e9ecef;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

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

    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .action-section .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .extract-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .extract-buttons .btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .legend-items {
        grid-template-columns: 1fr 1fr;
    }
    
    /* 모바일에서 단축키 안내 스타일 조정 */
    .shortcuts-info small {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .shortcuts-info kbd {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
}

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

    .options-panel,
    .input-group,
    .result-section,
    .legend {
        padding: 15px;
    }

    textarea {
        min-height: 200px;
    }
}

/* 추출 액션 버튼들 */
.extract-actions {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.extract-actions h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extract-actions h4 i {
    color: #3498db;
}

.extract-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.extract-buttons .btn {
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* 밑줄 표시 스타일 - 노트 형태 */
.diff-line.underlined.added {
    border-top: 1px solid #28a745;
    border-bottom: 1px solid #28a745;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 45%,
        rgba(40, 167, 69, 0.3) 45%,
        rgba(40, 167, 69, 0.3) 55%,
        transparent 55%,
        transparent 100%
    );
}

.diff-line.underlined.removed {
    border-top: 1px solid #dc3545;
    border-bottom: 1px solid #dc3545;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 45%,
        rgba(220, 53, 69, 0.3) 45%,
        rgba(220, 53, 69, 0.3) 55%,
        transparent 55%,
        transparent 100%
    );
}

.diff-line.underlined.modified {
    border-top: 1px solid #ffc107;
    border-bottom: 1px solid #ffc107;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 45%,
        rgba(255, 193, 7, 0.3) 45%,
        rgba(255, 193, 7, 0.3) 55%,
        transparent 55%,
        transparent 100%
    );
}

.word-diff.underlined.added {
    border-top: 1px solid #28a745;
    border-bottom: 1px solid #28a745;
    background: linear-gradient(
        to bottom,
        rgba(40, 167, 69, 0.1) 0%,
        rgba(40, 167, 69, 0.1) 45%,
        rgba(40, 167, 69, 0.4) 45%,
        rgba(40, 167, 69, 0.4) 55%,
        rgba(40, 167, 69, 0.1) 55%,
        rgba(40, 167, 69, 0.1) 100%
    );
}

.word-diff.underlined.removed {
    border-top: 1px solid #dc3545;
    border-bottom: 1px solid #dc3545;
    background: linear-gradient(
        to bottom,
        rgba(220, 53, 69, 0.1) 0%,
        rgba(220, 53, 69, 0.1) 45%,
        rgba(220, 53, 69, 0.4) 45%,
        rgba(220, 53, 69, 0.4) 55%,
        rgba(220, 53, 69, 0.1) 55%,
        rgba(220, 53, 69, 0.1) 100%
    );
}

/* 단어별 차이점 강조 스타일 */
.word-diff {
    padding: 1px 2px;
    border-radius: 3px;
    font-weight: 500;
}

.word-diff.added {
    background: rgba(40, 167, 69, 0.2);
    color: #155724;
}

.word-diff.removed {
    background: rgba(220, 53, 69, 0.2);
    color: #721c24;
}

/* 인코딩 정보 스타일 */
.encoding-warning {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
}

.encoding-info {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 6px;
    font-size: 0.85rem;
}

.encoding-warning i,
.encoding-info i {
    margin-right: 6px;
}

/* 인코딩 차이가 있는 문자 강조 */
.diff-line.encoding-diff {
    position: relative;
}

.diff-line.encoding-diff::after {
    content: '⚠';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #f39c12;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ANSI 문자 강조 */
.diff-line.ansi-char {
    border-left: 4px solid #6f42c1 !important;
    background: rgba(111, 66, 193, 0.05);
}

.diff-line.ansi-char::before {
    content: 'ANSI';
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: #6f42c1;
    color: white;
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* 인코딩 정보 표시 개선 */
.encoding-warning,
.encoding-info {
    margin: 4px 0;
    line-height: 1.4;
}

.encoding-warning + .encoding-info,
.encoding-info + .encoding-info {
    margin-top: 2px;
} 