/* Reset & Base styles */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f1f1f1;
    font-family: -apple-system, system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

body {
    padding-bottom: 80px; /* Space for notification bar */
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Header styling */
.site-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 12px 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Logo styling */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Main menu styling */
.main-menu {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    margin-left: 20px;
}

.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.main-menu li {
    margin: 0 10px;
    position: relative;
}

.main-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: block;
}

.main-menu a:hover, 
.main-menu a.active {
    background-color: #f2f2f2;
    color: #4CAF50;
}

/* Language dropdown styling */
.language-dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 25;
    top: 100%;
    right: 0;
    text-align: left;
}

.language-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: #333;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    background: transparent;
    border: none;
    padding: 12px;
    margin-left: 10px;
    z-index: 1001;
}

/* Mobile menu styling */
.mobile-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
}

/* Main content container */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 70px auto 0;
    padding: 15px;
    position: relative;
    z-index: 1;
}

/* App notification bar - FIXED POSITION */
.app-button-container {
    display: flex;
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, rgba(255,111,48,1) 0%, rgba(255,215,0,1) 49%, rgba(109,190,69,1) 100%);
    padding: 8px 10px;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    width: 100%;
    height: auto;
    min-height: 60px;
    max-height: 80px;
}

.app-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 5px;
}

.app-notification-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.app-notification-logo {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
    background-color: white;
    padding: 2px;
    object-fit: contain;
}

.app-notification-text {
    flex: 1;
    text-align: left;
    font-size: 14px;
    font-weight: bold;
    margin-right: 15px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    line-height: 1.3;
}

.app-button {
    background-color: #fff;
    color: #333;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    font-size: 14px;
    border: none;
    white-space: nowrap;
    cursor: pointer;
}

/* Footer styling - Updated grid layout */
.site-footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 40px;
    width: 100%;
    box-sizing: border-box;
}

/* Footer styling - Updated for equal height columns */
.footer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    box-sizing: border-box;
    align-items: start; /* Ensure columns start from the top */
}

.footer-logo-section,
.footer-links,
.footer-services,
.footer-contact {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.footer-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Consistent spacing between items */
}

/* Remove the bottom margin from menu items since we're using gap */
.footer-menu li {
    margin-bottom: 0;
}

/* Ensure all footer headings have the same spacing */
.footer-links h3,
.footer-services h3,
.footer-contact h3 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 1.2rem;
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ensure consistent spacing between menu items */
.footer-menu li {
    margin-bottom: 12px;
}

.footer-menu li:last-child {
    margin-bottom: 0;
}

/* Adjust media queries for responsive design */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-logo-section,
    .footer-links,
    .footer-services,
    .footer-contact {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .footer-container {
        grid-template-columns: 1fr;
    }
}

.footer-logo-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo img {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.footer-logo-section p {
    margin: 10px 0;
    font-size: 16px;
}

.social-icons {
    margin-top: 15px;
    display: flex;
    gap: 12px;
}

.footer-links {
    padding: 0 20px;
}

.footer-contact {
    padding: 0;
}

.footer-links,
.footer-contact {
    padding: 0 15px;
}

.footer-links {
    display: flex;
    flex-direction: column;
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    opacity: 0.8;
}

.footer-menu a:hover {
    opacity: 1;
    color: #4CAF50;
}

.footer-contact {
    font-size: 14px;
    line-height: 1.6;
}

.company-name {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links h3, .footer-contact h3 {
    margin-top: 0;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.footer-logo {
    display: flex;
    justify-content: flex-start;
}

.footer-logo img {
    max-width: 100px;
    height: auto;
    margin-bottom: 15px;
    display: block;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icons a {
    color: #fff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.copyright {
    font-size: 14px;
    opacity: 0.7;
}

/* QR Code input form styling */
.qr-form {
    width: 100%;
    max-width: 800px;
    margin: 15px auto;
    padding: 0 15px;
}

.qr-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.qr-tab {
    padding: 10px 15px;
    background-color: #f1f1f1;
    border: 1px solid #ccc;
    cursor: pointer;
    margin: 0 5px;
    border-radius: 5px 5px 0 0;
}

.qr-tab.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.qr-input-container {
    display: none;
}

.qr-input-container.active {
    display: block;
}

.input-group {
    width: 100%;
    display: flex;
    padding: 4px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,111,48,1) 0%, rgba(255,215,0,1) 49%, rgba(109,190,69,1) 100%);
}

.input-group input[type="text"] {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    margin-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-group button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-group button i {
    font-size: 14px;
}

/* QR Image upload styling */
.qr-upload {
    margin: 15px auto;
    text-align: center;
    max-width: 100%;
    padding: 15px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,111,48,1) 0%, rgba(255,215,0,1) 49%, rgba(109,190,69,1) 100%);
}

.qr-upload > * {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.qr-upload label {
    background: none;
    padding: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-btn {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
}

.upload-preview {
    margin: 10px auto;
    max-width: 200px;
    background: white;
    padding: 10px;
    border-radius: 4px;
}

.upload-preview img {
    max-width: 100%;
    display: none;
}

/* Product details styling */
.product-details {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 0;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Product details styling - Updated header layout */
.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    gap: 20px;
}

.product-title-block {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.product-title {
    margin: 0;
}

.product-id {
    margin: 5px 0 0;
    color: #666;
}

.blockchain-button.header-button {
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    height: fit-content;
}

.product-title {
    margin: 0;
}

.product-id {
    margin: 5px 0 0;
}

.blockchain-button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 10px;
    font-weight: bold;
}

.blockchain-button.header-button {
    margin: 0 0 0 15px;
    white-space: nowrap;
    flex-shrink: 0;
}

.blockchain-icon {
    margin-right: 6px;
    font-size: 16px;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 18px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 500px;
    border: 1px dashed #ccc;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #aaa;
}

/* Lightbox styling */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border: 3px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 5px 10px;
}

/* Lightbox caption styling */
.lightbox-caption {
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    font-size: 16px;
    max-width: 90%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    display: none; /* Hidden by default, shown when text is available */
}

/* Image section - Fixed for thumbnails */
.timeline-image {
    grid-row: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 156px;
    width: 100%;
    overflow: hidden;
}

/* Position image in grid */
.timeline.left .timeline-image {
    grid-column: 1;
}

.timeline.right .timeline-image {
    grid-column: 2;
}

/* Image styling - Restored to original appearance */
.timeline-image img {
    max-width: 100%;
    max-height: 156px;
    border-radius: 4px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s;
    min-height: 30px;
}

.timeline-image img:hover {
    transform: scale(1.05);
}

/* Timeline layout */
.timeline-container {
    position: relative;
    margin: 40px auto;
    width: 85%; /* Reduced from 95% to give more space for node numbers and time */
    max-width: 800px;
}

/* Individual timeline entries */
.timeline {
    position: relative;
    margin-bottom: 80px;
    width: 100%;
}

.timeline:last-child {
    margin-bottom: 20px;
}

/* Node number styling */
.node-number {
    position: absolute;
    width: 44px; /* Increased size */
    height: 44px; /* Increased size */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px; /* Larger font */
    top: 20px;
    z-index: 5;
    border: 3px solid white;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Position node number based on side */
.timeline.left .node-number {
    right: -22px;
}

.timeline.right .node-number {
    left: -22px;
}

/* Node time styling - Updated position */
.node-time {
    position: absolute;
    top: -30px; /* Move above timeline-content */
    font-size: 12px;
    color: #666;
    text-align: center;
    width: 140px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2;
}

/* Adjust time position for left/right alignment */
.timeline.left .node-time {
    right: 40px; /* Align with content */
}

.timeline.right .node-time {
    left: 40px; /* Align with content */
}

/* Add timestamp under node number - Updated styles */
.node-time .time {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.node-time .date {
    font-size: 11px;
    color: #666;
}

.timeline.left .node-time {
    right: -70px;
}

.timeline.right .node-time {
    left: -70px;
}

/* Connector lines */
.connector-vertical {
    position: absolute;
    width: 3px;
    background-color: #aaa;
    z-index: 1;
    top: 50%;
    height: calc(100% + 40px);
}

.timeline.left .connector-vertical {
    right: 0;
}

.timeline.right .connector-vertical {
    left: 0;
}

.connector-horizontal {
    position: absolute;
    height: 3px;
    background-color: #aaa;
    z-index: 1;
    bottom: -40px;
    width: calc(100% + 40px);
}

.timeline.left .connector-horizontal {
    right: -2px;
}

.timeline.right .connector-horizontal {
    left: -2px;
}

/* Content boxes - Updated for proper grid layout */
.timeline-content {
    width: 100%;
    padding: 20px;
    background-color: #fff;
    border: 1px dashed #ddd;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    box-sizing: border-box;
    display: flex; /* Changed from grid to flex */
    gap: 20px;
    margin: 40px 40px 0; /* Add top margin for time */
    align-items: center;
}

/* Left/Right layout adjustments */
.timeline.left .timeline-content {
    flex-direction: row; /* Image left, text right */
    margin-right: 60px;
}

.timeline.right .timeline-content {
    flex-direction: row-reverse; /* Text left, image right */
    margin-left: 60px;
}

/* Image container styling */
.timeline-image {
    flex: 0 0 200px; /* Fixed width, no grow/shrink */
    height: 156px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: none;
    border-radius: 4px;
}

/* Text content styling */
.timeline-text {
    flex: 1; /* Take remaining space */
    padding: 0 15px;
    min-width: 0; /* Allow text to wrap */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .timeline-content {
        flex-direction: column !important; /* Stack vertically on mobile */
        margin: 0 !important;
        padding: 15px;
        gap: 15px;
    }

    .timeline-image {
        width: 100%;
        height: 120px;
        flex: 0 0 120px;
    }

    .timeline-text {
        width: 100%;
        padding: 0;
    }

    /* Remove the grid-specific properties */
    .timeline.left .timeline-image,
    .timeline.right .timeline-image,
    .timeline.left .timeline-text,
    .timeline.right .timeline-text {
        grid-column: unset;
        grid-row: unset;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .timeline-container {
        width: 95%;
        padding-left: 30px;
    }

    .timeline-container:before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 15px;
        width: 3px;
        background-color: #aaa;
        z-index: 1;
    }

    .timeline.left .node-number,
    .timeline.right .node-number {
        left: -30px;
        right: auto;
        top: 16px;
        transform: translateY(0) translateX(-50%);
    }

    .timeline.left .timeline-content,
    .timeline.right .timeline-content {
        grid-template-columns: 3fr 1fr;
    }

    .connector-vertical,
    .connector-horizontal {
        display: none;
    }

    .timeline:before {
        content: '';
        position: absolute;
        left: -15px;
        top: 21px;
        width: 15px;
        height: 3px;
        background-color: #aaa;
    }

    .timeline-content {
        margin: 0 !important;
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .timeline-image {
        grid-row: 1;
        grid-column: 1 !important;
        max-height: 120px;
        width: 100%;
        height: 120px;
    }

    .timeline-text {
        grid-row: 2;
        grid-column: 1 !important;
    }

    .node-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .node-time {
        display: none;
    }

    .mobile-time {
        display: block;
        font-size: 12px;
        color: #666;
        margin-top: 5px;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    .main-content {
        margin-top: 0;
        padding: 10px 5px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-menu {
        display: none;
    }

    /* Make mobile menu full width and visible when active */
    .mobile-menu {
        width: 100%;
        z-index: 1001;
    }
    
    /* Make mobile menu items touch-friendly */
    .mobile-menu a {
        padding: 15px 20px;
    }

    /* Product header goes vertical on mobile */
    .product-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .blockchain-button.header-button {
        margin: 10px 0 0;
    }

    /* Footer adjustments */
    .footer-container {
        grid-template-columns: 1fr; /* Stack columns on mobile */
        gap: 40px;
        text-align: center;
    }

    .footer-logo-section {
        align-items: center;
    }

    .footer-links,
    .footer-contact {
        padding: 0;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-menu ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-menu li {
        margin: 8px 0;
    }

    .social-icons {
        justify-content: center;
    }

    /* Standardize image placement for all items on mobile */
    .timeline.left .timeline-image,
    .timeline.right .timeline-image {
        grid-column: 2;
        grid-row: 1 / span 5;
    }
    
    /* Adjust image size on mobile */
    .timeline-image img {
        max-height: 80px;
        object-fit: contain;
    }

    .app-button-container {
        padding: 5px 10px;
    }

    .app-notification-text {
        max-width: 60%;
        line-height: 1.2;
        font-size: 12px;
    }
}

/* Mobile adjustments for timeline */
@media (max-width: 768px) {
    .timeline-content {
        flex-direction: row !important; /* Keep horizontal layout */
        padding: 12px;
        gap: 15px;
        margin: 0 !important;
    }

    /* Keep image size fixed and positioned */
    .timeline-image {
        flex: 0 0 100px; /* Smaller fixed width on mobile */
        height: 100px;
        min-width: 100px; /* Prevent image shrinking */
    }

    /* Text content should wrap */
    .timeline-text {
        flex: 1;
        padding: 0 0 0 10px;
        min-width: 0; /* Allow text to wrap */
    }

    /* Timeline title on mobile */
    .timeline-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    /* Timeline info text on mobile */
    .timeline-info {
        font-size: 12px;
        line-height: 1.4;
    }

    /* Keep left/right layout */
    .timeline.left .timeline-content {
        flex-direction: row !important;
    }

    .timeline.right .timeline-content {
        flex-direction: row-reverse !important;
    }

    /* Adjust image display */
    .timeline-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .node-time {
        position: relative;
        top: 0;
        left: 0 !important;
        right: 0 !important;
        width: auto;
        margin-bottom: 10px;
        background: transparent;
        box-shadow: none;
        padding: 0;
    }

    .timeline-content {
        margin-top: 0;
    }

    .mobile-time {
        display: none; /* Hide the old mobile time display */
    }

    /* Keep the time visible on mobile */
    .timeline.left .node-time,
    .timeline.right .node-time {
        display: flex;
    }
}
/* Product Info Card Styles - Certificate Design */
.product-info-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px solid #667eea;
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.product-info-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.info-card-title {
    font-size: 1.5em;
    margin: 0 0 25px 0;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.info-card-title i {
    font-size: 1.2em;
    color: #667eea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
}

.info-item:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 0.85em;
    color: #718096;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
    word-break: break-all;
}

.monospace {
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95em;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.address-short {
    cursor: help;
}

.copy-btn {
    background: #667eea;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.copy-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.badge-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

.badge-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.badge-blockchain {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    display: inline-flex;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.explorer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.explorer-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateX(5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .product-info-card {
        padding: 15px 10px;
        margin: 15px 5px;
        border-radius: 12px;
    }
    
    .info-card-title {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .info-item {
        padding: 10px;
    }
    
    .info-label {
        font-size: 0.85em;
        margin-bottom: 8px;
    }
    
    .info-value {
        font-size: 0.95em;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .monospace {
        width: 100%;
        font-size: 0.85em;
        padding: 6px 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Fix badge overflow on mobile */
    .badge {
        font-size: 0.85em;
        padding: 6px 12px;
        white-space: nowrap;
    }
    
    /* Make copy button more mobile-friendly */
    .copy-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    /* Fix explorer link on mobile */
    .explorer-link {
        font-size: 0.9em;
        padding: 8px 16px;
    }
}

/* ============================================
   PAGE LOADING STATE
   ============================================ */
/* Prevent infinite loading spinner */
body {
    opacity: 1 !important;
    transition: opacity 0.3s ease-in;
}

/* Page loaded state */
body.page-loaded {
    opacity: 1 !important;
}

/* Timeline image loading optimization */
.timeline-image img {
    background: #f0f0f0;
    min-height: 100px;
    object-fit: cover;
}

/* Broken image fallback */
.timeline-image img[src="/no-image.png"],
.timeline-image img[src="no-image.png"] {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Loading skeleton for images */
.timeline-image img:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Force stop loading after timeout */
body::after {
    content: "";
    display: none;
}


/* ============================================
   PRODUCT INFO CARD - REDESIGN (Certificate Style)
   ============================================ */

/* Card Product Header (Product Name) */
.card-product-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: -30px -30px 25px -30px;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-product-title {
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    flex: 1;
    min-width: 200px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.card-product-title i {
    color: #ffd700;
    margin-right: 12px;
    font-size: 22px;
}

.blockchain-button-card {
    background: rgba(255,255,255,0.2);
    color: #ffffff !important;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    box-sizing: border-box;
}

.blockchain-button-card:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.blockchain-button-card i {
    margin-right: 8px;
}

/* Update Product Info Card Colors */
.product-info-card {
    background: #ffffff !important;
    border: 2px solid #e0e0e0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.info-card-title {
    color: #333333 !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: -5px -30px 25px -30px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.info-card-title i {
    color: #667eea;
}

/* Info Items - Better Contrast */
.info-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 1px solid #dee2e6 !important;
}

.info-label {
    color: #495057 !important;
    font-weight: 600;
}

.info-label i {
    color: #667eea !important;
}

.info-value {
    color: #212529 !important;
    font-weight: 500;
}

/* Badges - Better Contrast */
.badge {
    font-weight: 600;
    padding: 8px 16px;
    font-size: 13px;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
}

.badge-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%) !important;
    color: #ffffff !important;
}

.badge-blockchain {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #ffffff !important;
}

/* Address and Hash Display */
.address-display,
.hash-display {
    font-family: 'Courier New', monospace;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    color: #212529 !important;
    word-break: break-all;
}

.address-short {
    color: #495057 !important;
}

/* Copy Button */
.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

/* Explorer Link */
.explorer-link {
    color: #667eea !important;
    font-weight: 600;
}

.explorer-link:hover {
    color: #764ba2 !important;
}

/* Mobile Responsive for Card Header */
@media (max-width: 768px) {
    .card-product-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 15px 12px;
        margin: -15px -10px 15px -10px;
        overflow: hidden;
    }
    
    .card-product-title {
        font-size: 18px;
        text-align: center;
        min-width: auto;
        word-break: break-word;
    }
    
    .blockchain-button-card {
        width: 100%;
        text-align: center;
        justify-content: center;
        display: inline-block;
        white-space: normal;
        padding: 12px 16px;
        font-size: 13px;
        line-height: 1.4;
    }
    
    .info-card-title {
        margin: -5px -10px 15px -10px;
        padding: 12px 10px;
        font-size: 14px;
    }
    
    .info-grid {
        gap: 12px;
    }
    
    .info-item {
        padding: 12px;
    }
    
    .info-label {
        font-size: 12px;
    }
    
    .info-value {
        font-size: 14px;
    }
}

/* Ensure text is readable on all backgrounds */
.product-info-card * {
    text-shadow: none !important;
}

/* Make sure no white on white */
.product-info-card .info-label,
.product-info-card .info-value,
.product-info-card .address-display,
.product-info-card .hash-display {
    color: #212529 !important;
}


/* ============================================
   MOBILE OPTIMIZATION: Search Box & Button
   ============================================ */
@media (max-width: 768px) {
    /* QR Form mobile */
    .qr-form {
        padding: 15px;
        margin: 15px 0;
    }
    
    /* Input group mobile */
    .input-group {
        flex-direction: column;
        gap: 10px;
        padding: 8px;
    }
    
    .input-group input[type="text"] {
        width: 100%;
        margin-right: 0;
        padding: 14px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 6px;
    }
    
    .input-group button {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 6px;
        justify-content: center;
        gap: 8px;
        background: #667eea !important;
        color: white !important;
    }
    
    .input-group button i {
        font-size: 16px;
    }
    
    /* Upload section mobile */
    .qr-upload {
        padding: 12px;
        margin: 12px 0;
    }
    
    .qr-upload input[type="file"] {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* Tabs mobile */
    .qr-tabs {
        display: flex;
        gap: 0;
    }
    
    .qr-tab {
        flex: 1;
        padding: 14px 8px;
        font-size: 14px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Extra small devices (phones < 480px) */
@media (max-width: 480px) {
    .input-group input[type="text"] {
        font-size: 14px;
        padding: 12px;
    }
    
    .input-group button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .qr-tab {
        font-size: 13px;
        padding: 12px 6px;
    }
}

