/**
 * Conflict Resolution Modal Styles
 *
 * ARCHITECTURE: Styles for A&P seed conflict resolution UI
 * WHY: Shows word-level diff so users understand what they will lose
 * NOTE: Uses SOL design system tokens where applicable
 */

/* Overlay */
.sol-conflict-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: conflictFadeIn 0.15s ease-out;
}

.sol-conflict-modal-overlay.visible {
    display: flex;
}

.sol-conflict-modal-overlay.closing {
    animation: conflictFadeOut 0.15s ease-out forwards;
}

@keyframes conflictFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes conflictFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Modal container */
.sol-conflict-modal {
    background: var(--sol-bg-surface, #1e293b);
    border: 1px solid var(--sol-border-subtle, #334155);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: conflictSlideUp 0.15s ease-out;
}

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

/* Header */
.sol-conflict-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sol-border-subtle, #334155);
}

.sol-conflict-header h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sol-text-primary, #f1f5f9);
}

.sol-conflict-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--sol-text-secondary, #94a3b8);
    line-height: 1.5;
}

/* Change summary bar */
.sol-conflict-summary {
    padding: 0.75rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid var(--sol-border-subtle, #334155);
    font-size: 0.875rem;
    color: var(--sol-text-secondary, #94a3b8);
}

/* Body - scrollable diff sections */
.sol-conflict-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

/* Diff sections */
.sol-conflict-section {
    margin-bottom: 1.25rem;
}

.sol-conflict-section:last-child {
    margin-bottom: 0;
}

.sol-conflict-section-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sol-text-primary, #f1f5f9);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sol-conflict-diff-content {
    background: var(--sol-bg-elevated, #0f172a);
    border: 1px solid var(--sol-border-subtle, #334155);
    border-radius: 6px;
    padding: 1rem;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 0.875rem;
    color: var(--sol-text-secondary, #94a3b8);
    max-height: 200px;
    overflow-y: auto;
}

/* Empty content placeholder */
.sol-conflict-diff-content .diff-empty {
    font-style: italic;
    opacity: 0.6;
}

/* Footer */
.sol-conflict-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sol-border-subtle, #334155);
    background: var(--sol-bg-elevated, #0f172a);
    border-radius: 0 0 8px 8px;
}

/* Modal buttons */
.sol-conflict-footer .sol-modal-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.sol-conflict-footer .sol-modal-btn.secondary {
    background: transparent;
    color: var(--sol-text-secondary, #94a3b8);
    border: 1px solid var(--sol-border-subtle, #334155);
}

.sol-conflict-footer .sol-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sol-text-primary, #f1f5f9);
}

.sol-conflict-footer .sol-modal-btn.danger {
    background: #ef4444;
    color: white;
    border: none;
}

.sol-conflict-footer .sol-modal-btn.danger:hover {
    background: #dc2626;
}

/* Primary button (v1.4 A&P diff modal accept) */
.sol-conflict-footer .sol-modal-btn.primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.sol-conflict-footer .sol-modal-btn.primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* ========== v1.4 A&P DIFF MODAL STYLES ========== */

/* A&P diff modal specific adjustments */
.ap-diff-modal .sol-conflict-header h3 {
    color: #10b981;
}

.ap-diff-modal-overlay .sol-conflict-summary {
    background: rgba(16, 185, 129, 0.1);
}

/* Three-button footer for A&P diff */
.ap-diff-footer {
    gap: 10px;
}

.ap-diff-footer .sol-modal-btn#apDiffEdit {
    /* Edit button styling - subtle but visible */
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.ap-diff-footer .sol-modal-btn#apDiffEdit:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

/* Responsive */
@media (max-width: 600px) {
    .sol-conflict-modal-overlay {
        padding: 0.5rem;
    }

    .sol-conflict-modal {
        width: 100%;
        max-height: 95vh;
    }

    .sol-conflict-header,
    .sol-conflict-summary,
    .sol-conflict-body,
    .sol-conflict-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sol-conflict-footer {
        flex-direction: column-reverse;
    }

    .sol-conflict-footer .sol-modal-btn {
        width: 100%;
    }

    .sol-conflict-diff-content {
        max-height: 150px;
    }

    /* A&P diff modal on mobile */
    .ap-diff-footer {
        gap: 8px;
    }
}
