﻿/* Main wrapper */
.mudX-wrapper {
    position: relative;
    width: 100%;
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.00938em;
}

/* Main select box */
.mudX {
    position: relative;
    height: 44px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 40px 6px 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

    .mudX:hover {
        border-color: #9ca3af;
    }

    .mudX:focus {
        outline: none;
        border-color: #5b6ef5;
        box-shadow: 0 0 0 2px rgba(91, 110, 245, 0.2);
    }

/* Input display area */
.mudX-input {
    font-size: 15px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1f2937;
}

/* Label styling */
.mudX label {
    position: absolute;
    left: 14px;
    top: 12px;
    font-size: 15px;
    background: #fff;
    padding: 0 6px;
    color: #6b7280;
    transition: 0.2s ease all;
    pointer-events: none;
    z-index: 1;
}

    .mudX label.float {
        top: -9px;
        font-size: 12px;
        color: #5b6ef5;
        font-weight: 500;
    }

/* Arrow indicator */
.mudX-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: translateY(-50%) rotate(45deg);
    transition: 0.2s ease;
}

    .mudX-arrow.open {
        transform: translateY(-50%) rotate(-135deg);
        border-color: #5b6ef5;
    }

/* Overlay for closing dropdown */
.mudX-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: transparent;
}

/* Dropdown panel */
.mudX-panel {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 260px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 999;
    border: 1px solid #e5e7eb;
}

/* Search box */
.mudX-search {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    outline: none;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

    .mudX-search:focus {
        border-bottom-color: #5b6ef5;
        box-shadow: 0 1px 0 0 #5b6ef5;
    }

    .mudX-search::placeholder {
        color: #9ca3af;
        font-size: 14px;
    }

/* Items container */
.mudX-items-container {
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}

/* Individual items */
.mudX-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .mudX-item:hover {
        background: #f3f4f6;
    }

    .mudX-item.active {
        background: #f3f4f6;
    }

    .mudX-item.selected {
        background: #e8ebff;
        color: #1f2937;
        font-weight: 500;
    }

        .mudX-item.selected:hover {
            background: #dde0ff;
        }

    /* Hide hidden items */
    .mudX-item.hidden {
        display: none;
    }

/* Scrollbar styling */
.mudX-items-container::-webkit-scrollbar {
    width: 8px;
}

.mudX-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mudX-items-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    .mudX-items-container::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }

/* Disabled state */
.mudX.disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.7;
}

    .mudX.disabled .mudX-arrow {
        border-color: #9ca3af;
    }

/* Error state */
.mudX.error {
    border-color: #ef4444;
}

    .mudX.error label.float {
        color: #ef4444;
    }

/* Success state */
.mudX.success {
    border-color: #10b981;
}

    .mudX.success label.float {
        color: #10b981;
    }

/* RTL support */
.mudX.rtl {
    padding: 12px 14px 6px 40px;
}

    .mudX.rtl .mudX-arrow {
        left: 16px;
        right: auto;
    }

    .mudX.rtl label {
        left: auto;
        right: 14px;
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .mudX-panel {
        top: 44px;
        max-height: 220px;
    }

    .mudX-item {
        padding: 12px 16px;
    }
}

/* Animation for dropdown */
@keyframes mudX-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mudX-panel {
    animation: mudX-slideDown 0.2s ease;
}

/* Compact mode */
.mudX.compact {
    height: 38px;
    padding: 8px 36px 4px 12px;
}

    .mudX.compact .mudX-input {
        font-size: 14px;
    }

    .mudX.compact label {
        top: 9px;
        font-size: 14px;
    }

        .mudX.compact label.float {
            top: -10px;
            font-size: 11px;
        }

/* Dense mode for items */
.mudX-item.dense {
    padding: 6px 16px;
    font-size: 13px;
}

/* Group headers */
.mudX-group-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Divider between items */
.mudX-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* No results message */
.mudX-no-results {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
}

/* Loading indicator */
.mudX-loading {
    padding: 16px;
    text-align: center;
    color: #6b7280;
}

    .mudX-loading::after {
        content: "...";
        animation: mudX-dots 1.5s steps(4, end) infinite;
    }

@keyframes mudX-dots {
    0%, 20% {
        content: ".";
    }

    40% {
        content: "..";
    }

    60%, 100% {
        content: "...";
    }
}
