/* ===== IMPORTAÇÃO DA FONTE POPPINS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===== VARIÁVEIS CSS ===== */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    
    /* Cores adicionais para melhor UX */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET E CONFIGURAÇÕES BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: var(--light-color);
    overflow-x: hidden;
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ESTILIZADO ===== */
header {
    background: var(--bg-gradient);
    color: white;
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

header .container {
    position: relative;
    z-index: 2;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

header h1 i {
    color: var(--warning-color);
    margin-right: 15px;
    animation: bounce 2s infinite;
}

header p {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 80px 0;
    min-height: calc(100vh - 200px);
}

/* ===== SEÇÕES ===== */
section {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

section:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

section h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

/* ===== FORMULÁRIO ESTILIZADO ===== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background: #fafbfc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #8895a7;
    font-weight: 400;
}

/* ===== BOTÕES ESTILIZADOS ===== */
button {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

#track-button {
    background: var(--secondary-color);
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    width: 100%;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

#track-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

#track-button:active {
    transform: translateY(0);
}

.ai-button {
    background: var(--success-color);
    color: white;
    padding: 12px 24px;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.ai-button:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.secondary-button {
    background: var(--light-color);
    color: var(--primary-color);
    border: 2px solid #ddd;
    padding: 12px 24px;
    font-size: 0.95rem;
}

.secondary-button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== HEADER DO PEDIDO ===== */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.order-header h2 {
    margin-bottom: 0;
    flex: 1;
}

#order-status {
    color: var(--success-color);
    font-weight: 600;
    padding: 5px 12px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 20px;
    font-size: 0.9em;
}

/* ===== TIMELINE ESTILIZADA ===== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--secondary-color), var(--success-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 20px 0 20px 80px;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 25px;
    width: 15px;
    height: 15px;
    background: var(--secondary-color);
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 3px var(--secondary-color);
    z-index: 2;
}

.timeline-item.completed::before {
    background: var(--success-color);
    box-shadow: 0 0 0 3px var(--success-color);
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--secondary-color);
}

.timeline-content h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.timeline-content p {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.timeline-content .date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== ANÁLISE IA ===== */
#ai-analysis {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 30px;
    border-left: 5px solid var(--success-color);
}

#ai-analysis h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#ai-analysis h3 i {
    color: var(--success-color);
    margin-right: 10px;
}

#ai-analysis-text {
    color: #555;
    line-height: 1.6;
    font-size: 1rem;
}

/* ===== MODAL ESTILIZADO ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
}

.close-button:hover {
    color: var(--danger-color);
    transform: scale(1.1);
}

.modal h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal h2 i {
    color: var(--success-color);
    margin-right: 10px;
}

.modal p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.modal form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.modal input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}

.modal input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal button {
    padding: 12px 20px;
    background: var(--secondary-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.modal button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

#ai-answer {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--success-color);
}

#ai-answer h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* ===== MENSAGEM DE ERRO ===== */
#error-message {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--danger-color);
    margin-top: 20px;
    font-weight: 500;
}

/* ===== FOOTER ===== */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== CLASSES UTILITÁRIAS ===== */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== HOVER EFFECTS AVANÇADOS ===== */
.form-group input:hover,
.form-group select:hover {
    border-color: #c8d6e5;
    background: white;
}

button i {
    margin-right: 8px;
    transition: var(--transition);
}

button:hover i {
    transform: translateX(2px);
}

/* ===== SCROLL SUAVE ===== */
html {
    scroll-behavior: smooth;
}

/* ===== MEDIA QUERIES MOBILE - RESPONSIVO PERFEITO ===== */

/* ===== TABLET LANDSCAPE (1024px e abaixo) ===== */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    section {
        padding: 30px 25px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .order-header h2 {
        font-size: 1.6rem;
    }
}

/* ===== TABLET PORTRAIT (768px e abaixo) ===== */
@media screen and (max-width: 768px) {
    header {
        padding: 40px 0;
    }
    
    header h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    header p {
        font-size: 1.1rem;
        padding: 0 10px;
    }
    
    main {
        padding: 40px 0;
    }
    
    section {
        padding: 25px 20px;
        margin-bottom: 20px;
    }
    
    section h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    #track-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline-item::before {
        left: 12px;
        width: 12px;
        height: 12px;
    }
    
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .modal form {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal button {
        width: 100%;
        padding: 12px;
    }
}

/* ===== MOBILE LARGE (480px e abaixo) ===== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    header {
        padding: 30px 0;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    header h1 i {
        margin-right: 8px;
        font-size: 0.9em;
    }
    
    header p {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    main {
        padding: 30px 0;
    }
    
    section {
        padding: 20px 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    section h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    section h2::after {
        width: 40px;
        height: 3px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    #track-button {
        padding: 10px 20px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .ai-button {
        padding: 8px 16px;
        font-size: 0.85rem;
        width: 100%;
        margin-top: 10px;
    }
    
    .secondary-button {
        padding: 8px 16px;
        font-size: 0.85rem;
        width: 100%;
        margin-top: 15px;
    }
    
    .order-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .order-header h2 {
        font-size: 1.2rem;
        text-align: left;
        width: 100%;
    }
    
    #order-status {
        font-size: 0.8em;
        padding: 4px 10px;
        display: inline-block;
        margin-top: 8px;
    }
    
    .timeline {
        padding: 15px 0;
    }
    
    .timeline::before {
        left: 12px;
        width: 2px;
    }
    
    .timeline-item {
        padding: 15px 0 15px 40px;
        margin-bottom: 15px;
    }
    
    .timeline-item::before {
        left: 6px;
        top: 20px;
        width: 10px;
        height: 10px;
        border-width: 3px;
    }
    
    .timeline-content {
        padding: 15px 12px;
        border-radius: 8px;
        border-left-width: 3px;
    }
    
    .timeline-content h4 {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .timeline-content .date {
        font-size: 0.8rem;
    }
    
    #ai-analysis {
        padding: 20px 15px;
        border-radius: 8px;
        margin-top: 20px;
    }
    
    #ai-analysis h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    #ai-analysis h3 i {
        margin-right: 8px;
    }
    
    #ai-analysis-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 25px 15px;
        margin: 10px;
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .modal h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .modal p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .modal input {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .modal button {
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    #ai-answer {
        padding: 15px 12px;
        border-radius: 8px;
    }
    
    #ai-answer h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    #error-message {
        padding: 12px 15px;
        border-radius: 8px;
        font-size: 0.9rem;
        margin-top: 15px;
    }
    
    footer {
        padding: 25px 0;
        margin-top: 30px;
    }
    
    footer p {
        font-size: 0.8rem;
        line-height: 1.4;
        padding: 0 10px;
    }
}

/* ===== MOBILE SMALL (360px e abaixo) ===== */
@media screen and (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    header {
        padding: 25px 0;
    }
    
    header h1 {
        font-size: 1.6rem;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    section {
        padding: 15px 12px;
        border-radius: 6px;
    }
    
    section h2 {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .form-group input,
    .form-group select {
        padding: 9px 10px;
        font-size: 0.85rem;
    }
    
    #track-button {
        padding: 9px 15px;
        font-size: 0.9rem;
    }
    
    .timeline-content {
        padding: 12px 10px;
    }
    
    .timeline-content h4 {
        font-size: 0.95rem;
    }
    
    .timeline-content p {
        font-size: 0.85rem;
    }
    
    .modal-content {
        padding: 20px 12px;
        margin: 5px;
    }
    
    .modal h2 {
        font-size: 1.2rem;
    }
    
    .close-button {
        top: 10px;
        right: 15px;
        font-size: 1.3rem;
    }
}

/* ===== LANDSCAPE MOBILE (altura máxima 500px) ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    header {
        padding: 20px 0;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    main {
        padding: 20px 0;
    }
    
    section {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
        padding: 20px;
    }
    
    .timeline-item {
        padding: 10px 0 10px 40px;
        margin-bottom: 10px;
    }
    
    footer {
        padding: 15px 0;
        margin-top: 20px;
    }
}

/* ===== AJUSTES PARA TELAS MUITO PEQUENAS ===== */
@media screen and (max-width: 320px) {
    header h1 {
        font-size: 1.4rem;
    }
    
    section {
        padding: 12px 8px;
    }
    
    .form-group input,
    .form-group select {
        padding: 8px 8px;
        font-size: 0.8rem;
    }
    
    #track-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}