/* Advanced Search Modal Styles */

/* Modal Enhancements */
.modal-content {
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    padding: 1.75rem 2rem;
    border-bottom: none;
}

.modal-header h5 {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.modal-header small {
    display: block;
    font-size: 0.85rem;
    opacity: 0.85;
}

.modal-body {
    background-color: #f8f9fa;
    padding: 2rem;
}

.modal-footer {
    gap: 1rem;
    padding: 1.5rem 2rem;
}

/* Gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-primary-subtle {
    background-color: rgba(102, 126, 234, 0.1);
}

/* Form Styling */
.form-label {
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    margin-bottom: 0.5rem;
}

.form-select,
.form-control {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-select:focus,
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-select-lg,
.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.form-select option {
    padding: 0.75rem;
}

/* Small Text */
.form-label + .form-select ~ small,
.form-label + .form-control ~ small,
.form-label + .position-relative ~ small {
    display: block;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Datalist Styling */
datalist {
    border-radius: 4px;
}

datalist option {
    padding: 8px;
}

/* Custom Checkbox */
.custom-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:hover {
    border-color: #667eea;
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #1a1a1a;
}

/* Material Type Section */
.row.g-3 {
    margin-top: 0;
}

.col-6.col-md-4 {
    padding-top: 0;
    padding-bottom: 0.5rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    letter-spacing: 0.3px;
    font-weight: 600;
}

/* Icon Colors */
.text-primary {
    color: #667eea;
}

.text-success {
    color: #4caf50;
}

.text-warning {
    color: #fbc02d;
}

.text-info {
    color: #00bcd4;
}

.text-danger {
    color: #f5576c;
}

/* Buttons */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #764ba2;
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

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

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-2px);
}

/* Alert Styling */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease-out;
}

.alert-warning {
    background-color: rgba(251, 192, 45, 0.1);
    color: #f57c00;
    border-left: 4px solid #fbc02d;
}

.alert-dismissible .btn-close {
    padding: 0.25rem 0.5rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.fw-500 {
    font-weight: 500;
}

.fw-bold {
    font-weight: 700;
}

.fs-5 {
    font-size: 1.25rem;
}

.fs-4 {
    font-size: 1.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-auto {
    margin-left: auto;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1.5rem;
}

.px-5 {
    padding-left: 3rem;
    padding-right: 3rem;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-header {
        padding: 1.5rem 1.25rem;
    }

    .modal-header h5 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.5rem 1.25rem;
    }

    .modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-select,
    .form-control {
        font-size: 0.9rem;
    }

    .form-select-lg,
    .form-control-lg {
        padding: 0.65rem 0.85rem;
    }

    .row.g-3 {
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .modal-header h5 {
        font-size: 1.1rem;
    }

    .modal-header small {
        font-size: 0.8rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .form-select,
    .form-control {
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.7rem;
    }

    .btn-lg {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }

    .col-6.col-md-4 {
        flex: 0 0 100%;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .form-select,
    .form-control,
    .form-check-input,
    .btn,
    .modal {
        transition: none;
        animation: none;
    }

    .modal.fade .modal-dialog {
        transform: none;
        opacity: 1;
    }

    .btn:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background-color: #1e1e1e;
        color: #f0f0f0;
    }

    .modal-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .modal-body {
        background-color: #2a2a2a;
    }

    .modal-footer {
        background-color: #252525;
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .form-select,
    .form-control {
        background-color: #3a3a3a;
        color: #f0f0f0;
        border-color: rgba(255, 255, 255, 0.2);
    }

    .form-select:focus,
    .form-control:focus {
        background-color: #3a3a3a;
        color: #f0f0f0;
        border-color: #667eea;
    }

    .form-check-label {
        color: #f0f0f0;
    }

    .text-muted {
        color: #b0b0b0;
    }

    .alert-warning {
        background-color: rgba(251, 192, 45, 0.15);
        color: #ffc107;
    }

    .bg-light {
        background-color: #252525 !important;
    }
}

/* Focus Visible for Accessibility */
.form-select:focus-visible,
.form-control:focus-visible,
.btn:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
