/**
 * Impact Audit Modal Styles
 *
 * Shows users what will stop working when they cancel their subscription.
 * Part of Phase 2: Error Recovery & Trust features.
 */

/* ============================================
   MODAL BACKDROP
   ============================================ */
.impact-audit-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.impact-audit-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MODAL CONTAINER
   ============================================ */
.impact-audit-modal {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    max-width: 500px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.impact-audit-backdrop.visible .impact-audit-modal {
    transform: scale(1) translateY(0);
}

/* ============================================
   MODAL HEADER
   ============================================ */
.impact-audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #374151;
}

.impact-audit-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.impact-audit-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.impact-audit-close:hover {
    color: #fff;
    background: #374151;
}

/* ============================================
   MODAL CONTENT
   ============================================ */
.impact-audit-content {
    padding: 24px;
}

.impact-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #9ca3af;
    margin: 0 0 16px 0;
}

/* ============================================
   IMPACT ITEMS
   ============================================ */
.impact-item {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
}

.impact-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.impact-icon.stop {
    color: #ef4444;
}

.impact-icon.archive {
    color: #f59e0b;
}

.impact-details {
    flex: 1;
}

.impact-label {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 4px 0;
}

.impact-sublabel {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
}

.impact-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
}

.impact-list li {
    font-size: 13px;
    color: #9ca3af;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.impact-list li::before {
    content: "•";
    color: #6b7280;
}

.integration-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.integration-tag {
    background: #374151;
    color: #d1d5db;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

/* ============================================
   SECTION DIVIDER
   ============================================ */
.impact-divider {
    height: 1px;
    background: #374151;
    margin: 20px 0;
}

/* ============================================
   DOWNGRADE CARD
   ============================================ */
.downgrade-section {
    margin-top: 8px;
}

.downgrade-intro {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 12px;
}

.downgrade-intro-icon {
    font-size: 18px;
}

.downgrade-card {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 16px;
}

.downgrade-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.downgrade-plan-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.downgrade-plan-price {
    font-size: 14px;
    color: #60a5fa;
    font-weight: 500;
}

.downgrade-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.downgrade-features li {
    font-size: 13px;
    color: #d1d5db;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.downgrade-features li::before {
    content: "✓";
    color: #60a5fa;
    font-weight: 600;
}

/* ============================================
   MODAL FOOTER / ACTIONS
   ============================================ */
.impact-audit-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.impact-audit-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-align: center;
}

.impact-audit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Export Button - Secondary */
.impact-audit-btn.secondary {
    background: transparent;
    border-color: #4b5563;
    color: #d1d5db;
}

.impact-audit-btn.secondary:hover:not(:disabled) {
    background: #374151;
    border-color: #6b7280;
}

/* Downgrade Button - Primary */
.impact-audit-btn.primary {
    background: #3b82f6;
    color: #fff;
}

.impact-audit-btn.primary:hover:not(:disabled) {
    background: #2563eb;
}

/* Cancel Button - Danger */
.impact-audit-btn.danger {
    background: transparent;
    border-color: #ef4444;
    color: #ef4444;
}

.impact-audit-btn.danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   LOADING STATE
   ============================================ */
.impact-audit-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
}

.impact-audit-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: impact-spin 0.8s linear infinite;
}

@keyframes impact-spin {
    to {
        transform: rotate(360deg);
    }
}

.impact-audit-loading-text {
    color: #9ca3af;
    font-size: 14px;
}

/* ============================================
   CONFIRMATION SCREEN
   ============================================ */
.impact-audit-confirm {
    padding: 32px 24px;
    text-align: center;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px 0;
}

.confirm-message {
    font-size: 15px;
    color: #9ca3af;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-actions .impact-audit-btn {
    flex: 0 1 auto;
    min-width: 140px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 500px) {
    .impact-audit-modal {
        margin: 16px;
    }

    .impact-audit-header {
        padding: 16px 20px;
    }

    .impact-audit-content {
        padding: 20px;
    }

    .impact-audit-footer {
        padding: 12px 20px 20px;
        flex-direction: column;
    }

    .impact-audit-btn {
        width: 100%;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .confirm-actions .impact-audit-btn {
        width: 100%;
    }
}

/* ============================================
   FOCUS TRAP SUPPORT
   ============================================ */
.impact-audit-modal:focus {
    outline: none;
}

.impact-audit-modal [tabindex="-1"]:focus {
    outline: none;
}

/* ============================================
   ACCESSIBILITY: Focus-visible styles
   ============================================ */
.impact-audit-btn:focus-visible:not(:disabled) {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.impact-audit-btn.primary:focus-visible:not(:disabled) {
    outline-color: #93c5fd;
}

.impact-audit-btn.secondary:focus-visible:not(:disabled) {
    outline-color: #9ca3af;
}

.impact-audit-btn.danger:focus-visible:not(:disabled) {
    outline-color: #fca5a5;
}

.impact-audit-close:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* ============================================
   ACCESSIBILITY: Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .impact-audit-backdrop {
        transition: none;
    }

    .impact-audit-modal {
        transition: none;
    }

    .impact-audit-btn {
        transition: none;
    }

    .impact-audit-close {
        transition: none;
    }

    .impact-audit-spinner {
        animation: none;
    }
}
