/* ========================================
   SISTEMA DE RASTREO - UNIQUE DESIGN
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #1a3a52;
    --primary-blue: #2c5f7c;
    --accent-teal: #00a896;
    --accent-green: #028090;
    --bg-light: #f4f6f8;
    --bg-white: #ffffff;
    --text-dark: #2d3748;
    --text-gray: #4a5568;
    --text-light: #718096;
    --border-color: #cbd5e0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --warning-yellow: #f6ad55;
    --success-green: #48bb78;
    --status-pending: #ed8936;
    --status-process: #4299e1;
    --status-transit: #9f7aea;
    --status-delivered: #48bb78;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.main-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

/* ========================================
   HEADER
   ======================================== */
.system-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    color: white;
    padding: 30px 40px;
    border-bottom: 4px solid var(--accent-teal);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
}

.system-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    font-size: 3.5rem;
    line-height: 1;
    animation: truckBounce 2s ease-in-out infinite;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.header-text p {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

@keyframes truckBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ========================================
   TAB SELECTOR
   ======================================== */
.tab-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.tab-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 30px;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tab-option:hover {
    background: var(--bg-light);
}

.tab-option.active {
    background: white;
    border-bottom-color: var(--accent-teal);
}

.tab-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.tab-info {
    text-align: left;
}

.tab-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.tab-info span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   CONTENT WRAPPER
   ======================================== */
.content-wrapper {
    padding: 40px;
}

.tracking-section {
    display: none;
}

.tracking-section.active {
    display: block;
}

/* ========================================
   SEARCH PANEL
   ======================================== */
.search-panel {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.search-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.panel-description {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.search-form label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(0, 168, 150, 0.1);
}

.btn-consultar {
    padding: 12px 32px;
    background: var(--accent-teal);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-consultar:hover {
    background: var(--accent-green);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-consultar:active {
    transform: translateY(0);
}

.format-hint {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* ========================================
   RESULT PANEL
   ======================================== */
.result-panel {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.result-header {
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.guia-display {
    text-align: center;
    margin-bottom: 20px;
}

.guia-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.guia-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Courier New', monospace;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    margin: 20px 0;
}

.status-badge.pending {
    background: rgba(237, 137, 54, 0.1);
    color: var(--status-pending);
    border-left: 4px solid var(--status-pending);
}

.status-badge.processing {
    background: rgba(66, 153, 225, 0.1);
    color: var(--status-process);
    border-left: 4px solid var(--status-process);
}

.status-badge.transit {
    background: rgba(159, 122, 234, 0.1);
    color: var(--status-transit);
    border-left: 4px solid var(--status-transit);
}

.status-badge.delivered {
    background: rgba(72, 187, 120, 0.1);
    color: var(--status-delivered);
    border-left: 4px solid var(--status-delivered);
}

.status-icon {
    font-size: 1.5rem;
}

.status-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.status-info p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.timeline {
    margin: 30px 0;
}

.timeline-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 45px;
    bottom: -25px;
    width: 2px;
    background: var(--border-color);
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.timeline-marker.active {
    background: var(--accent-teal);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 168, 150, 0.2);
}

.timeline-marker.inactive {
    background: var(--bg-light);
    color: var(--text-light);
}

.timeline-content {
    flex: 1;
    padding-top: 5px;
}

.timeline-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   INFO PANEL
   ======================================== */
.info-panel {
    margin-top: 30px;
}

.info-box {
    background: #e6f7ff;
    border-left: 4px solid #1890ff;
    padding: 20px;
    border-radius: 6px;
}

.info-box.warning {
    background: #fff7e6;
    border-left-color: var(--warning-yellow);
}

.info-box h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.info-box p {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
}

/* ========================================
   FOOTER
   ======================================== */
.system-footer {
    background: var(--bg-light);
    padding: 25px 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.system-footer p {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.system-footer a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 600;
}

.system-footer a:hover {
    text-decoration: underline;
}

/* ========================================
   CUSTOM ALERTS
   ======================================== */
.custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.custom-alert.show {
    display: flex;
}

.alert-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s ease;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.alert-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.alert-message {
    flex: 1;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.alert-message strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.alert-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.alert-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.custom-alert.error .alert-content {
    border-left: 5px solid #f56565;
}

.custom-alert.success .alert-content {
    border-left: 5px solid #48bb78;
}

.custom-alert.warning .alert-content {
    border-left: 5px solid var(--warning-yellow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .system-header {
        padding: 20px 20px;
    }

    .system-title h1 {
        font-size: 1.3rem;
    }

    .system-title p {
        font-size: 0.85rem;
    }

    .tab-selector {
        grid-template-columns: 1fr;
        gap: 1px;
    }

    .tab-option {
        padding: 18px 20px;
        justify-content: center;
    }

    .tab-icon {
        font-size: 2rem;
    }

    .tab-info h3 {
        font-size: 1rem;
    }

    .tab-info span {
        font-size: 0.8rem;
    }

    .content-wrapper {
        padding: 20px 15px;
    }

    .search-panel,
    .result-panel {
        padding: 20px;
        border-radius: 6px;
    }

    .search-panel h2 {
        font-size: 1.3rem;
    }

    .panel-description {
        font-size: 0.9rem;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .input-wrapper input {
        padding: 14px 16px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .btn-consultar {
        width: 100%;
        padding: 14px 32px;
        font-size: 1rem;
    }

    .guia-number {
        font-size: 1.1rem;
        word-break: break-all;
    }

    .status-badge {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .status-icon {
        font-size: 2rem;
    }

    .status-info h3 {
        font-size: 1.1rem;
    }

    .timeline-item {
        gap: 12px;
    }

    .timeline-marker {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .timeline-item:not(:last-child)::after {
        left: 17px;
    }

    .timeline-content h4 {
        font-size: 1rem;
    }

    .timeline-content p {
        font-size: 0.85rem;
    }

    .info-box {
        padding: 15px;
    }

    .info-box h4 {
        font-size: 1rem;
    }

    .info-box p {
        font-size: 0.85rem;
    }

    .system-footer {
        padding: 20px 15px;
    }

    .system-footer p {
        font-size: 0.85rem;
    }

    /* Custom Alert Mobile */
    .alert-content {
        padding: 25px;
        gap: 15px;
        max-width: 95%;
    }

    .alert-icon {
        font-size: 2rem;
    }

    .alert-message {
        font-size: 0.95rem;
    }

    .alert-message strong {
        font-size: 1.1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .system-title h1 {
        font-size: 1.1rem;
    }

    .system-title p {
        font-size: 0.8rem;
    }

    .tab-option {
        padding: 15px;
        gap: 10px;
    }

    .tab-icon {
        font-size: 1.8rem;
    }

    .tab-info h3 {
        font-size: 0.95rem;
    }

    .content-wrapper {
        padding: 15px 10px;
    }

    .search-panel,
    .result-panel {
        padding: 15px;
    }

    .search-panel h2 {
        font-size: 1.2rem;
    }

    .guia-number {
        font-size: 1rem;
    }

    .alert-content {
        padding: 20px;
    }
}