/* Modal Styles
   Extracted from inline CSS in JavaScript for better separation of concerns */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--preto-fuso, #2c3e50);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.modal-close:focus {
    outline: 2px solid var(--vermelho-principal, #e74c3c);
    outline-offset: 2px;
}

.modal-body {
    padding: 1.5rem;
}

.detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.detail-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--vermelho-principal, #e74c3c);
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: #f1f3f4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-item strong {
    color: var(--cinza-escuro, #555);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-footer .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 15px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .detail-item {
        padding: 0.5rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 98vh;
        border-radius: 8px;
    }
    
    .modal-header {
        border-radius: 8px 8px 0 0;
    }
    
    .modal-footer {
        border-radius: 0 0 8px 8px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-content,
    .detail-item,
    .modal-close {
        animation: none;
        transition: none;
    }
    
    .detail-item:hover {
        transform: none;
    }
}

/* Focus management for modal */
.modal-overlay[data-focus-trap] {
    /* Ensures proper focus management within modal */
}

/* Success state for copy button */
.btn-success {
    background: #2ecc71 !important;
    color: white !important;
}

.btn-error {
    background: #e74c3c !important;
    color: white !important;
}