/* React Admin Dashboard CSS */
/* Custom styles for React integration with admin dashboard */

/* Fix React component integration issues */
.react-admin-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure proper z-index for React components */
.react-component {
    position: relative;
    z-index: 1;
}

/* Fix modal z-index issues with React */
.modal {
    z-index: 1050;
}

.modal-backdrop {
    z-index: 1040;
}

/* Fix dropdown z-index issues */
.dropdown-menu {
    z-index: 1000;
}

/* Fix tooltip z-index issues */
.tooltip {
    z-index: 1070;
}

/* Fix popover z-index issues */
.popover {
    z-index: 1060;
}

/* React component loading states */
.react-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.react-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fix React component overflow issues */
.react-content {
    overflow-x: auto;
    overflow-y: visible;
}

/* Ensure proper spacing for React components */
.react-section {
    margin-bottom: 20px;
}

/* Fix form styling in React components */
.react-form .form-group {
    margin-bottom: 1rem;
}

.react-form .form-control {
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 8px 12px;
}

.react-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button styling for React components */
.react-btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

.react-btn:hover {
    text-decoration: none;
}

.react-btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.react-btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
}

/* Card styling for React components */
.react-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    margin-bottom: 20px;
}

.react-card-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 4px 4px 0 0;
}

.react-card-body {
    padding: 15px;
}

/* Table styling for React components */
.react-table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.react-table th,
.react-table td {
    padding: 8px;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.react-table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Alert styling for React components */
.react-alert {
    padding: 12px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

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

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

.react-alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.react-alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Responsive fixes for React components */
@media (max-width: 768px) {
    .react-card {
        margin-bottom: 15px;
    }
    
    .react-card-header,
    .react-card-body {
        padding: 10px;
    }
    
    .react-table {
        font-size: 14px;
    }
    
    .react-table th,
    .react-table td {
        padding: 6px;
    }
}

/* Fix for React component animations */
.react-fade-enter {
    opacity: 0;
}

.react-fade-enter-active {
    opacity: 1;
    transition: opacity 300ms;
}

.react-fade-exit {
    opacity: 1;
}

.react-fade-exit-active {
    opacity: 0;
    transition: opacity 300ms;
}

/* Fix for React component focus states */
.react-component:focus {
    outline: none;
}

.react-component:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Utility classes for React components */
.react-text-center {
    text-align: center;
}

.react-text-left {
    text-align: left;
}

.react-text-right {
    text-align: right;
}

.react-mb-0 { margin-bottom: 0; }
.react-mb-1 { margin-bottom: 0.25rem; }
.react-mb-2 { margin-bottom: 0.5rem; }
.react-mb-3 { margin-bottom: 1rem; }
.react-mb-4 { margin-bottom: 1.5rem; }
.react-mb-5 { margin-bottom: 3rem; }

.react-mt-0 { margin-top: 0; }
.react-mt-1 { margin-top: 0.25rem; }
.react-mt-2 { margin-top: 0.5rem; }
.react-mt-3 { margin-top: 1rem; }
.react-mt-4 { margin-top: 1.5rem; }
.react-mt-5 { margin-top: 3rem; }

.react-p-0 { padding: 0; }
.react-p-1 { padding: 0.25rem; }
.react-p-2 { padding: 0.5rem; }
.react-p-3 { padding: 1rem; }
.react-p-4 { padding: 1.5rem; }
.react-p-5 { padding: 3rem; }

/* Fix for React component display issues */
.react-d-none { display: none; }
.react-d-block { display: block; }
.react-d-inline { display: inline; }
.react-d-inline-block { display: inline-block; }
.react-d-flex { display: flex; }

/* Flexbox utilities for React components */
.react-justify-content-start { justify-content: flex-start; }
.react-justify-content-end { justify-content: flex-end; }
.react-justify-content-center { justify-content: center; }
.react-justify-content-between { justify-content: space-between; }
.react-justify-content-around { justify-content: space-around; }

.react-align-items-start { align-items: flex-start; }
.react-align-items-end { align-items: flex-end; }
.react-align-items-center { align-items: center; }
.react-align-items-baseline { align-items: baseline; }
.react-align-items-stretch { align-items: stretch; }
