/* BreedLogic Rule Builder - Additional Styles */

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Enhanced UI components */
.condition-item {
    animation: fadeIn 0.3s ease-out;
}

.condition-group {
    animation: slideIn 0.3s ease-out;
}

.toast {
    animation: fadeIn 0.3s ease-out;
}

/* Enhanced button hover effects */
.btn-custom:hover {
    animation: pulse 0.3s ease-in-out;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #1a1a1a;
        --dark-bg: #2d2d2d;
    }
    
    body {
        background-color: var(--dark-bg);
        color: #e0e0e0;
    }
    
    .rule-builder-container {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .condition-group {
        background: #3a3a3a;
        border-color: #555;
    }
    
    .condition-item {
        background: #404040;
        border-color: #555;
    }
    
    .form-control,
    .form-select {
        background: #404040;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .form-control:focus,
    .form-select:focus {
        background: #4a4a4a;
        border-color: var(--secondary-color);
        color: #e0e0e0;
    }
}

/* Responsive enhancements */
@media (max-width: 576px) {
    .condition-item .row {
        flex-direction: column;
    }
    
    .condition-item .col-md-2,
    .condition-item .col-md-3 {
        margin-bottom: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-custom {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .navbar,
    .action-buttons,
    .examples-section {
        display: none;
    }
    
    .rule-builder-container {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .json-output {
        background: white;
        color: black;
        border: 1px solid #ccc;
        font-size: 0.8em;
    }
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .condition-group {
        border-width: 3px;
    }
    
    .condition-item {
        border-width: 2px;
    }
    
    .btn-custom {
        border-width: 2px;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced tooltip styles */
.tooltip {
    font-size: 0.8em;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading * {
    cursor: wait !important;
}

/* Custom scrollbar */
.json-output::-webkit-scrollbar {
    width: 8px;
}

.json-output::-webkit-scrollbar-track {
    background: #4a5568;
}

.json-output::-webkit-scrollbar-thumb {
    background: #718096;
    border-radius: 4px;
}

.json-output::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Error states */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.is-valid {
    border-color: var(--success-color) !important;
}

/* Custom badges */
.badge-custom {
    font-size: 0.7em;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Enhanced form validation */
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25);
}

/* Custom dropdown enhancements */
.form-select option {
    padding: 8px 12px;
}

/* Enhanced card components */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-success {
    background-color: var(--success-color);
}

.status-error {
    background-color: var(--danger-color);
}

.status-warning {
    background-color: var(--warning-color);
}

.status-info {
    background-color: var(--info-color);
}

/* Enhanced table styles */
.table-custom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-custom th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
}

.table-custom td {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 12px;
}

.table-custom tr:hover {
    background: #f8f9fa;
}

/* Enhanced modal styles */
.modal-custom .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-custom .modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
}

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

.modal-custom .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px;
}

/* Code syntax highlighting */
.json-output .json-key {
    color: #79c0ff;
}

.json-output .json-string {
    color: #a5d6ff;
}

.json-output .json-number {
    color: #79c0ff;
}

.json-output .json-boolean {
    color: #ffab70;
}

.json-output .json-null {
    color: #f85149;
}

/* Enhanced progress bars */
.progress-custom {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-custom .progress-bar {
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Custom alerts */
.alert-custom {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-custom.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-custom.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-custom.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-custom.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info-color);
}

/* Enhanced input groups */
.input-group-custom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group-custom .form-control {
    border: none;
    border-right: 1px solid #e9ecef;
}

.input-group-custom .form-control:focus {
    box-shadow: none;
}

.input-group-custom .input-group-text {
    background: #f8f9fa;
    border: none;
    color: #6c757d;
}

/* Enhanced switches */
.form-switch-custom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-switch-custom .form-check-input {
    width: 48px;
    height: 24px;
    margin: 0;
    background-color: #dee2e6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-switch-custom .form-check-input:checked {
    background-color: var(--success-color);
}

.form-switch-custom .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Enhanced tabs */
.nav-tabs-custom {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-radius: 0;
    padding: 12px 24px;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs-custom .nav-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.nav-tabs-custom .nav-link.active {
    background: none;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Enhanced pagination */
.pagination-custom {
    gap: 5px;
}

.pagination-custom .page-link {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: #6c757d;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.pagination-custom .page-link:hover {
    background: var(--primary-color);
    color: white;
}

.pagination-custom .page-item.active .page-link {
    background: var(--primary-color);
    color: white;
}

/* Enhanced breadcrumbs */
.breadcrumb-custom {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-custom .breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-custom .breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #dee2e6;
    padding: 0 8px;
}

/* Enhanced list groups */
.list-group-custom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.list-group-custom .list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.list-group-custom .list-group-item:hover {
    background: #f8f9fa;
}

.list-group-custom .list-group-item.active {
    background: var(--primary-color);
    color: white;
}

/* Enhanced accordion */
.accordion-custom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.accordion-custom .accordion-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
}

.accordion-custom .accordion-button {
    background: #f8f9fa;
    border: none;
    padding: 15px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.accordion-custom .accordion-button:hover {
    background: #e9ecef;
}

.accordion-custom .accordion-button:not(.collapsed) {
    background: var(--primary-color);
    color: white;
}

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

/* Enhanced spinners */
.spinner-custom {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced file input */
.file-input-custom {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.file-input-custom input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-custom .file-input-label {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.file-input-custom:hover .file-input-label {
    background: var(--secondary-color);
}

/* Enhanced range inputs */
.range-custom {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.range-custom::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.range-custom::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* Enhanced search input */
.search-input-custom {
    position: relative;
}

.search-input-custom .form-control {
    padding-left: 40px;
}

.search-input-custom .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Enhanced timeline */
.timeline-custom {
    position: relative;
    padding: 20px 0;
}

.timeline-custom::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    padding: 20px 0 20px 50px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 30px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Enhanced stats cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.stats-card .stats-icon {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stats-card .stats-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stats-card .stats-label {
    color: #6c757d;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced feature cards */
.feature-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.feature-card .feature-icon {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card .feature-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card .feature-description {
    color: #6c757d;
    line-height: 1.6;
}
