
.results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch;
}


.result-image-card {
    position: relative;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 400px;
    max-height: 520px; 
}

.result-image-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    z-index: 1;
}

.reset-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.2s;
}

.reset-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(-30deg);
}

.filename-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 14px;
    z-index: 5;
    backdrop-filter: blur(8px);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.scanner-container {
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: rgba(8, 0, 13, 0.7); 
    backdrop-filter: blur(5px);
}

.scanner-line {
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 3px;
    background: var(--color-purple-light);
    box-shadow: 0 0 15px var(--color-purple-light);
    animation: scan 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.scanner-overlay {
    position: absolute; 
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(147, 51, 234, 0.15) 50%, transparent);
    animation: scan-bg 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loading-text {
    color: #fff; 
    font-size: 16px; 
    font-weight: 600; 
    z-index: 11;
    animation: pulse 1.5s infinite; 
    letter-spacing: 1px;
}

@keyframes scan { 0% { top: -5%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 105%; opacity: 0; } }
@keyframes scan-bg { 0% { transform: translateY(-100%); opacity: 0;} 10% { opacity: 1;} 90% { opacity: 1;} 100% { transform: translateY(100%); opacity: 0;} }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }


.result-stats-card {
    background: linear-gradient(135deg, rgba(90, 10, 45, 0.2) 0%, rgba(65, 15, 75, 0.2)  100%);
    border: 1px solid rgba(180, 30, 80, 0.3);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.label-small {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.highest-match {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-crimson-light);
    font-size: 14px;
    font-weight: 500;
    margin-top: 6px;
}

.percent-badge {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid rgba(232, 48, 96, 0.4);
    background: rgba(232, 48, 96, 0.08);
    box-shadow: 0 0 20px rgba(232, 48, 96, 0.15);
}

.top-style-title {
    font-size: 46px;
    font-weight: 700;
    margin: 32px 0 8px 0;
    background: linear-gradient(90deg, #fff, var(--color-purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.top-style-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
    margin-bottom: 24px;
}

.progress-section {
    margin-bottom: 32px;
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-crimson-dark), var(--color-purple-light));
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Secondary Matches */
.secondary-matches {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.match-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.match-name {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

.match-pct {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.detailed-analysis-card {
    padding: 20px 28px;
    margin-bottom: 40px;
    
    background: linear-gradient(135deg, rgba(90, 10, 45, 0.2) 0%, rgba(65, 15, 75, 0.2)  100%);
    border: 1px solid rgba(180, 30, 80, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.detailed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}

.detailed-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
}

.detailed-title svg {
    color: var(--color-crimson-light);
}

.detailed-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    font-family: monospace;
    transition: color 0.2s;
}

.detailed-header:hover .detailed-hint {
    color: rgba(255, 255, 255, 0.6);
}

/* --- Detailed 24 Styles Table --- */
.styles-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(180, 30, 80, 0.2); 
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 12px 32px;
}

.styles-list.hidden {
    display: none;
}

.style-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.style-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(4px); 
}

.style-name-col {
    width: 135px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.style-bar-bg {
    flex-grow: 1;
    height: 6px; 
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.style-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg, 
        var(--color-purple-light) 0%, 
        var(--color-purple-dark) 35%, 
        var(--color-burgundy) 75%, 
        var(--color-crimson-dark) 100%
    );
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(122, 18, 72, 0.4);
}

.style-percent-col {
    width: 48px;
    text-align: right;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    font-family: monospace; 
}

@media (max-width: 1200px) {
    .result-stats-card {
        padding: 30px;
    }

    .top-style-title {
        font-size: 40px;
    }

    .styles-list {
        gap: 10px 20px;
    }

    .style-name-col {
        width: 115px;
    }
}

@media (max-width: 992px) {
    .results-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .result-image-card {
        min-height: 350px;
        max-height: 500px;
    }

    .result-stats-card {
        min-height: 400px;
    }

    .styles-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .result-image-card {
        min-height: 300px;
        max-height: 450px;
        border-radius: 16px;
    }

    .result-stats-card {
        padding: 24px;
        border-radius: 16px;
    }

    .stats-header {
        gap: 15px;
    }

    .percent-badge {
        font-size: 21px;
        padding: 7px 14px;
    }

    .top-style-title {
        font-size: 34px;
        margin-top: 26px;
    }

    .top-style-desc {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .progress-section {
        margin-bottom: 25px;
    }

    .secondary-matches {
        gap: 8px;
    }

    .match-box {
        padding: 12px 6px;
    }

    .detailed-analysis-card {
        padding: 16px 20px;
        margin-bottom: 30px;
    }

    .detailed-header {
        gap: 15px;
    }

    .detailed-title {
        font-size: 14px;
    }

    .detailed-hint {
        font-size: 11px;
        text-align: right;
    }

    .styles-list {
        gap: 8px;
    }

    .style-row {
        gap: 10px;
        padding: 8px 10px;
    }

    .style-name-col {
        width: 100px;
        font-size: 12px;
    }

    .style-percent-col {
        width: 42px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .result-image-card {
        min-height: 240px;
        max-height: 360px;
    }

    .reset-btn {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .filename-badge {
        bottom: 10px;
        left: 10px;
        max-width: 70%;
        font-size: 10px;
        padding: 5px 10px;
    }

    .result-stats-card {
        padding: 18px;
    }

    .stats-header {
        align-items: center;
    }

    .label-small {
        font-size: 9px;
        letter-spacing: 1px;
    }

    .highest-match {
        font-size: 12px;
    }

    .percent-badge {
        font-size: 18px;
        padding: 6px 11px;
    }

    .top-style-title {
        font-size: 28px;
        margin-top: 22px;
    }

    .top-style-desc {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .secondary-matches {
        flex-wrap: wrap;
    }

    .match-box {
        min-width: calc(50% - 4px);
        box-sizing: border-box;
    }

    .detailed-analysis-card {
        padding: 12px 14px;
    }

    .detailed-title {
        font-size: 13px;
    }

    .detailed-title svg {
        width: 16px;
        height: 16px;
    }

    .detailed-hint {
        display: none;
    }

    .styles-list {
        margin-top: 15px;
        padding-top: 15px;
    }

    .style-row {
        gap: 8px;
        padding: 7px 8px;
    }

    .style-name-col {
        width: 80px;
        font-size: 11px;
    }

    .style-percent-col {
        width: 36px;
        font-size: 11px;
    }
}