
/* Diff Viewer Tool Styles (ported from original HTML) */
#diff-viewer-container {
    max-width: 1400px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.dv-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.dv-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.dv-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 16px;
}

.dv-content {
    padding: 30px;
    background: #fafbfc;
}

.dv-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.dv-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dv-control-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.dv-select, .dv-input {
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

.dv-select:focus, .dv-input:focus {
    outline: none;
    border-color: #667eea;
}

.dv-input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dv-input-panel {
    background: white;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

.dv-panel-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e1e5e9;
    font-weight: 600;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dv-panel-info {
    font-size: 12px;
    color: #6c757d;
}

.dv-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: none;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    background: white;
    box-sizing: border-box;
    outline: none;
}

.dv-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 25px;
}

.dv-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    position: relative;
    overflow: hidden;
}

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

.dv-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dv-btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dv-btn-tertiary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.dv-btn-quaternary {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.dv-btn-nav {
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    padding: 8px 16px;
    font-size: 14px;
}

.dv-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

.dv-navigation {
    display: none;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.dv-navigation.show {
    display: flex;
}

.dv-nav-info {
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

.dv-nav-buttons {
    display: flex;
    gap: 10px;
}

.dv-result {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 0;
    min-height: 200px;
    position: relative;
    display: none;
    margin-bottom: 20px;
    overflow: hidden;
}

.dv-result.show {
    display: block;
}

.dv-result-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.dv-result-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.dv-result-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dv-copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.dv-copy-btn:hover {
    background: #5a6fd8;
    transform: scale(1.05);
}

.dv-result-content {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.4;
    max-height: 600px;
    overflow-y: auto;
}

/* Estilos para diff lado a lado */
.dv-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.dv-side-panel {
    border-right: 1px solid #e1e5e9;
    min-height: 400px;
}

.dv-side-panel:last-child {
    border-right: none;
}

.dv-side-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e1e5e9;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.dv-side-content {
    padding: 0;
}

/* Estilos para diff unificado */
.dv-unified {
    width: 100%;
}

.dv-line {
    display: flex;
    align-items: flex-start;
    padding: 2px 0;
    white-space: pre-wrap;
    border-left: 3px solid transparent;
    padding-left: 60px;
    position: relative;
    min-height: 18px;
    word-break: break-all;
}

.dv-line-number {
    position: absolute;
    left: 5px;
    top: 2px;
    width: 50px;
    font-size: 11px;
    color: #6c757d;
    text-align: right;
    user-select: none;
}

.dv-line-content {
    flex: 1;
    padding-left: 10px;
    min-height: 18px;
}

/* Colores para diferentes tipos de cambios */
.dv-line-added {
    background-color: #d4edda;
    border-left-color: #28a745;
}

.dv-line-removed {
    background-color: #f8d7da;
    border-left-color: #dc3545;
}

.dv-line-modified {
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

.dv-line-context {
    background-color: #ffffff;
    border-left-color: #e9ecef;
}

/* Resaltado inline para cambios de palabras */
.dv-word-added {
    background-color: #a7f3d0;
    color: #065f46;
    padding: 1px 2px;
    border-radius: 2px;
}

.dv-word-removed {
    background-color: #fecaca;
    color: #7f1d1d;
    padding: 1px 2px;
    border-radius: 2px;
    text-decoration: line-through;
}

.dv-word-modified {
    background-color: #fef3c7;
    color: #78350f;
    padding: 1px 2px;
    border-radius: 2px;
}

.dv-stats {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.dv-stats.show {
    display: grid;
}

.dv-stat {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dv-stat:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.dv-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    display: block;
    transition: all 0.3s ease;
}

.dv-stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.dv-legend {
    display: none;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.dv-legend.show {
    display: block;
}

.dv-legend h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

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

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

.dv-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
    border-left: 3px solid;
}

.dv-loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 600;
}

.dv-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

.dv-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
    display: none;
}

.dv-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
    display: none;
}

.dv-checkbox-group {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.dv-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.dv-checkbox input[type="checkbox"] {
    transform: scale(1.2);
}

.dv-export-section {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.dv-export-section.show {
    display: block;
}

.dv-export-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

.dv-export-formats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 968px) {
    #diff-viewer-container {
        margin: 10px;
    }

    .dv-content {
        padding: 20px;
    }

    .dv-controls {
        grid-template-columns: 1fr;
    }

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

    .dv-buttons {
        flex-direction: column;
    }

    .dv-btn {
        width: 100%;
    }

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

    .dv-side-panel {
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
    }

    .dv-side-panel:last-child {
        border-bottom: none;
    }

    .dv-header h1 {
        font-size: 24px;
    }

    .dv-header p {
        font-size: 14px;
    }
}
