/* Custom Modal Styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.custom-modal-overlay.hidden {
    display: none !important;
}

.custom-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: relative;
    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: 400px;
    width: 90%;
    margin: 0 auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.custom-modal-overlay.active .custom-modal-content {
    transform: scale(1);
}

.custom-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.custom-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

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

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

.custom-modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

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

.custom-modal-btn:active {
    transform: translateY(0);
}

.custom-modal-btn-primary {
    background: #111827;
    color: white;
}

.custom-modal-btn-primary:hover {
    background: #1f2937;
}

.custom-modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.custom-modal-btn-secondary:hover {
    background: #e5e7eb;
}

.custom-modal-btn-danger {
    background: #000000;
    color: white;
}

.custom-modal-btn-danger:hover {
    background: #333333;
}

/* Type-specific styling - Overridden for B&W Theme */
.custom-modal-content.modal-success .custom-modal-header,
.custom-modal-content.modal-error .custom-modal-header,
.custom-modal-content.modal-warning .custom-modal-header {
    border-bottom-color: #e5e7eb;
}

.custom-modal-content.modal-success .custom-modal-title,
.custom-modal-content.modal-error .custom-modal-title,
.custom-modal-content.modal-warning .custom-modal-title {
    color: #111827;
}

/* Dark mode overrides for types */
html.dark .custom-modal-content.modal-success .custom-modal-header,
html.dark .custom-modal-content.modal-error .custom-modal-header,
html.dark .custom-modal-content.modal-warning .custom-modal-header {
    border-bottom-color: #374151;
}

html.dark .custom-modal-content.modal-success .custom-modal-title,
html.dark .custom-modal-content.modal-error .custom-modal-title,
html.dark .custom-modal-content.modal-warning .custom-modal-title {
    color: #f3f4f6;
}

html.dark .custom-modal-btn-danger {
    background: #ffffff;
    color: black;
}

html.dark .custom-modal-btn-danger:hover {
    background: #e5e7eb;
}

/* Animation for modal entrance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dark mode overrides */
html.dark .custom-modal-content {
    background: #1f2937; /* gray-800 */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 
                0 10px 10px -5px rgba(0, 0, 0, 0.15);
}

html.dark .custom-modal-header {
    border-bottom-color: #374151; /* gray-700 */
}

html.dark .custom-modal-title {
    color: #f3f4f6; /* gray-100 */
}

html.dark .custom-modal-message {
    color: #d1d5db; /* gray-300 */
}

html.dark .custom-modal-btn-secondary {
    background: #374151; /* gray-700 */
    color: #f3f4f6; /* gray-100 */
}

html.dark .custom-modal-btn-secondary:hover {
    background: #4b5563; /* gray-600 */
}

html.dark .custom-modal-btn-primary {
    background: #ffffff; /* white */
    color: #000000; /* black */
}

html.dark .custom-modal-btn-primary:hover {
    background: #e5e7eb; /* gray-200 */
}
