/* ==========================================
   PROFESSIONAL DIALOG SYSTEM v3.0
   Corporate & Sophisticated Design
   ========================================== */

/* ==================== Reset & Base ==================== */
.modern-dialog {
    border-radius: 16px !important;
    overflow: visible !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 
                0 8px 16px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(0, 0, 0, 0.04) !important;
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%) !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1400px !important;
    width: 95vw !important;
}

.modern-dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.03) 0%, 
        rgba(168, 85, 247, 0.03) 100%);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modern-dialog:hover::before {
    opacity: 1;
}

/* ==================== Title Section ==================== */
.dialog-title {
    padding: 32px 40px 24px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
}

.dialog-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 40px;
    width: 60px;
    height: 2px;
    background: #6366f1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-dialog:hover .dialog-title::after {
    width: 120px;
}

.dialog-title-content {
    display: flex;
    align-items: center;
    gap: 16px;
    animation: fadeInUp 0.4s ease;
}

.dialog-title-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border: 1px solid #e5e7eb;
    color: #6366f1;
    font-size: 24px;
    transition: all 0.3s ease;
}

.modern-dialog:hover .dialog-title-icon {
    transform: scale(1.05);
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #c7d2fe;
}

.dialog-title-text {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    letter-spacing: -0.02em !important;
    margin: 0 !important;
    transition: color 0.3s ease;
}

.modern-dialog:hover .dialog-title-text {
    color: #6366f1 !important;
}

/* ==================== Color Variants ==================== */
.dialog-variant-primary .dialog-title-icon {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #c7d2fe;
    color: #6366f1;
}

.dialog-variant-primary .dialog-title::after {
    background: #6366f1;
}

.dialog-variant-success .dialog-title-icon {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    color: #22c55e;
}

.dialog-variant-success .dialog-title::after {
    background: #22c55e;
}

.dialog-variant-warning .dialog-title-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fcd34d;
    color: #f59e0b;
}

.dialog-variant-warning .dialog-title::after {
    background: #f59e0b;
}

.dialog-variant-danger .dialog-title-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    color: #ef4444;
}

.dialog-variant-danger .dialog-title::after {
    background: #ef4444;
}

.dialog-variant-info .dialog-title-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
    color: #3b82f6;
}

.dialog-variant-info .dialog-title::after {
    background: #3b82f6;
}

/* ==================== Content Area ==================== */
.dialog-content-wrapper {
    padding: 32px 40px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f8f9fa 100%);
    animation: fadeIn 0.5s ease 0.1s both;
}

.dialog-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dialog-form > * {
    animation: fadeInUp 0.4s ease both;
}

.dialog-form > *:nth-child(1) { animation-delay: 0.05s; }
.dialog-form > *:nth-child(2) { animation-delay: 0.1s; }
.dialog-form > *:nth-child(3) { animation-delay: 0.15s; }
.dialog-form > *:nth-child(4) { animation-delay: 0.2s; }
.dialog-form > *:nth-child(5) { animation-delay: 0.25s; }
.dialog-form > *:nth-child(6) { animation-delay: 0.3s; }

/* ==================== Form Fields ==================== */
.modern-text-field {
    transition: all 0.25s ease !important;
}

.modern-text-field .mud-input {
    font-size: 15px !important;
    color: #1f2937 !important;
    transition: all 0.3s ease;
}

.modern-text-field .mud-input-label {
    font-weight: 600 !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    transition: all 0.3s ease;
}

.modern-text-field:hover .mud-input-label {
    color: #6366f1 !important;
}

.modern-text-field .mud-input-outlined .mud-input-outlined-border {
    border-color: #d1d5db !important;
    border-width: 1.5px !important;
    transition: all 0.25s ease !important;
}

.modern-text-field:hover .mud-input-outlined .mud-input-outlined-border {
    border-color: #9ca3af !important;
}

.modern-text-field.mud-input-focused .mud-input-outlined .mud-input-outlined-border {
    border-color: #6366f1 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modern-text-field .mud-input-root {
    border-radius: 12px !important;
    background: #ffffff;
    transition: all 0.25s ease;
}

.modern-text-field:hover .mud-input-root {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modern-text-field.mud-input-focused .mud-input-root {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.modern-checkbox {
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.25s ease;
    margin: 6px 0;
}

.modern-checkbox:hover {
    background: #f3f4f6;
    transform: translateX(-3px);
}

.modern-checkbox .mud-checkbox-icon {
    border-radius: 6px;
}

/* ==================== Actions Area ==================== */
.dialog-actions {
    padding: 24px 40px 28px;
    background: linear-gradient(to top, #f8f9fa 0%, #fafbfc 100%);
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    animation: fadeInUp 0.4s ease 0.2s both;
}

.dialog-button-cancel {
    height: 44px;
    padding: 0 24px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #6b7280 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: all 0.25s ease !important;
    border: 1.5px solid #d1d5db !important;
    background: #ffffff !important;
}

.dialog-button-cancel:hover {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
    color: #374151 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dialog-button-cancel:active {
    transform: translateY(0);
}

.dialog-button-submit {
    height: 44px;
    padding: 0 28px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
    border: none !important;
    position: relative;
    overflow: hidden;
}

.dialog-button-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.dialog-button-submit:hover::before {
    width: 300px;
    height: 300px;
}

.dialog-button-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35) !important;
}

.dialog-button-submit:active {
    transform: translateY(-1px);
}

/* ==================== Button Variants ==================== */
.dialog-button-primary {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
}

.dialog-button-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25) !important;
}

.dialog-button-success:hover {
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35) !important;
}

.dialog-button-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25) !important;
}

.dialog-button-danger:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35) !important;
}

.dialog-button-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25) !important;
}

.dialog-button-warning:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35) !important;
}

/* ==================== Loading State ==================== */
.dialog-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.dialog-loading-spinner {
    margin-left: 4px;
}

/* ==================== Additional Components ==================== */
.dialog-section-header {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    position: relative;
}

.dialog-section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #6366f1;
    transition: width 0.3s ease;
}

.dialog-section-header:hover::after {
    width: 100px;
}

.dialog-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #d1d5db 20%, 
        #d1d5db 80%, 
        transparent 100%);
    margin: 28px 0;
}

.dialog-info-box {
    padding: 18px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 3px solid #3b82f6;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.3s ease;
    animation: fadeInLeft 0.4s ease both;
}

.dialog-info-box:hover {
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.dialog-info-box-icon {
    color: #3b82f6;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.dialog-info-box-text {
    color: #1e40af;
    font-size: 14px;
    line-height: 1.6;
}

.dialog-field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* ==================== Card Alternative Style ==================== */
.dialog-card-style {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.dialog-card-style:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dialog-animate-in {
    animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Backdrop Enhancement ==================== */
.mud-overlay {
    backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.4) !important;
    animation: fadeIn 0.3s ease;
}

/* ==================== Scrollbar ==================== */
.modern-dialog .mud-dialog-content::-webkit-scrollbar {
    width: 6px;
}

.modern-dialog .mud-dialog-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.modern-dialog .mud-dialog-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.modern-dialog .mud-dialog-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1600px) {
    .modern-dialog {
        max-width: 1200px !important;
    }
}

@media (max-width: 1200px) {
    .modern-dialog {
        max-width: 1000px !important;
        width: 90vw !important;
    }
}

@media (max-width: 768px) {
    .modern-dialog {
        border-radius: 20px !important;
        margin: 16px !important;
        width: calc(100vw - 32px) !important;
        max-width: none !important;
    }

    .dialog-title {
        padding: 24px 20px 20px;
    }

    .dialog-title-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .dialog-title-text {
        font-size: 18px !important;
    }

    .dialog-content-wrapper {
        padding: 24px 20px;
    }

    .dialog-actions {
        padding: 20px;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .dialog-button-cancel,
    .dialog-button-submit {
        width: 100%;
        height: 48px;
    }

    .dialog-field-group {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==================== Dark Mode Support ==================== */
@media (prefers-color-scheme: dark) {
    .modern-dialog {
        background: linear-gradient(to bottom, #1f2937 0%, #111827 100%) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                    0 8px 16px rgba(0, 0, 0, 0.3),
                    0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    }

    .dialog-title {
        background: linear-gradient(to bottom, #1f2937 0%, #1a202c 100%);
        border-bottom-color: #374151;
    }

    .dialog-title-text {
        color: #f3f4f6 !important;
    }

    .dialog-title-icon {
        background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
        border-color: #4b5563;
    }

    .dialog-content-wrapper {
        background: linear-gradient(to bottom, #111827 0%, #0f172a 100%);
    }

    .dialog-actions {
        background: linear-gradient(to top, #0f172a 0%, #111827 100%);
        border-top-color: #374151;
    }

    .modern-text-field .mud-input-root {
        background: #1f2937;
    }

    .modern-text-field:hover .mud-input-root,
    .modern-text-field.mud-input-focused .mud-input-root {
        background: #1f2937;
    }

    .modern-text-field .mud-input {
        color: #f3f4f6 !important;
    }

    .modern-text-field .mud-input-label {
        color: #9ca3af !important;
    }

    .modern-text-field .mud-input-outlined .mud-input-outlined-border {
        border-color: #4b5563 !important;
    }

    .dialog-button-cancel {
        background: #1f2937 !important;
        border-color: #4b5563 !important;
        color: #d1d5db !important;
    }

    .dialog-button-cancel:hover {
        background: #374151 !important;
        border-color: #6b7280 !important;
        color: #f3f4f6 !important;
    }

    .dialog-info-box {
        background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
        border-left-color: #3b82f6;
    }

    .dialog-info-box-text {
        color: #bfdbfe;
    }

    .dialog-card-style {
        background: #1f2937;
        border-color: #374151;
    }

    .dialog-section-header {
        color: #f3f4f6;
        border-bottom-color: #374151;
    }

    .modern-checkbox:hover {
        background: #1f2937;
    }
}

/* ==================== Focus States ==================== */
.dialog-button-cancel:focus-visible,
.dialog-button-submit:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* ==================== Utility Classes ==================== */
.dialog-text-center {
    text-align: center;
}

.dialog-mb-0 {
    margin-bottom: 0 !important;
}

.dialog-mt-4 {
    margin-top: 24px !important;
}

/* ==================== Shimmer Effect for Loading ==================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.dialog-shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}
