/* Custom variables for brand colors and fonts */
:root {
    --fedex-purple: #4D148C;
    --fedex-orange: #FF6200;
    --text-dark: #333333;
    --text-muted: #555555;
    --bg-light: #F8F9FA;
    --border-color: #E0E0E0;
    --accent-red: #D93025;
    --success-green: #188038;
    
    --hover-purple: #3A0F6A;
    --hover-orange: #E05600;
    --modal-bg: rgba(0, 0, 0, 0.5);
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: #FFFFFF;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header & Nav */
.main-header {
    background-color: var(--fedex-purple);
    color: #FFFFFF;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* FedEx Logo construction in pure CSS/font style */
.logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1.2px;
    user-select: none;
    display: flex;
    align-items: center;
}

.logo-fed {
    color: #FFFFFF;
}

.logo-ex {
    color: var(--fedex-orange);
    margin-left: -1px; /* overlap slightly to emulate the arrow */
}

.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-item {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    opacity: 0.85;
}

.chevron-down {
    transition: transform 0.2s ease;
}

.search-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.search-icon:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
}

/* Subheader styling */
.subheader {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.subheader-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.subheader h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Main Content Container */
.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px 24px;
}

/* Tracking Header */
.tracking-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.tracking-number {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-dark);
}

.badge {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-failure {
    background-color: #FFF0F0;
    color: var(--accent-red);
    border: 1px solid rgba(217, 48, 37, 0.2);
}

/* Tabs Navigation */
.tabs-navigation {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    gap: 32px;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.tabs-navigation::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 12px 0;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.tab-btn:hover {
    color: var(--fedex-purple);
}

.tab-btn.active {
    color: var(--fedex-purple);
    font-weight: 700;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--fedex-purple);
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Details Tab Style */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

.details-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.details-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--fedex-purple);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.details-card p {
    font-size: 14px;
    margin-bottom: 4px;
}

.details-card .name {
    font-weight: 600;
    margin-bottom: 8px;
}

.shipment-meta {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .shipment-meta {
        grid-column: span 1;
    }
}

.meta-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-color);
    padding: 8px 0;
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    font-weight: 500;
    color: var(--text-muted);
}

.meta-value {
    font-weight: 600;
}

/* Documents Tab Style */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.document-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.document-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.doc-icon {
    color: var(--fedex-purple);
    margin-right: 16px;
    display: flex;
    align-items: center;
}

.doc-info {
    flex-grow: 1;
}

.doc-name {
    font-weight: 600;
    font-size: 14px;
}

.doc-size {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-download {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-download:hover {
    border-color: var(--fedex-purple);
    color: var(--fedex-purple);
    background-color: rgba(77, 20, 140, 0.05);
}

/* Paid (Breakdown) Tab Style */
.fees-breakdown {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.fee-row-container {
    border-bottom: 1px solid var(--border-color);
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background-color: #FFFFFF;
    transition: background-color 0.2s;
}

.fee-row[data-toggle] {
    cursor: pointer;
}

.fee-row[data-toggle]:hover {
    background-color: #FAF8FD;
}

.fee-name {
    font-size: 15px;
    font-weight: 500;
}

.fee-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fee-amount {
    font-size: 15px;
    font-weight: 600;
}

.chevron-down-gray {
    color: #888888;
    transition: transform 0.3s ease;
}

.fee-row-container.open .chevron-down-gray {
    transform: rotate(180deg);
}

.fee-detail-content {
    max-height: 0;
    overflow: hidden;
    background-color: #FAF9FC;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 24px;
    border-top: 0px solid transparent;
}

.fee-row-container.open .fee-detail-content {
    max-height: 100px;
    padding: 12px 24px 20px 24px;
    border-top: 1px solid rgba(77, 20, 140, 0.08);
}

.fee-detail-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.total-row {
    background-color: #FAF9FC;
    border-bottom: none;
    padding: 22px 24px;
}

.bold {
    font-weight: 700 !important;
}

.total-row .fee-amount {
    font-size: 18px;
    color: var(--text-dark);
}

/* Info notes section */
.info-notes {
    margin-bottom: 32px;
}

.note-highlight {
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.note-subtext {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Action Button */
.btn-pay-now {
    width: 100%;
    background-color: var(--fedex-orange);
    color: #FFFFFF;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(255, 98, 0, 0.2);
}

.btn-pay-now:hover {
    background-color: var(--hover-orange);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(255, 98, 0, 0.3);
}

.btn-pay-now:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(255, 98, 0, 0.1);
}

/* FAQ Accordion Section */
.faq-section {
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    padding-top: 24px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 20px 0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    color: var(--text-dark);
    cursor: pointer;
}

.faq-trigger:hover {
    color: var(--fedex-purple);
}

.faq-trigger .chevron-down-gray {
    transition: transform 0.3s;
}

.faq-item.open .faq-trigger .chevron-down-gray {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.faq-item.open .faq-answer {
    max-height: 1000px;
    transition: max-height 0.5s cubic-bezier(1, 0, 1, 0);
}

.faq-answer-inner {
    padding: 0 0 24px 0;
}

.faq-answer p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Content Footer */
.content-footer {
    margin-top: 48px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
}

.contact-prompt {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-link {
    color: #0070C0;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.contact-link:hover {
    border-color: #0070C0;
}

.disclaimer-text {
    font-size: 11px;
    color: #888888;
    margin-bottom: 32px;
}

.btn-rate-exp {
    background: none;
    border: 1px solid var(--fedex-purple);
    color: var(--fedex-purple);
    padding: 12px 32px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-rate-exp:hover {
    background-color: var(--fedex-purple);
    color: #FFFFFF;
}

/* Payment Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.payment-modal-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .payment-modal-card {
    transform: translateY(0);
}

.btn-close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: var(--text-dark);
}

.modal-header {
    padding: 32px 32px 20px 32px;
    border-bottom: 1px solid var(--border-color);
}

.modal-logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
}

.modal-logo .logo-fed {
    color: var(--fedex-purple);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.purple-text {
    color: var(--fedex-purple);
}

.modal-body {
    padding: 24px 32px 32px 32px;
    position: relative;
}

.modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 600;
}

.modal-amount {
    font-size: 18px;
    color: var(--fedex-purple);
    font-weight: 700;
}

/* Redirect Message Styles */
.redirect-message-container {
    margin-bottom: 24px;
    text-align: center;
    background-color: #FAF9FC;
    border: 1px solid rgba(77, 20, 140, 0.08);
    border-radius: 8px;
    padding: 20px;
}

.redirect-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.redirect-subtext {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--fedex-purple);
    box-shadow: 0 0 0 3px rgba(77, 20, 140, 0.15);
}

.card-input-wrapper {
    position: relative;
}

.card-brand-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 24px;
}

.secure-icon {
    color: var(--success-green);
}

.btn-submit-payment {
    width: 100%;
    background-color: var(--fedex-purple);
    color: #FFFFFF;
    border: none;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit-payment:hover {
    background-color: var(--hover-purple);
}

/* Processing Overlay inside Modal */
.payment-processing {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 32px;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--fedex-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

.processing-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.processing-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Success Screen Overlay inside Modal */
.payment-success {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 32px;
    text-align: center;
}

/* Checkmark animation */
.success-icon-wrapper {
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
}

.success-checkmark {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: var(--success-green);
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--success-green);
    animation: fill-green .4s ease-in-out .4s forwards, scale-checkmark .3s ease-in-out .9s unique-bounce forwards;
}

.success-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--success-green);
    fill: none;
    animation: stroke-circle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke-check 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke-circle {
    100% { stroke-dashoffset: 0; }
}

@keyframes stroke-check {
    100% { stroke-dashoffset: 0; }
}

@keyframes fill-green {
    100% { box-shadow: inset 0px 0px 0px 36px rgba(24, 128, 56, 0.1); }
}

.success-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--success-green);
    margin-bottom: 8px;
}

.success-msg {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.receipt-details {
    width: 100%;
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
}

.receipt-row:last-child {
    margin-bottom: 0;
}

.receipt-label {
    color: var(--text-muted);
    font-weight: 500;
}

.receipt-val {
    font-weight: 600;
}

.green-text {
    color: var(--success-green);
}

.btn-close-success {
    width: 100%;
    background-color: var(--success-green);
    color: #FFFFFF;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-close-success:hover {
    background-color: #146c2f;
}

/* Mobile Drawer Styles */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background-color: #FFFFFF;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-header .logo-fed {
    color: var(--fedex-purple);
}

.btn-close-drawer {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
}

.drawer-content {
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 20px;
}

.drawer-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.drawer-link:hover {
    color: var(--fedex-purple);
}

/* Responsiveness overrides */
@media (max-width: 900px) {
    .nav-menu {
        display: none;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .search-icon {
        margin-right: 16px;
        margin-left: auto;
    }
}
