/**
 * Custom Modal Styles - Dohmeyer Systems
 * Stylische Pop-Ups im Design der Seite
 */

#custom-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
}

#custom-modal-container > * {
    pointer-events: all;
}

/* Overlay */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

.custom-modal-overlay.closing {
    opacity: 0;
}

/* Modal Box */
.custom-modal-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.show .custom-modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.custom-modal-overlay.closing .custom-modal-box {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
}

/* Header */
.custom-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
}

.custom-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.custom-modal-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 18px;
}

.custom-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Body */
.custom-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.custom-modal-message {
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Icon */
.custom-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 32px;
}

.custom-modal-icon.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.custom-modal-icon.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

/* Input */
.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    margin-top: 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.custom-modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-modal-input.error {
    border-color: #ef4444;
    animation: shake 0.3s;
}

.custom-modal-input::placeholder {
    color: #9ca3af;
}

textarea.custom-modal-input {
    resize: vertical;
    min-height: 100px;
}

/* Footer */
.custom-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Buttons */
.custom-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.custom-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-modal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .custom-modal-box {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .custom-modal-header {
        padding: 20px 20px 12px;
    }

    .custom-modal-title {
        font-size: 18px;
    }

    .custom-modal-body {
        padding: 20px;
    }

    .custom-modal-footer {
        padding: 12px 20px 20px;
        flex-direction: column-reverse;
    }

    .custom-modal-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Force light mode for modals - ensures readability */
.custom-modal-box {
    background: white !important;
    color: #111827 !important;
}

.custom-modal-header {
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%) !important;
    border-bottom-color: #e5e7eb !important;
}

.custom-modal-message {
    color: #374151 !important;
}

.custom-modal-footer {
    background: #f9fafb !important;
    border-top-color: #e5e7eb !important;
}

.custom-modal-close {
    color: #6b7280 !important;
}

.custom-modal-close:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}