/* style.css - Design Mobile First */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 24px;
    animation: slideDown 0.5s ease;
}

header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

.search-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 0.6s ease;
}

.search-card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select:disabled,
.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.results-container {
    margin-top: 24px;
    animation: fadeInUp 0.6s ease;
}

.results-container h2 {
    color: white;
    margin-bottom: 16px;
    font-size: 20px;
}

.peca-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.peca-card:active {
    transform: scale(0.99);
}

.peca-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.peca-header h3 {
    color: #333;
    font-size: 18px;
    flex: 1;
}

.categoria-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.peca-imagem {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
    background: #f5f5f5;
}

.peca-detalhes {
    margin: 12px 0;
}

.descricao {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.posicao, .observacao {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
}

.status {
    margin-top: 8px;
}

.status-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.btn-afiliado {
    display: block;
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 16px;
    transition: transform 0.2s ease;
}

.btn-afiliado:active {
    transform: scale(0.98);
}

.recomendacoes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.recomendacoes h4 {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

.recomendacoes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recomendacao-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
}

.recomendacao-item strong {
    display: block;
    color: #333;
    margin-bottom: 4px;
}

.recomendacao-item small {
    color: #999;
}

.loading, .error-message, .no-results {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 16px;
    color: #666;
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.error-message {
    color: #dc3545;
}

/* Animações */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Touch friendly */
button, select, input, a {
    touch-action: manipulation;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .search-card {
        padding: 20px;
    }
    
    .peca-card {
        padding: 16px;
    }
    
    .peca-header h3 {
        font-size: 16px;
    }
}