/* ===========================
   PÁGINA DE ESTOQUE
   ImaginaTech - Filamentos
   =========================== */

/* ===========================
   GRID DE FILAMENTOS
   =========================== */
.filaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 0;
}

/* ===========================
   CARD DE FILAMENTO
   =========================== */
.filament-card {
    position: relative;
    min-height: 120px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.filament-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.5);
}

.filament-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-blue));
    border-radius: 16px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.filament-card:hover::before {
    opacity: 0.3;
}

/* ===========================
   INDICADOR DE ESTOQUE
   =========================== */
.stock-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 10px currentColor;
}

.stock-indicator.low {
    background: #ff0055;
    animation: pulse-red 1.5s ease-in-out infinite;
}

.stock-indicator.ok {
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px #ff0055, 0 0 20px #ff0055;
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 5px #ff0055;
    }
}

/* ===========================
   BADGE DE SERVIÇOS PENDENTES
   =========================== */
.pending-services-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.95), rgba(255, 215, 0, 0.95));
    backdrop-filter: blur(10px);
    padding: 0.5rem;
    z-index: 100;
    border-bottom: 2px solid var(--neon-orange);
    animation: badgePulse 2s ease-in-out infinite;
}

.pending-services-badge > i {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    display: block;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.badge-content {
    color: #fff;
    text-align: center;
}

.badge-title {
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Orbitron', monospace;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.badge-details {
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    opacity: 0.95;
}

.badge-services {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 60px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.35rem;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    gap: 0.25rem;
    padding: 0.2rem 0.3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.service-code {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: #FFD700;
    flex-shrink: 0;
}

.service-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.service-weight {
    font-weight: 700;
    color: #00FF88;
    flex-shrink: 0;
}

@keyframes badgePulse {
    0%, 100% {
        border-color: var(--neon-orange);
        box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
    }
    50% {
        border-color: var(--neon-yellow);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    }
}

/* ===========================
   IMAGEM DO FILAMENTO
   =========================== */
.filament-image {
    width: 100px;
    height: 100px;
    min-width: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.filament-card:hover .filament-image {
    transform: scale(1.05);
}

/* ===========================
   INFO DO FILAMENTO
   =========================== */
.filament-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    min-width: 0;
}

.filament-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-wrap: break-word;
}

.filament-type {
    font-size: 0.8rem;
    color: var(--neon-blue);
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filament-brand {
    font-size: 0.75rem;
    color: var(--neon-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.2rem 0;
}

.filament-brand i {
    margin-right: 0.3rem;
}

.filament-color {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.filament-weight {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-green);
    font-family: 'Orbitron', monospace;
    margin-top: 0.25rem;
    white-space: nowrap;
}

.filament-weight.low {
    color: var(--neon-red);
}

/* ===========================
   AÇÕES DO CARD (Removidas - Card é totalmente clicável)
   =========================== */

/* ===========================
   FILTROS
   =========================== */
.filters-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--neon-blue);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* ===========================
   UPLOAD DE IMAGEM
   =========================== */
.image-upload-area {
    width: 100%;
    min-height: 140px;
    max-height: 140px;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.image-upload-area:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 212, 255, 0.05);
}

.upload-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.upload-placeholder i {
    font-size: 2rem;
    color: var(--neon-blue);
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.upload-placeholder small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.image-preview-img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
}

/* Ajustes específicos para o modal de filamento */
#filamentModal .modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

#filamentModal .modal-body {
    padding: 1rem;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

#filamentModal .form-group {
    margin-bottom: 0.75rem;
}

#filamentModal .form-row {
    gap: 0.75rem;
    display: flex;
    flex-wrap: wrap;
}

#filamentModal .form-row > .form-group {
    flex: 1;
    min-width: 150px;
}

#filamentModal .form-textarea {
    min-height: 60px;
}

/* ===========================
   PRINT PREVIEW
   =========================== */
.print-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
}

.print-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    text-align: center;
}

.print-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.print-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2A6EA7;
    margin-bottom: 0.25rem;
}

.print-item-color {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.print-item-weight {
    font-size: 0.8rem;
    font-weight: 600;
    color: #28a745;
}

.print-info {
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.print-info p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.print-info strong {
    color: var(--neon-blue);
}

/* ===========================
   MODAL LARGE
   =========================== */
.modal-large .modal-content {
    max-width: 1000px;
}

/* ===========================
   RESPONSIVIDADE
   =========================== */
@media (max-width: 768px) {
    .filaments-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filament-card {
        min-height: 100px;
        padding: 0.75rem;
    }

    .filament-image {
        width: 80px;
        height: 80px;
        min-width: 80px;
    }

    .filament-name {
        font-size: 0.9rem;
    }

    .filament-type {
        font-size: 0.75rem;
    }

    .filament-weight {
        font-size: 1.1rem;
    }

    .filters-bar {
        flex-direction: column;
    }

    .print-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    /* Melhorias para formulários mobile */
    #filamentModal .form-row {
        flex-direction: column;
    }

    #filamentModal .form-row > .form-group {
        flex: 1 1 100%;
        min-width: 100%;
    }

    #filamentModal .form-select,
    #filamentModal .form-input,
    #filamentModal .form-textarea {
        font-size: 16px;
        min-height: 44px;
    }

    /* Melhorar custom select em tablet */
    #filamentModal .custom-select {
        position: relative;
        z-index: 10;
        width: 100%;
    }

    #filamentModal .custom-select.open {
        z-index: 100;
    }

    #filamentModal .custom-select-trigger {
        min-height: 44px;
        width: 100%;
        box-sizing: border-box;
    }

    #filamentModal .custom-select-dropdown {
        position: fixed !important;
        z-index: 99999 !important;
        width: 85% !important;
        left: 7.5% !important;
        right: auto !important;
        max-height: 300px !important;
    }

    #filamentModal .custom-select.open .custom-select-dropdown {
        z-index: 100001 !important;
    }

    #filamentModal .modal-body {
        max-height: none !important;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .filaments-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .filament-card {
        min-height: 90px;
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .filament-image {
        width: 70px;
        height: 70px;
        min-width: 70px;
    }

    .filament-name {
        font-size: 0.85rem;
    }

    .filament-type {
        font-size: 0.7rem;
    }

    .filament-weight {
        font-size: 1rem;
    }

    .stock-indicator {
        width: 10px;
        height: 10px;
        top: 8px;
        right: 8px;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons button {
        width: 100%;
    }

    /* Modal responsivo em mobile */
    .modal {
        padding: 0.25rem !important;
    }

    .modal-content {
        max-width: 100% !important;
        max-height: 100vh !important;
        height: 100vh !important;
        width: calc(100% - 0.5rem) !important;
        margin: 0 !important;
    }

    #filamentModal {
        padding: 0.25rem !important;
    }

    #filamentModal .modal-content {
        max-height: 100vh !important;
        height: 100vh !important;
        width: 100%;
    }

    #filamentModal form {
        height: 100%;
    }

    #filamentModal .modal-header {
        padding: 1rem 0.75rem;
        flex-shrink: 0;
    }

    #filamentModal .modal-body {
        padding: 0.75rem !important;
        flex: 1;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        width: 100%;
    }

    #filamentModal .modal-footer {
        padding: 0.75rem;
        flex-shrink: 0;
    }

    /* Formulários extra compactos para mobile */
    #filamentModal .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    #filamentModal .form-group {
        margin-bottom: 0.5rem;
        width: 100%;
    }

    #filamentModal .form-select,
    #filamentModal .form-input,
    #filamentModal .form-textarea {
        font-size: 16px;
        min-height: 48px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Custom select mobile */
    #filamentModal .custom-select {
        position: relative !important;
        width: 100%;
    }

    #filamentModal .custom-select-trigger {
        min-height: 48px;
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        width: 100%;
        box-sizing: border-box;
    }

    #filamentModal .custom-select-dropdown {
        position: fixed !important;
        max-height: 50vh !important;
        width: calc(100% - 1.5rem) !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        z-index: 99999 !important;
    }

    #filamentModal .custom-select.open .custom-select-dropdown {
        z-index: 100001 !important;
    }

    #filamentModal .custom-select-option {
        min-height: 48px;
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    #filamentModal .image-upload-area {
        min-height: 100px;
        max-height: 100px;
    }
}

/* ===========================
   ANIMAÇÕES ADICIONAIS
   =========================== */
@keyframes card-entrance {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filament-card {
    animation: card-entrance 0.4s ease-out;
}

/* ===========================
   ESTADOS ESPECIAIS
   =========================== */
.filament-card.out-of-stock {
    opacity: 0.6;
    filter: grayscale(50%);
}

.filament-card.out-of-stock::after {
    content: 'SEM ESTOQUE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: var(--neon-red);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.6);
}

/* ===========================
   MODAL DE AÇÕES DO CARD
   =========================== */
.modal-small .modal-content {
    max-width: 500px;
    max-height: fit-content;
    overflow: visible;
}

.card-info-summary {
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}

.card-info-summary h3 {
    color: var(--neon-blue);
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.card-info-summary p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.2rem 0;
}

.action-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.action-option-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.action-option-btn i {
    font-size: 1.3rem;
    color: var(--neon-blue);
    margin-bottom: 0.3rem;
}

.action-option-btn span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.2rem;
}

.action-option-btn small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.action-option-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(42, 110, 167, 0.1));
    border-color: var(--neon-blue);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.2);
}

.action-option-btn.delete-option {
    border-color: rgba(255, 0, 85, 0.3);
}

.action-option-btn.delete-option i {
    color: var(--neon-red);
}

.action-option-btn.delete-option:hover {
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.1), rgba(255, 0, 85, 0.05));
    border-color: var(--neon-red);
}

/* ===========================
   DROPDOWN CUSTOMIZADO (JavaScript)
   =========================== */

.custom-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.custom-select.open {
    z-index: 99999;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(16, 24, 39, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    user-select: none;
}

.custom-select-trigger:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--neon-blue);
    box-shadow:
        0 0 25px rgba(0, 212, 255, 0.4),
        0 0 50px rgba(0, 212, 255, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(26, 26, 46, 1) 0%, rgba(16, 24, 39, 1) 100%);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-value {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-value.placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.custom-select-arrow {
    width: 12px;
    height: 12px;
    margin-left: 0.5rem;
    color: var(--neon-blue);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s;
    flex-shrink: 0;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
    color: #00ff88;
}

/* Lista de opções (dropdown) */
.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(16, 24, 39, 0.98) 0%, rgba(26, 26, 46, 0.98) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid var(--neon-blue);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.custom-select.open .custom-select-dropdown {
    max-height: 300px;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    z-index: 99999;
}

/* Scrollbar customizada para dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 0;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-blue), var(--neon-purple));
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ff88, var(--neon-blue));
}

/* Opções individuais */
.custom-select-option {
    padding: 0.75rem 1rem;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.custom-select-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), transparent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-option:hover::before {
    width: 100%;
}

.custom-select-option:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--neon-blue);
    border-left-color: var(--neon-blue);
    padding-left: 1.25rem;
}

.custom-select-option.selected {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.25), rgba(42, 110, 167, 0.15));
    color: #ffffff;
    font-weight: 600;
    border-left-color: #00ff88;
    box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.2);
}

.custom-select-option.selected::after {
    content: '✓';
    margin-left: auto;
    color: #00ff88;
    font-weight: bold;
    font-size: 1.1em;
    animation: checkmark-appear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkmark-appear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.custom-select-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    font-style: italic;
}

/* Animação de entrada das opções */
.custom-select.open .custom-select-option {
    animation: option-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.custom-select.open .custom-select-option:nth-child(1) { animation-delay: 0.03s; }
.custom-select.open .custom-select-option:nth-child(2) { animation-delay: 0.06s; }
.custom-select.open .custom-select-option:nth-child(3) { animation-delay: 0.09s; }
.custom-select.open .custom-select-option:nth-child(4) { animation-delay: 0.12s; }
.custom-select.open .custom-select-option:nth-child(5) { animation-delay: 0.15s; }

@keyframes option-slide-in {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsividade e melhorias para touch/mobile */
.custom-select-trigger,
.custom-select-option {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* Estado de toque para mobile */
.custom-select-option.touch-active {
    background: rgba(0, 212, 255, 0.25);
    color: var(--neon-blue);
    border-left-color: var(--neon-blue);
}

@media (max-width: 768px) {
    #filamentModal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    #filamentModal .modal-body {
        max-height: calc(95vh - 180px);
    }

    /* Melhorias para formulários mobile */
    #filamentModal .form-row {
        flex-direction: column;
    }

    #filamentModal .form-row > .form-group {
        flex: 1 1 100%;
        min-width: 100%;
    }

    #filamentModal .form-select,
    #filamentModal .form-input,
    #filamentModal .form-textarea {
        font-size: 16px;
        min-height: 44px;
    }

    .custom-select {
        position: relative;
    }

    .custom-select.open {
        z-index: 99999;
    }

    .custom-select-trigger {
        min-height: 48px;
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }

    .custom-select-dropdown {
        position: absolute;
        max-height: 250px;
        -webkit-overflow-scrolling: touch;
        z-index: 1;
        width: 100%;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }

    .custom-select.open .custom-select-dropdown {
        max-height: 280px;
        z-index: 99999;
    }

    .custom-select-option {
        min-height: 48px;
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .custom-select-dropdown::-webkit-scrollbar {
        width: 12px;
    }
}

@media (max-width: 480px) {
    /* Modal em mobile */
    #filamentModal {
        padding: 0.5rem !important;
    }

    #filamentModal .modal-content {
        max-width: 100%;
        max-height: calc(100vh - 1rem);
    }

    #filamentModal .modal-body {
        max-height: calc(100vh - 180px - 1rem);
    }

    /* Formulários em mobile */
    #filamentModal .form-select,
    #filamentModal .form-input,
    #filamentModal .form-textarea {
        font-size: 16px;
        min-height: 48px;
        width: 100%;
        box-sizing: border-box;
    }

    .custom-select {
        position: relative;
    }

    .custom-select.open {
        z-index: 99999;
    }

    .custom-select-trigger {
        padding: 1rem;
        font-size: 0.9rem;
        min-height: 48px;
        width: 100%;
        box-sizing: border-box;
    }

    .custom-select-option {
        padding: 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .custom-select-dropdown {
        position: absolute;
        z-index: 1;
        width: 100%;
        box-sizing: border-box;
        left: 0;
        right: 0;
        max-height: 240px;
        -webkit-overflow-scrolling: touch;
    }

    .custom-select.open .custom-select-dropdown {
        max-height: 260px;
        z-index: 99999;
    }

    .custom-select-option:hover {
        padding-left: 1rem;
    }

    .custom-select-option.touch-active {
        background: rgba(0, 212, 255, 0.25);
    }
}
