﻿/* === DIALOG CUSTOMIZADO === */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(4px);
}

.dialog-container {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    animation: scaleIn 0.3s ease-out;
}

.edit-dialog-card {
    width: 100%;
    border-radius: var(--rounded-lg);
    background: var(--background-white);
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--primary-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.dialog-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(78, 124, 210, 0.05), rgba(132, 58, 211, 0.05));
    flex-shrink: 0;
}

.dialog-title-area {
    flex: 1;
}

.dialog-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--rounded-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--background-white);
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dialog-title {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.dialog-subtitle {
    color: var(--text-secondary) !important;
    margin: 0 !important;
    font-size: 0.9rem;
}

.close-button {
    width: 40px !important;
    height: 40px !important;
    border-radius: var(--rounded-sm) !important;
    transition: all var(--transition-speed) !important;
}

    .close-button:hover {
        background: var(--bg-danger-light) !important;
        color: var(--danger-color) !important;
        transform: scale(1.05) !important;
    }

.dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--background-light);
}

.dialog-content {
    padding: 1rem;
}

.dialog-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(78, 124, 210, 0.05), rgba(132, 58, 211, 0.05));
    flex-shrink: 0;
}

.dialog-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* === RESPONSIVIDADE DO DIALOG === */
@media (max-width: 768px) {
    .dialog-overlay {
        padding: 0.5rem;
    }

    .dialog-container {
        max-width: 100%;
        max-height: 95vh;
    }

    .edit-dialog-card {
        border-radius: var(--rounded-md);
        max-height: 95vh;
    }

    .dialog-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .dialog-title-area {
        order: 1;
    }

    .close-button {
        align-self: flex-end;
        order: 2;
    }

    .dialog-content {
        padding: 0.75rem;
    }

    .dialog-footer {
        padding: 1rem;
    }

    .dialog-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

        .dialog-actions .secondary-button,
        .dialog-actions .primary-button {
            width: 100%;
            justify-content: center;
        }
}

@media (max-width: 480px) {
    .dialog-overlay {
        padding: 0.25rem;
    }

    .edit-dialog-card {
        border-radius: var(--rounded-sm);
        max-height: 98vh;
    }

    .dialog-header {
        padding: 0.75rem;
    }

    .dialog-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .dialog-title {
        font-size: 1.1rem !important;
    }

    .dialog-subtitle {
        font-size: 0.85rem !important;
    }

    .dialog-content {
        padding: 0.5rem;
    }

    .dialog-footer {
        padding: 0.75rem;
    }

    .close-button {
        width: 36px !important;
        height: 36px !important;
    }
}

/* === ANIMAÇÕES === */
@keyframes dialogSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.edit-dialog-card {
    animation: dialogSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === ACESSIBILIDADE === */
.dialog-overlay:focus-within {
    outline: none;
}

.edit-dialog-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.close-button:focus-visible {
    outline: 2px solid var(--danger-color);
    outline-offset: 2px;
}

/* === SCROLL CUSTOMIZADO === */
.dialog-body::-webkit-scrollbar {
    width: 8px;
}

.dialog-body::-webkit-scrollbar-track {
    background: var(--bg-gray-100);
    border-radius: 4px;
}

.dialog-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

    .dialog-body::-webkit-scrollbar-thumb:hover {
        background: var(--primary-hover);
    }


@media (max-width: 768px) {
    .mud-dialog-actions {
        flex-direction: column !important;
        gap: 8px;
    }

        .mud-dialog-actions .mud-button {
            width: 100%;
        }
}