/* Glass Card Style */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

select {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5rem;
}

select:focus {
    border-color: var(--primary);
}

select option {
    background: var(--bg-color);
    color: var(--text-main);
}

/* Search Container */
.search-container {
    position: relative;
    margin-top: 1rem;
    width: 100%;
}

.search-container .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-container input {
    padding-left: 2.75rem;
    background: rgba(15, 23, 42, 0.3);
    border-color: var(--glass-border);
}

.search-container input:focus {
    background: rgba(15, 23, 42, 0.6);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(56, 189, 248, 0.1);
}

.btn-icon {
    padding: 0.75rem;
    aspect-ratio: 1;
    width: 42px;
    height: 42px;
}

.btn-icon i {
    font-size: 1.1rem;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-outline.finalize-exchange {
    border-color: var(--success);
    color: var(--success);
}

.btn-outline.finalize-exchange:hover {
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Products Row (Form) */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-row {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 0.6fr auto;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease forwards;
}

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

.product-row:hover {
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
}

.product-row .form-group {
    margin-bottom: 0;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.05);
}

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

.upload-placeholder p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.upload-placeholder-csv i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Components */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .product-row {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        padding-right: 3.5rem; /* Espaço para o botão de excluir na lateral */
    }

    .remove-modal-prod {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        margin: 0 !important;
    }

    .product-row .form-group {
        width: 100% !important;
        flex: none !important;
    }

    /* Garantir que em mobile o EAN e Qtd fiquem lado a lado se possível, ou tudo empilhado */
    .product-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    #modal-supplier-name {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        display: block;
    }

    /* Remove o efeito embaçado do fundo do modal no mobile */
    .modal {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.85) !important;
    }
}

.modal-content {
    width: 100%;
    max-width: 600px;
    transform: translateY(0);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Alerts & Info */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-info {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #bae6fd;
}

.alert i {
    font-size: 1.25rem;
    margin-top: 0.2rem;
}

.alert ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

#csvFileInfo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    color: var(--primary);
    justify-content: center;
}
