.form-group {
    display: flex;
    flex-direction: column;
}

.filter-item label,
.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
}

.form-control, .form-select, .form-check {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    transition: all 0.3s ease;
    color: var(--text);
    height: 44px;
    margin-bottom: 10px;
}

.form-control.has-prefix {
    padding-left: 40px;
}

.input-prefix {
    position: absolute;
    left: 10px;
    top: 13px;
    color: var(--text);
    font-size: 14px;
}

.form-control::placeholder {
    color: #FFFFFF55;
}

.form-control option {
    height: 100px;
    border-radius: 50px;
    color: var(--text);
}

/* label + .form-control {
    padding-top: 15px;
} */

.form-control:hover {
    border: 1px solid var(--border-color-focus);
}

.form-control:focus {
    outline: none;
    border: 1px solid var(--border-color-focus);
    box-shadow: 0 0 0 5px var(--shadow-color-focus);
    background-color: var(--input-bg-focus);
}

.form-control[readonly] {
    background-color: var(--input-bg-focus);
    border: none;
    box-shadow: none;
    opacity: .5;
}


.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #5597ff;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    width: 100%;
    flex: 1;
    min-width: 200px;
}

/* Checkbox e Radio */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check-input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--theme-color);
}

.form-check-label {
    font-size: 14px;
}

/* Select */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 4.5L9 1' stroke='black' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

html[data-color-scheme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 4.5L9 1' stroke='white' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Select Múltiplo */
select[multiple].form-control {
    min-height: 120px;
    padding: 10px;
    background-image: none;
    padding-right: 15px;
    resize: vertical;
    overflow-y: auto;
    line-height: 1.4;
}

select[multiple].form-control option {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 4px;
    background-color: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

select[multiple].form-control option:checked {
    background-color: var(--main);
    color: white;
    font-weight: 500;
    border-color: var(--main);
}

select[multiple].form-control option:hover {
    background-color: var(--border-color);
    border-color: var(--main);
}

select[multiple].form-control option:checked:hover {
    background-color: var(--second);
    border-color: var(--second);
}

select[multiple].form-control:focus {
    outline: none;
    border-color: var(--border-color-focus);
    box-shadow: 0 0 0 3px var(--shadow-color-focus);
}

/* Estilos responsivos para selects múltiplos */
@media (max-width: 768px) {
    select[multiple].form-control {
        min-height: 100px;
        padding: 8px;
        font-size: 16px; /* Previne zoom no iOS */
    }
    
    select[multiple].form-control option {
        padding: 10px 12px;
        font-size: 15px;
        margin: 1px 0;
    }
}

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.icon-aff{
    color: var(--icon-aff);
}

.icon-anun{
    color: var(--icon-anun);
}

/* Mobile Responsive Forms */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        height: 48px;
        margin-bottom: 8px;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-col {
        min-width: 100%;
        margin-bottom: 15px;
    }
    
    select.form-control {
        background-position: right 12px center;
        padding-right: 35px;
    }
    
    textarea.form-control {
        min-height: 80px;
        resize: none;
    }
    
    .form-check {
        margin-bottom: 15px;
        padding: 10px;
        background: var(--card-bg);
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    
    .form-check-input {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }
    
    .form-check-label {
        font-size: 15px;
        line-height: 1.4;
    }
    
    .form-text {
        font-size: 11px;
        margin-top: 8px;
    }
}

/* Validação */
.is-valid {
    border-color: #28a745;
    
}

.is-invalid {
    border-color: #dc3545;
}

.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(75, 192, 85, 0.281);
}

.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(192, 75, 75, 0.233);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: -5px;
    font-size: 12px;
    color: #dc3545;
}

/* Form actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    flex: 20%;
}

.form-group {
    display: flex;
    width: 100%;
    align-items: first baseline;
    padding: 5px 0;
}
.form-group {
    width: 100%;
}

/* Input groups */
.input-group {
    display: flex;
    position: relative;
    align-items: center;
    gap: 0;
}

.input-group .form-control {
    flex: 1;
    border-radius: 8px;
    margin-bottom: 0;
    background-color: var(--input-bg);
}

.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.input-group-prepend {
    display: inline-flex;
    align-items: center;
}

.input-group-prepend .input-group-text {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-prepend + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.input-group-append .input-group-text {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-append {
    display: inline-flex;
    align-items: center;
}

.form-control + .input-group-append {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    display: flex;
    border-right: none;
}

.input-group .input-group-text .material-symbols-rounded {
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 768px) {
    .input-group-text {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
    }
}

/* Botões dentro do input-group devem igualar a altura do input */
.input-group .btn,
.input-group .btn-outline {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 15px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .input-group .btn,
    .input-group .btn-outline {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
    }
}

/* Select com filtro */
.select-wrapper {
    position: relative;
    width: 100%;
    font-family: sans-serif;
}

/* Estilo para select-wrapper desabilitado */
.select-wrapper.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.select-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
    font-size: 14px;
    height: 44px;
    /* border: 1px solid #EEE; */
    border: 1px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    background-color: var(--input-bg);
    transition: all 0.2s ease;
    display: flex;
}

/* Cursor para select-field dentro de um select-wrapper desabilitado */
.select-wrapper.disabled .select-field {
    cursor: not-allowed;
}

.select-field.active {
    border-radius: 10px 10px 0 0;
    border: 1px solid #3593ff;
    /* border-bottom: #FFF solid 1px; */
}

.select-field .selected-value {
    /* color: #302d2b; */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-field .selected-value span {
    display: inline-block;
    border-radius: 5px;
    background: #ddd4d2;
    color: #302d2b;
    padding: 0 5px;
}

.clear-selection {
    position: absolute;
    right: 30px;
    padding: 5px;
}

.clear-selection:hover {
    font-weight: 900;
}


.multiple-options-list .selected-value span.remove-tag {
    display: block;
    border-radius: 5px;
    background: #b1a8a6;
    color: #ffffff;
    padding: 0 5px;
}

.multiple-options-list .select-field {
    display: flex;
    background: #F00 !important;
    gap: 3px;
}

.arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text);
}

.options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: none;
    border-radius: 0 0 10px 10px;
    background-color: var(--input-bg);
    padding-bottom: 0;
    z-index: 999;
    max-height: 0;
    transition: ease-in-out 0.2s;
    overflow: hidden;
}

.options.open, .options.active {
    padding-bottom: 10px;
    max-height: 500px;
    border: 1px solid #3593ff;
    border-top: none;
    backdrop-filter: blur(20px);
    /* display: block !important; */
}

.filter-input {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 0;
    outline: none;
    box-sizing: border-box;
    background: #3593ff;
    color: #FFF;
}

.input-fields{
    display: block;
    margin-top: 15px;
    width: 100%
}

.copy-notification {
    display: block;
    position: absolute;
    top: -35px;
    left: -20px;
    background-color: #28a745;
    color: #FFF;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 12px;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s ease;
    z-index: 1000;
    pointer-events: none;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0px);
}

.copy-tooltip {
    position: absolute;
    top: 10px;
    right: 10px;
}


/* Collapsible styles */
.collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapse-content.show {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
    overflow: visible;
}

.card-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}



.collapse-icon {
    transition: transform 0.3s ease;
}

.collapse-icon.rotated {
    transform: rotate(180deg);
}

.card-header .d-flex {
    width: 100%;
}


.filter-input::placeholder {
    color: #0952a4;
}

.options-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.options-list::-webkit-scrollbar {
    width: 4px;
}

.options-list li {
    padding: 10px;
    font-size: 14px;
    display: flex;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--border-color);
    /* color: #302d2b; */
}

.options-list li:hover {
    background-color: #00000022;
}

.options-list li.selected {
    background-color: #e0e0e0;
    font-weight: bold;
}

.multiple-select-wrapper .options-list {
    max-height: 200px;
    overflow-y: auto;
}

.multiple-options-list li {
    display: flex;
    align-items: center;
    padding: 0;
    padding-left: 10px;
}

.multiple-options-list li label {
    margin-left: 8px;
    margin-bottom: 0;
    cursor: pointer;
    width: 100%;
    display: block;
    padding: 5px 10px;
}

.multiple-option-checkbox {
    cursor: pointer;
}

/* Checkbox estilizado com fundo azul */
.creative-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 25px;
    height: 25px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: all 0s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    outline: none;
}

.creative-checkbox:checked {
    background-color: var(--border-color-focus);
    border-color: var(--border-color-focus);
    animation: bounceCheck 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.creative-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.creative-inactive {
    opacity: 0.4;
    filter: grayscale(1);
}

.creative-inactive input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.creative-inactive .btn:disabled {
    cursor: not-allowed;
}


@keyframes bounceCheck {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.creative-checkbox:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
}

.creative-checkbox:hover:checked {
    background-color: #0056b3;
    border-color: #0056b3;
}

.creative-checkbox:not(:checked) {
    animation: bounceUncheck 0.4s ease-out;
}

@keyframes bounceUncheck {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

.creative-checkbox:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
