/* InLiner Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border-radius: 8px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 700;
}

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

/* Results Header with Export Button */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h2 {
    margin: 0;
}

.export-btn {
    background: #2c5282;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.export-btn:hover {
    background: #1a365d;
}

/* Input Section */
.input-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.input-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.input-section textarea:focus {
    outline: none;
    border-color: #4299e1;
}

.input-section button {
    margin-top: 16px;
    padding: 12px 24px;
    background: #2c5282;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.input-section button:hover {
    background: #1a365d;
}

.input-section button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Input Options */
.input-option {
    margin-bottom: 8px;
}

.input-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.input-divider::before,
.input-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.input-divider span {
    padding: 0 16px;
    color: #718096;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* File Upload */
.file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #edf2f7;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.file-name {
    color: #718096;
    font-size: 14px;
}

.file-name.has-file {
    color: #2d3748;
    font-weight: 500;
}

/* Results Section */
.results-section {
    margin-top: 24px;
}

.results-section h2 {
    margin-bottom: 16px;
    color: #2d3748;
}

.result-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    font-size: 1.1rem;
    color: #2d3748;
}

.path {
    padding: 8px 20px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: #718096;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.result-card > p {
    padding: 12px 20px;
}

.result-card .strike-text {
    color: #c53030;
    background: #fff5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.result-card .insert-text {
    color: #276749;
    background: #f0fff4;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Action Badges */
.action-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.action-modify {
    background: #fef3c7;
    color: #92400e;
}

.action-delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-add {
    background: #d1fae5;
    color: #065f46;
}

.action-unknown {
    background: #e5e7eb;
    color: #4b5563;
}

.action-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Action Summary List */
.action-summary {
    margin: 12px 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #3182ce;
    list-style: none;
}

.action-summary li {
    font-size: 13px;
    color: #4a5568;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
}

.action-summary li:last-child {
    border-bottom: none;
}

/* Diff Display */
.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid #e2e8f0;
}

.diff-container.single {
    grid-template-columns: 1fr;
}

.diff-panel {
    padding: 16px 20px;
}

.diff-panel h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: #718096;
}

.diff-panel.original {
    background: #fff5f5;
    border-right: 1px solid #e2e8f0;
}

.diff-panel.modified {
    background: #f0fff4;
}

.diff-content {
    font-family: 'Georgia', serif;
    font-size: 15px;
    line-height: 1.8;
    color: #2d3748;
    white-space: pre-wrap;
}

mark.removed {
    background: #fed7d7;
    color: #c53030;
    padding: 2px 4px;
    border-radius: 2px;
    text-decoration: line-through;
}

mark.added {
    background: #c6f6d5;
    color: #276749;
    padding: 2px 4px;
    border-radius: 2px;
}

.note {
    padding: 12px 20px;
    color: #718096;
    font-style: italic;
}

.error-inline {
    padding: 12px 20px;
    color: #c53030;
    background: #fff5f5;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

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

/* Error State */
.error-section {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 16px 20px;
    color: #c53030;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #718096;
    font-size: 14px;
}

footer a {
    color: #4299e1;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .diff-container {
        grid-template-columns: 1fr;
    }

    .diff-panel.original {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
