/**
 * Public Tracking Page Styles
 *
 * @package TrackingPro
 */

/* Container */
.tracking-pro-public-container {
    max-width: 800px;
    margin: 40px auto;
}

.tracking-pro-public-container * {
    font-family: inherit;
}

/* Search Section */
.tracking-pro-search-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
}

/* Tabs */
.tracking-pro-search-tabs {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.tracking-pro-tab {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 20px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.tracking-pro-tab:hover {
    border-color: #86bc25 !important;
    color: #86bc25 !important;
}

.tracking-pro-tab.active {
    border-color: #86bc25 !important;
    background: #86bc25 !important;
    color: #fff !important;
}

.tracking-pro-tab svg {
    stroke-width: 2.5 !important;
}

.tracking-pro-tab-divider {
    color: #9ca3af !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Forms */
.tracking-pro-search-form {
    display: none;
    max-width: 500px;
    margin: 0 auto;
}

.tracking-pro-search-form.active {
    display: block;
}

.tracking-pro-form-group {
    margin-bottom: 16px;
    box-sizing: border-box;
    width: 100%;
}

.tracking-pro-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.tracking-pro-form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tracking-pro-form-group input:focus {
    outline: none !important;
    border-color: #86bc25 !important;
    box-shadow: 0 0 0 3px rgba(134, 188, 37, 0.1) !important;
}

.tracking-pro-submit-btn {
    width: 100% !important;
    padding: 12px 24px !important;
    background: #86bc25 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.tracking-pro-submit-btn:hover {
    background: #6fa31f !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(134, 188, 37, 0.3) !important;
}

.tracking-pro-submit-btn:active {
    transform: translateY(0) !important;
}

/* Loading State */
.tracking-pro-loading {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tracking-pro-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #86bc25;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: tracking-pro-spin 0.8s linear infinite;
}

@keyframes tracking-pro-spin {
    to {
        transform: rotate(360deg);
    }
}

.tracking-pro-loading p {
    color: #6b7280;
    font-size: 15px;
}

/* Error State */
.tracking-pro-error {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tracking-pro-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.tracking-pro-error h3 {
    font-size: 24px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px 0;
}

.tracking-pro-error-message {
    color: #6b7280;
    font-size: 15px;
    margin: 0;
}

/* Results Container */
.tracking-pro-results {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Result Header */
.tracking-pro-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 40px;
    background: linear-gradient(135deg, #86bc25 0%, #5d8f1b 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.tracking-pro-result-header::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.tracking-pro-result-header h2 {
    font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Mono", "Droid Sans Mono", "Source Code Pro", monospace;
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tracking-pro-status-badge {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tracking-pro-status-badge::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #fff;
    vertical-align: middle;
    /* Animation setup */
    transform-origin: center;
}

/* Result Content - Two Columns */
.tracking-pro-result-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    min-height: 400px;
}

@media (max-width: 850px) {
    .tracking-pro-result-content {
        grid-template-columns: 1fr;
    }
}

/* Info Column (Left) */
.tracking-pro-info-column {
    padding: 30px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
}

@media (max-width: 850px) {
    .tracking-pro-info-column {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

.tracking-pro-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
}

.tracking-pro-info-card:last-child {
    margin-bottom: 0;
}

.tracking-pro-info-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tracking-pro-info-card h3 svg {
    stroke: #86bc25;
    stroke-width: 2.5;
}

.tracking-pro-info-grid {
    display: grid;
    gap: 12px;
}

.tracking-pro-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tracking-pro-info-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

font-weight: 500;
}

.tracking-pro-info-value {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
}

/* Address */
.tracking-pro-address p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.tracking-pro-address p strong {
    color: #111827;
    font-weight: 600;
}

/* Products List */
.tracking-pro-products-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tracking-pro-product-item {
    display: flex;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.tracking-pro-product-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tracking-pro-product-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.tracking-pro-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tracking-pro-product-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tracking-pro-product-no-image svg {
    stroke: #d1d5db;
    stroke-width: 1.5;
}

.tracking-pro-product-info {
    flex: 1;
    min-width: 0;
}

.tracking-pro-product-info h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

.tracking-pro-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    /* Permite quebrar linha em telas pequenas */
}

.tracking-pro-product-quantity {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    /* Evita quebra dentro da quantidade */
}

.tracking-pro-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #86bc25;
    white-space: nowrap;
    /* Evita quebra dentro do preço */
}

/* Timeline Column (Right) */
.tracking-pro-timeline-column {
    padding: 40px;
}

.tracking-pro-timeline-column h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #334151;
    margin: 0 0 30px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tracking-pro-timeline-column h3 svg {
    stroke: #86bc25;
    stroke-width: 2.5;
}

/* Timeline */
.tracking-pro-timeline {
    position: relative;
    padding-left: 10px;
}

/* OLD LINE REMOVED - Using per-item lines now */

/* Timeline Items */
.tracking-pro-timeline-item {
    position: relative;
    padding-bottom: 30px;
    padding-left: 50px;
    /* Create animation for items */
    opacity: 0;
    transform: translateX(10px);
    animation: fadeInRight 0.4s ease forwards;
}

.tracking-pro-timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.tracking-pro-timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.tracking-pro-timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.tracking-pro-timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}

.tracking-pro-timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tracking-pro-timeline-item:last-child {
    padding-bottom: 0;
}

/* Connector Line */
.tracking-pro-timeline-item::after {
    content: '';
    position: absolute;
    left: 16px;
    /* Center of marker (32px / 2) */
    top: 32px;
    width: 2px;
    height: calc(100% - 32px);
    background: #e2e8f0;
    transform: translateX(-50%);
}

.tracking-pro-timeline-item:last-child::after {
    display: none;
}

/* Active Item Gradient Line */
.tracking-pro-timeline-item.active::after {
    background: linear-gradient(to bottom, #86bc25 0%, #e2e8f0 100%);
}

/* Marker */
.tracking-pro-timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Marker Icon */
.tracking-pro-timeline-marker::before {
    content: '';
    width: 14px;
    height: 14px;
    background-color: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* Active Marker */
.tracking-pro-timeline-item.active .tracking-pro-timeline-marker {
    background: #86bc25;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(134, 188, 37, 0.2);
    border-color: #86bc25;
    transform: scale(1.1);
}

/* Timeline Content */
.tracking-pro-timeline-content {
    padding: 0;
    padding-top: 2px;
    background: transparent;
    border: none;
}

.tracking-pro-timeline-item.active .tracking-pro-timeline-content {
    background: transparent;
    border: none;
}

.tracking-pro-timeline-date {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 4px;
}

.tracking-pro-timeline-item.active .tracking-pro-timeline-date {
    color: #86bc25;
    font-weight: 600;
}

.tracking-pro-timeline-status {
    font-size: 15px;
    color: #334151;
    font-weight: 500;
    line-height: 1.5;
}

.tracking-pro-timeline-item.active .tracking-pro-timeline-status {
    color: #1e293b;
    font-weight: 700;
    font-size: 16px;
}

/* No Events */
.tracking-pro-no-events {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 15px;
    font-style: italic;
}

/* Status Badges - Dot Colors with Pulse Animation */
@keyframes tracking-pro-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tracking-pro-status-badge::before {
    animation: tracking-pro-pulse 2s infinite ease-in-out;
}

.tracking-pro-status-registrado::before {
    background-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.tracking-pro-status-em-transito::before {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
}

.tracking-pro-status-entregue::before {
    background-color: #0b5915;
    box-shadow: 0 0 0 2px rgb(22 109 80 / 40%);
}

.tracking-pro-status-pendente::before {
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
}

.tracking-pro-status-cancelado::before {
    background-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
}

/* Remove ugly opaque backgrounds to keep glassmorphism */
.tracking-pro-status-registrado,
.tracking-pro-status-em-transito,
.tracking-pro-status-entregue,
.tracking-pro-status-pendente,
.tracking-pro-status-cancelado {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* Responsive */
@media (max-width: 640px) {
    .tracking-pro-search-tabs {
        flex-direction: column;
        gap: 10px;
    }

    .tracking-pro-tab {
        width: 100%;
        justify-content: center;
    }

    .tracking-pro-tab-divider {
        display: none;
    }

    .tracking-pro-result-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .tracking-pro-result-header h2 {
        font-size: 18px;
    }
}