* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.search-section {
    padding: 40px;
    background: #f8f9fa;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.result-section, .error-section, .loading-section {
    padding: 30px;
}

.status-card {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.status-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.status-badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    margin: 10px 0;
}

.tracking-number {
    color: #7f8c8d;
    font-family: monospace;
    font-size: 1.1em;
    margin-top: 10px;
}

.history-section h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: between;
    align-items: center;
}

.history-status {
    font-weight: bold;
    color: #2c3e50;
}

.history-date {
    color: #7f8c8d;
    margin-left: auto;
}

.error-card {
    background: #ffeaea;
    border: 2px solid #e74c3c;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
}

.error-card h3 {
    color: #e74c3c;
    margin-bottom: 10px;
}

.loading-section {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

/* Estados de colores */
.status-RECEIVED { background: #fff3cd; color: #856404; }
.status-IN_TRANSIT { background: #d1ecf1; color: #0c5460; }
.status-ARRIVED { background: #d4edda; color: #155724; }
.status-WAREHOUSED { background: #cce7ff; color: #004085; }
.status-DELIVERED { background: #d1f7c4; color: #0f5132; }

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .search-section {
        padding: 30px 20px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    input[type="text"] {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 12px 15px;
    }
    
    button {
        width: 100%;
        padding: 12px;
    }
    
    .result-section, .error-section, .loading-section {
        padding: 20px;
    }
    
    .status-card {
        padding: 20px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-date {
        margin-left: 0;
        font-size: 0.9em;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        margin: 5px;
        border-radius: 8px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.7em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .search-section {
        padding: 20px 15px;
    }
    
    .status-badge {
        font-size: 1em;
        padding: 8px 16px;
    }
    
    .history-section h4 {
        font-size: 1.1em;
    }
}

/* Asegurar que los inputs sean legibles en mobile */
@media (max-width: 768px) {
    input[type="text"] {
        font-size: 16px; /* Previene zoom en iOS */
        min-height: 44px; /* Tamaño mínimo touch */
    }
    
    button {
        min-height: 44px; /* Tamaño mínimo touch */
    }
}

/* ===== BOTÓN VOLVER ===== */
.back-section {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
}

.back-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #6c757d;
}

.back-btn:hover {
    background: white;
    color: #6c757d;
    transform: translateY(-2px);
}

/* Responsive para el botón */
@media (max-width: 768px) {
    .back-btn {
        width: 90%;
        max-width: 300px;
        text-align: center;
    }
}