* {
    font-family: "Be Vietnam Pro", sans-serif;
    font-size: 1rem;
}

html {
    font-size: 16px;
}

@media (max-width: 600px) {
    html {
        font-size: 14px;
    }
    body {
        padding: 0;
    }
    .container, .main-content, .content-wrapper {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

.starry-background {
    background-image:url('../images/noisebg.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
}

.ql-container {
    font-family: "Be Vietnam Pro", sans-serif !important;
    font-size: 0.875;
}

.ql-container.ql-snow {
    border: none;
}

.ql-editor.ql-blank::before {
    color: #8E939C;
    font-style: normal;
    font-size: 0.875 !important;
}

.ql-toolbar.ql-snow {
    border-color: #EBEDF0 !important;
    padding-block: 0.825rem !important;
}

select option {
    padding-block: 8px;
    background-color: white;
    border: 1px #EEEFF2;
    color: #8E939C;
}

select option:hover {
    background-color: #F8FCFF;
    border: 2px #407BFF;
}

select option:checked {
    background-color: #E6F2FF;
    border: 2px #407BFF;
}

/* ===================================================================
   AUTOCOMPLETE STYLES
   Matching the UI design with button trigger and dropdown
   =================================================================== */

/* Smooth scrolling for highlighted items */
.autocomplete-results {
    scroll-behavior: smooth;
}

/* Custom scrollbar for dropdown list */
.autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-track {
    background: #F9FAFB;
    border-radius: 10px;
}

.autocomplete-results::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}

.autocomplete-results::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Highlighted item transition */
.highlighted-item {
    transition: all 0.15s ease;
}

/* Select button states */
.select-button {
    transition: all 0.2s ease;
}

.select-button:hover {
    border-color: #D1D5DB;
    background-color: #F9FAFB;
}

.select-button:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Dropdown animation improvements */
[x-cloak] {
    display: none !important;
}

/* Loading state for button */
.select-button.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Empty state styling */
.no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.no-results-state svg {
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* Search input focus ring */
.search-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Chip/Tag styles for added items */
.repeater-chip {
    animation: slideIn 0.2s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove button hover effect */
.chip-remove-btn {
    transition: all 0.2s ease;
}

.chip-remove-btn:hover {
    background-color: #FEE2E2;
}

.chip-remove-btn:hover i {
    color: #DC2626;
}

/* Add button states */
.add-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.add-button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dropdown shadow enhancement */
.dropdown-panel {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Selected item indicator */
.selected-indicator {
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .autocomplete-results {
        max-height: 50vh;
    }

    .dropdown-panel {
        position: fixed;
        left: 1rem;
        right: 1rem;
        width: auto;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .select-button {
        background-color: #1F2937;
        border-color: #374151;
        color: #F9FAFB;
    }

    .dropdown-panel {
        background-color: #1F2937;
        border-color: #374151;
    }

    .search-input {
        background-color: #111827;
        border-color: #374151;
        color: #F9FAFB;
    }

    .highlighted-item.bg-\[#F0F9FF\] {
        background-color: #1E3A8A;
    }
}

/* Focus visible for accessibility */
.select-button:focus-visible,
.search-input:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Rotate animation for dropdown arrow */
.rotate-180 {
    transform: rotate(180deg);
}

/* Transition for all interactive elements */
button,
input,
select {
    transition: all 0.2s ease;
}

/* Error state for select button */
.select-button.error {
    border-color: #DC2626;
}

.select-button.error:focus {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.5);
}