/* Lab Results Archive Page - Horizontal Layout Styles */

.lab-results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.lab-results-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #282828;
    font-weight: 600;
}

.lab-results-header p {
    font-size: 1.1em;
    color: #777777;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.lab-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Horizontal Card Layout */
.lab-result-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.lab-result-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Image Section */
.lab-card-image {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f8f8;
}

.lab-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Content Section */
.lab-card-content {
    flex: 1;
    min-width: 0;
}

.lab-product-name {
    font-size: 1.5em;
    font-weight: 600;
    color: #282828;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.lab-test-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lab-latest-test {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    color: #777777;
}

.lab-purity {
    font-weight: 700;
    color: #2e7d32;
    font-size: 1.1em;
}

.lab-separator {
    color: #ccc;
    font-weight: 400;
}

.lab-date, .lab-batch {
    color: #666;
}

/* Actions */
.lab-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.lab-view-cert {
    color: #DC9814;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.lab-view-cert:hover {
    color: #b8821a;
    text-decoration: none;
}

.lab-toggle-history {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.lab-toggle-history:hover {
    background: #f5f5f5;
    color: #333;
}

/* Test History */
.lab-test-history {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    border-top: 1px solid transparent;
    margin-top: 0;
}

.lab-test-history.expanded {
    max-height: 500px;
    padding-top: 16px;
    margin-top: 12px;
    border-top-color: #f0f0f0;
}

.lab-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f8f8;
}

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

.lab-history-item.is-latest {
    background: linear-gradient(90deg, #f8fff8 0%, transparent 100%);
    padding-left: 12px;
    margin-left: -12px;
    border-radius: 6px;
}

.lab-history-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.lab-history-date {
    font-weight: 600;
    color: #333;
    min-width: 80px;
}

.lab-history-purity {
    font-weight: 700;
    color: #2e7d32;
}

.lab-history-batch {
    color: #666;
    font-size: 0.9em;
}

.lab-latest-badge {
    background: #DC9814;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.lab-history-link {
    color: #DC9814;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    flex-shrink: 0;
}

.lab-history-link:hover {
    color: #b8821a;
    text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lab-result-card {
        flex-direction: column;
        gap: 20px;
        padding: 24px;
    }

    .lab-card-image {
        width: 260px;
        height: 260px;
        align-self: center;
        box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    }

    .lab-card-image img {
        border-radius: 12px;
    }

    .lab-product-name {
        font-size: 1.5em;
        text-align: center;
        margin-bottom: 12px;
    }

    .lab-latest-test {
        justify-content: center;
        text-align: center;
        font-size: 1em;
    }

    .lab-purity {
        font-size: 1.2em;
    }

    .lab-actions {
        justify-content: center;
        gap: 12px;
    }

    .lab-view-cert {
        font-size: 1em;
    }

    .lab-toggle-history {
        font-size: 0.95em;
    }

    .lab-history-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .lab-results-container {
        padding: 0 16px;
    }

    .lab-result-card {
        padding: 20px;
        gap: 24px;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    }

    .lab-results-header h1 {
        font-size: 1.9em;
        margin-bottom: 12px;
    }

    .lab-results-header p {
        font-size: 1.05em;
        line-height: 1.5;
    }

    .lab-card-image {
        width: calc(100% - 16px);
        max-width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        align-self: center;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        border-radius: 14px;
        background: #ffffff;
    }

    .lab-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 14px;
    }

    .lab-product-name {
        font-size: 1.6em;
        font-weight: 700;
        line-height: 1.2;
        margin-top: 4px;
        margin-bottom: 16px;
    }

    .lab-latest-test {
        font-size: 1.05em;
        gap: 10px;
    }

    .lab-purity {
        font-size: 1.3em;
        font-weight: 800;
    }

    .lab-separator {
        font-size: 0.9em;
    }

    .lab-date, .lab-batch {
        font-size: 0.95em;
    }

    .lab-view-cert {
        font-size: 1.05em;
        padding: 12px 20px;
        font-weight: 700;
    }

    .lab-toggle-history {
        padding: 10px 16px;
        font-size: 0.95em;
    }
}

/* Extra small phones (iPhone SE) */
@media (max-width: 375px) {
    .lab-results-container {
        padding: 0 12px;
    }

    .lab-result-card {
        padding: 18px;
        gap: 20px;
    }

    .lab-card-image {
        width: calc(100% - 12px);
    }

    .lab-product-name {
        font-size: 1.5em;
    }

    .lab-latest-test {
        font-size: 1em;
    }
}
