/* Results Cards Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

/* AEA Full Width */
.aea-full {
    margin-bottom: 8px;
}

/* Globulin Section Header */
.globulin-section-header {
    margin-bottom: 20px;
    padding: 0 4px;
}

.globulin-section-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.globulin-section-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Globulin 3-column Grid */
.globulin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Globulin Product Label */
.globulin-product-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--product-color, #1e293b);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.globulin-product-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: color-mix(in srgb, var(--product-color) 15%, white);
    color: var(--product-color);
}

.globulin-card::before {
    background: var(--product-color, #0d9488) !important;
}

/* Main Layout */
.lot-main {
    padding-top: 80px;
    min-height: 100vh;
}

/* Hero Section */
.lot-hero {
    position: relative;
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0d3331 100%);
    overflow: hidden;
}

.lot-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.lot-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
    animation: orbFloat 8s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #6366f1;
    bottom: -50px;
    left: -50px;
    animation: orbFloat 10s ease-in-out infinite reverse;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #f59e0b;
    top: 50%;
    left: 50%;
    animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.lot-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.lot-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(13, 148, 136, 0.2);
    border: 1px solid rgba(13, 148, 136, 0.4);
    border-radius: 50px;
    color: #5eead4;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease forwards;
}

.lot-hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    line-height: 1.3;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 50%, #14b8a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lot-hero-desc {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* Search Box */
.lot-search-box {
    animation: fadeInUp 0.6s ease 0.3s both;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 8px 8px 8px 24px;
    gap: 12px;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.search-icon {
    width: 22px;
    height: 22px;
    color: #64748b;
    flex-shrink: 0;
}

#lotInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.1rem;
    color: white;
    font-family: 'Noto Sans KR', sans-serif;
    padding: 12px 0;
    min-width: 0;
}

#lotInput::placeholder {
    color: #64748b;
}

.search-btn {
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.search-btn-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.search-btn:hover .search-btn-icon {
    transform: translateX(4px);
}

.search-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #64748b;
}

/* QR Scanner Section */
.search-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.qr-scan-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.qr-scan-btn:hover {
    background: rgba(13, 148, 136, 0.2);
    border-color: var(--primary-color);
    color: #5eead4;
    transform: translateY(-2px);
}

.qr-scan-btn svg {
    width: 20px;
    height: 20px;
}

.or-divider {
    color: #475569;
    font-size: 0.85rem;
}

/* QR Scanner Modal */
.qr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.qr-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.qr-modal-content {
    background: white;
    border-radius: 24px;
    padding: 32px;
    width: 95%;
    max-width: 420px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

.qr-modal-overlay.open .qr-modal-content {
    transform: scale(1) translateY(0);
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.qr-modal-header h3 {
    font-size: 1.2rem;
    color: #1e293b;
}

.qr-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.qr-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

#qr-reader {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
}

#qr-reader video {
    border-radius: 16px;
}

.qr-scan-guide {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* Loading State */
.search-loading {
    display: none;
    text-align: center;
    padding: 60px 0;
}

.search-loading.active {
    display: block;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Results Section */
.lot-results-section {
    padding: 40px 0 60px;
    background: var(--bg-light);
    animation: fadeInUp 0.5s ease;
}

/* LOT Info Header */
.lot-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 28px 36px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
}

.lot-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.lot-number {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
    margin-top: 4px;
}

.lot-info-right {
    display: flex;
    gap: 32px;
}

.lot-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.meta-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 4px;
}

/* Results Cards Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.aea-card::before {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.globulin-card::before {
    background: linear-gradient(90deg, #0d9488, #14b8a6);
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon svg {
    width: 24px;
    height: 24px;
}

.aea-icon {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #6366f1;
}

.globulin-icon {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    color: #0d9488;
}

.result-card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.result-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.result-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 20px;
}

.result-value {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    line-height: 1;
}

.result-unit {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Progress Bar */
.result-bar-wrapper {
    margin-bottom: 16px;
}

.result-bar {
    width: 100%;
    height: 10px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.result-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.aea-fill {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.globulin-fill {
    background: linear-gradient(90deg, #0d9488, #14b8a6);
}

.bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.bar-target {
    color: var(--primary-color);
    font-weight: 600;
}

/* Status Badge */
.result-status {
    margin-bottom: 16px;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-badge.excellent {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.status-badge.good {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.status-badge.normal {
    background: linear-gradient(135deg, #fef9c3, #fef08a);
    color: #854d0e;
}

.status-badge.low {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.result-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Detail Table */
.lot-detail-table-wrapper {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.detail-table-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.detail-table-scroll {
    overflow-x: auto;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.detail-table thead {
    background: #f8fafc;
}

.detail-table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.detail-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.detail-table tbody tr:hover {
    background: #f8fafc;
}

.detail-table tbody tr:last-child td {
    border-bottom: none;
}

.table-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.table-badge.pass {
    background: #dcfce7;
    color: #166534;
}

.table-badge.fail {
    background: #fee2e2;
    color: #991b1b;
}

/* Equipment Badge */
.lot-equipment-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 24px;
    margin-bottom: 16px;
}

.equip-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.equip-info {
    display: flex;
    flex-direction: column;
}

.equip-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.equip-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
}

/* Info Note */
.lot-note {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border: 1px solid #99f6e4;
    border-radius: 16px;
    padding: 20px 24px;
}

.note-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.note-content strong {
    display: block;
    margin-bottom: 4px;
    color: #0f766e;
    font-size: 0.95rem;
}

.note-content p {
    font-size: 0.85rem;
    color: #115e59;
    line-height: 1.6;
    margin: 0;
}

/* No Result Card */
.lot-no-result {
    padding: 80px 0;
}

.no-result-card {
    text-align: center;
    background: white;
    padding: 60px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 0 auto;
}

.no-result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.no-result-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.no-result-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Nav Active State */
.nav-active {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    position: relative;
}

.nav-active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .lot-hero {
        padding: 60px 0 40px;
    }

    .lot-hero-content h1 {
        font-size: 2rem;
        word-break: keep-all;
    }

    .lot-hero-desc {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    .search-input-wrapper {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .search-icon {
        display: none;
    }

    #lotInput {
        width: 100%;
        text-align: center;
        font-size: 1rem;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

    .search-actions {
        flex-direction: column;
    }

    .or-divider {
        display: none;
    }

    .lot-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 24px;
    }

    .lot-info-right {
        width: 100%;
        justify-content: space-between;
    }

    .lot-meta {
        align-items: flex-start;
    }

    .lot-number {
        font-size: 1.5rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .globulin-grid {
        grid-template-columns: 1fr;
    }

    .result-value {
        font-size: 2.5rem;
    }

    .lot-detail-table-wrapper {
        padding: 20px 16px;
    }

    .detail-table th,
    .detail-table td {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .lot-note {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .lot-hero-content h1 {
        font-size: 1.6rem;
    }

    .lot-badge {
        font-size: 0.75rem;
    }
}