/**
 * MAISAutocomplete CSS štýly
 * 
 * Štýly pre m:combo komponent a iné autocomplete funkcionality v MAIS
 */

/* Kontajner komponentu */
.mais-combo-container {
    position: relative;
    display: block;
    width: 100%;
}

/* Dropdown kontajner */
.mais-combo-dropdown {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: auto;
    min-width: 200px;
    max-width: 800px;
}

/* Dropdown položky */
.mais-combo-dropdown .dropdown-item {
    padding: 2px 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mais-combo-dropdown .dropdown-item:hover {
    background-color: #f0f0f0;
}

.mais-combo-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

/* Skryté elementy */
.mais-combo-hidden {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
}

/* Input pole - základné štýly */
.mais-combo-input {
    box-sizing: border-box;
}

/* Kompenzácia pre box-sizing: border-box - pridaj 2px k šírke */
.mais-combo-input.xlarge {
    width: 324px;
}


/* Kompenzácia pre box-sizing: border-box - pridaj 2px k šírke */
.mais-combo-input.xxlarge {
    width: 424px; /* 420px + 2x2px pre border */
}

/* Ak nie je nastavená šírka cez CSS triedu, použij 100% */
.mais-combo-input:not(.xsmall):not(.small):not(.xmedium):not(.medium):not(.large):not(.xlarge):not(.xxlarge):not(.xxxlarge):not(.fullSize):not(.fullness):not(.fullWidth) {
    width: 100%;
}

/* Disabled stav */
.mais-combo-container.disabled .mais-combo-input {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.mais-combo-container.disabled .mais-combo-dropdown {
    display: none !important;
}

/* Focus stav */
.mais-combo-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Loading stav */
.mais-combo-container.loading .mais-combo-input {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwIDMuNUwxMi41IDZMMTUgMy41TDEwIDMuNVoiIGZpbGw9IiM5OTkiLz4KPHBhdGggZD0iTTEwIDE2LjVMMTIuNSAxNEwxNSAxNi41TDEwIDE2LjVaIiBmaWxsPSIjOTk5Ii8+CjxwYXRoIGQ9Ik0zLjUgMTBMMTAgMTYuNUwxNi41IDEwTDEwIDMuNUwzLjUgMTBaIiBmaWxsPSIjOTk5Ii8+Cjwvc3ZnPgo=');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

.mais-combo-dropdown .dropdown-empty {
    padding: 2px 6px;
    color: #999;
    font-style: italic;
    text-align: center;
    font-size: 0.9em;
    min-width: 120px;
    max-width: 200px;
    margin: 0 auto;
}

/* Responsive design */
@media (max-width: 768px) {
    .mais-combo-dropdown {
        max-height: 150px;
    }
    
    .mais-combo-dropdown .dropdown-item {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .mais-combo-dropdown {
        background: #2d2d2d;
        border-color: #555;
        color: #fff;
    }
    
    .mais-combo-dropdown .dropdown-item:hover {
        background-color: #404040;
    }
    
    .mais-combo-dropdown .dropdown-item {
        border-bottom-color: #555;
    }
}