/**
 * Modal Component Styles
 * Herbruikbare modal styling voor het OneSchoon systeem
 */

/* OneSchoon Modal Backdrop */
.oneschoon-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.oneschoon-modal-backdrop.is-visible {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* OneSchoon Modal Container */
.oneschoon-modal {
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 4rem);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    position: relative;
    padding: 1.5rem;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.oneschoon-modal-backdrop.is-visible .oneschoon-modal {
    transform: scale(1) translateY(0);
}

/* OneSchoon Modal Header */
.oneschoon-modal__header {
    padding: 0rem 0rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0rem;
    flex-shrink: 0;
}

/* OneSchoon Modal Footer */
.oneschoon-modal__footer {
    padding: 1rem 0rem 0rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0rem;
    flex-shrink: 0;
}

.oneschoon-modal__header h2 {
    margin: 0 !important;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.oneschoon-modal__close {
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: #999 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: normal !important;
}

.oneschoon-modal__close:hover,
.oneschoon-modal__close:focus {
    background: #f8f9fa !important;
    color: #333 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* OneSchoon Modal Body */
.oneschoon-modal__body {
    background: #fff;
    padding: 1.5rem;
    margin: 0;
    border-radius: 6px;
    overflow-y: auto;
    min-height: 0;
}

.oneschoon-modal__body p {
    margin-bottom: 1.5rem;
    color: #666;
}

/* OneSchoon Modal Form Styling */
.oneschoon-modal .form-group {
    margin-bottom: 1.5rem;
}

.oneschoon-modal .form-group:last-child {
    margin-bottom: 0;
}

.oneschoon-modal label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.oneschoon-modal .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.oneschoon-modal .form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* OneSchoon Modal Button Styling */
.oneschoon-modal .button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    min-width: 100px;
}

.oneschoon-modal .button-primary {
    background: #007cba;
    color: #fff;
}

.oneschoon-modal .button-primary:hover {
    background: #005a87;
}

.oneschoon-modal .button-secondary {
    background: #6c757d;
    color: #fff;
}

.oneschoon-modal .button-secondary:hover {
    background: #545b62;
}

.oneschoon-modal .button-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

/* OneSchoon Modal Variants */
.oneschoon-modal.modal-large {
    max-width: 900px;
}

.oneschoon-modal.modal-wide {
    max-width: 1200px;
}

/* Modal Animation Keyframes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        visibility: hidden;
    }
    to {
        opacity: 1;
        visibility: visible;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
    }
    to {
        transform: scale(1) translateY(0);
    }
}

/* OneSchoon Modal Responsive Design */
@media (max-width: 768px) {
    .oneschoon-modal {
        width: 95%;
        margin: 1rem;
        padding: 1rem;
    }

    .oneschoon-modal__header {
        padding: 1rem 1rem 0.5rem;
    }

    .oneschoon-modal__body {
        padding: 1rem;
        margin: 0 1rem;
    }

    .oneschoon-modal__footer {
        padding: 0.5rem 1rem 1rem;
        flex-direction: column;
    }

    .oneschoon-modal .button {
        width: 100%;
        text-align: center;
    }
}

/* OneSchoon Modal Error States */
.oneschoon-modal .form-control.error {
    border-color: #dc3545;
}

.oneschoon-modal .error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* OneSchoon Modal Loading State */
.oneschoon-modal.is-loading {
    pointer-events: none;
}

.oneschoon-modal.is-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* OneSchoon Modal Focus Management */
.oneschoon-modal-backdrop {
    outline: none;
}

.oneschoon-modal .form-control:invalid {
    border-color: #dc3545;
}

.oneschoon-modal .form-control:valid {
    border-color: #28a745;
}

/* OneSchoon Modal Table Styling */
.oneschoon-modal table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.oneschoon-modal table th,
.oneschoon-modal table td,
.table > :not(:last-child) > :last-child > * {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.075) !important;
}

.oneschoon-modal table th {
    font-weight: 600;
    background: #f8f9fa;
}

.oneschoon-modal .member-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* OneSchoon Modal Badge Styling */
.oneschoon-modal .badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.oneschoon-modal .badge-primary {
    color: #fff;
    background: #007cba;
}

.oneschoon-modal .badge-secondary {
    color: #fff;
    background: #6c757d;
}

/* Loading overlay */
.modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.modal-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

.modal-loading-overlay p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

/* Form disabled state */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
    margin-bottom: 16px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Button loading state */
.oneschoon-modal .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
}
