/**
 * Quote Tracking Page Styles
 * Comprehensive styling for customer quote tracking interface
 */

/* Container & Layout */
.quote-tracking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1f2937;
}

/* Token Input Form */
.token-input-container {
    max-width: 600px;
    margin: 80px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.token-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.tracking-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    stroke: #3b82f6;
    display: block;
}

.token-form-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #111827;
}

.token-form-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.token-form {
    margin-bottom: 30px;
}

.token-input-wrapper {
    position: relative;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: #9ca3af;
    pointer-events: none;
}

.token-input-wrapper input {
    flex: 1;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.token-input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.token-input-wrapper input::placeholder {
    color: #9ca3af;
}

.btn-track {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-track:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.btn-track svg {
    width: 18px;
    height: 18px;
}

.token-hint {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    text-align: center;
}

.token-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.token-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.token-actions a svg {
    width: 18px;
    height: 18px;
}

.token-actions .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.token-actions .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.token-actions .btn-primary {
    background: #c63fe8;
    color: #ffffff;
    border: none;
}

.token-actions .btn-primary:hover {
    background: #a32ec0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 63, 232, 0.3);
}

/* Header */
.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    gap: 20px;
    flex-wrap: wrap;
}

.quote-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #111827;
}

.quote-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.quote-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quote-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #111827;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

/* Status Message */
.status-message {
    padding: 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

/* Items Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.items-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.items-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
}

.items-table tbody tr:last-child td {
    border-bottom: none;
}

.items-table .total-row {
    background: #f9fafb;
    font-size: 16px;
}

.items-table .total-row td {
    padding: 20px 16px;
    border-top: 2px solid #e5e7eb;
}

.text-right {
    text-align: right;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 20px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 14px;
    flex-shrink: 0;
}

.info-value {
    color: #111827;
    font-size: 15px;
    text-align: right;
    word-break: break-word;
}

/* History Timeline */
.history-timeline {
    position: relative;
    padding-left: 0;
}

.history-entry {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    position: relative;
}

.history-entry:last-child {
    margin-bottom: 0;
}

.history-entry:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 40px;
    width: 2px;
    height: calc(100% + 5px);
    background: #e5e7eb;
}

.history-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.history-icon svg {
    width: 18px;
    height: 18px;
    stroke: #3b82f6;
    stroke-width: 2;
}

.history-content {
    flex: 1;
    padding-top: 2px;
}

.history-message {
    font-size: 15px;
    color: #111827;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.history-time {
    font-size: 13px;
    color: #6b7280;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* Error State */
.quote-tracking-error {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.quote-tracking-error h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #111827;
}

.quote-tracking-error p {
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Print Styles */
@media print {
    .quote-tracking-container {
        padding: 0;
    }

    .quote-section {
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .btn-primary,
    .btn-secondary,
    .token-actions {
        display: none;
    }

    .history-icon {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .quote-tracking-container {
        padding: 20px 15px;
    }

    .token-input-container {
        margin: 40px auto;
        padding: 30px 20px;
    }

    .token-form-header h2 {
        font-size: 24px;
    }

    .token-input-wrapper {
        flex-direction: column;
    }

    .btn-track {
        width: 100%;
        justify-content: center;
    }

    .token-actions {
        flex-direction: column;
    }

    .token-actions a {
        width: 100%;
        justify-content: center;
    }

    .quote-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .quote-header h1 {
        font-size: 24px;
    }

    .quote-section {
        padding: 20px;
    }

    .quote-section h2 {
        font-size: 18px;
    }

    .items-table {
        font-size: 14px;
    }

    .items-table thead {
        display: none;
    }

    .items-table tbody tr {
        display: block;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 2px solid #e5e7eb;
    }

    .items-table tbody td {
        display: block;
        text-align: left !important;
        padding: 8px 0;
        border: none;
    }

    .items-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        display: block;
        margin-bottom: 4px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-item {
        flex-direction: column;
        gap: 5px;
    }

    .info-value {
        text-align: left;
    }

    .history-entry {
        gap: 15px;
    }

    .history-icon {
        width: 32px;
        height: 32px;
    }

    .history-entry:not(:last-child)::before {
        left: 15px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Old template compatibility (page-track-quote.php) */
.track-quote-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.track-quote-page .container {
    max-width: 100%;
}

.track-quote-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
}

.track-quote-page .error-message {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.track-quote-page .error-message svg {
    width: 80px;
    height: 80px;
    stroke: #ef4444;
    margin-bottom: 20px;
}

.track-quote-page .error-message h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.track-quote-page .error-message p {
    color: #6b7280;
    margin-bottom: 30px;
}
