﻿
.layout-container {
    display: flex;
    flex-direction: column;
    min-height:100vh;
    height: auto;
    margin-top: 14px;
}
.top-brand-box {
    width: 100%;
}
.brand-list{
    padding-left: 10px;
    padding-right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(5px, 1vw, 10px);
    justify-content: center;
}
.brand-section {
    width: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}
.empty-section {
    width: 69%;
    background: red;
}
.comparison-section {
    width: 100%;
    margin: 10px 0 0 0;
}
@media (max-width: 768px) {
    .top-brand-box {
        display: none;
    }
}
.comparison-container {
    background: var(--bg-primary);
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.spec-row {
    display: grid;
    grid-template-columns: 0.6fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--bg-maincontent);
}
.spec-row > div {
    padding: 0;
   font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    hyphens: auto;
}
.spec-row > div:last-child {
    border-right: none;
}
.spec-row > div:nth-child(3), 
.spec-row > div:nth-child(4)  {
    border-left: 1px solid var(--color-card-borderbottom);
}
.spec-label {
    color: red;
        text-transform: uppercase;
    font-weight: 600;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-row {
    font-weight: 500;
    height: clamp(240px, calc(240px + (100vw - 768px) * 0.2108433735), 310px);
}
.header-with-search {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    min-height: 90px;
    position: relative;
    overflow: visible;
}
.search-box-container {
    position: relative;
    width: 100%;
    z-index: 30;
    overflow: visible;
}
.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--color-card-borderbottom);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    transform: translateY(-1px);
}
.search-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}
.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 999;
}
.search-results {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    z-index: 1000;
    top: 100%;
    left: 0;
}
.spec-row.header-row > div.header-with-search { padding: 5px; }
.search-result-item {
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}
.search-result-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.search-result-item:last-child {
    border-bottom: none;
    margin-bottom: 50px;
}
.search-result-image {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    border-radius: 4px;
}
.search-result-text {
    flex: 1;
}
.search-result-model {
    font-weight: 500;
    color: var(--text-primary);
}
.search-result-brand {
    font-size: 12px;
    color: var(--text-secondary);
}
.device-info-container {
    min-height: 60px;
    overflow: hidden;
    width: 100%;
}
.selected-device-card {
    width: 100%;
    height: clamp(250px, 20vh, 360px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.selected-device-card .seldev-t1 {
    flex: 0 0 10%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
}
.selected-device-card .seldev-t2 {
    flex: 1 1 90%;
    display: flex;
    width: 100%;
}
.selected-device-card .seldev-a {
    width: 60%;
    height: 100%;
    padding: 4px;
    box-sizing: border-box;
}
.selected-device-card .seldev-a img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
}
.selected-device-card .seldev-b {
    width: 40%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    align-items: stretch;
    overflow: hidden;
    padding: 4px 2px;
    position: relative;
}
.selected-device-card .seldev-btn {
    display: inline-flex;
    text-transform: uppercase;
    align-items: center;
    justify-content: start;
    width: 100%;
    margin: 0;
    height: clamp(32px, 5.5vw, 30px);
    color: var(--text-primary);
    font-size: clamp(7px, 1.2vw, 11px);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.selected-device-card .seldev-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    transform: translateY(-1px);
}
.selected-device-card .seldev-btn:active {
    transform: translateY(0);
}
.selected-device-card .seldev-b .seldev-btn:nth-child(1) {
    margin-top: 2px;
}
.selected-device-card .seldev-b .seldev-btn:nth-child(2) {
    margin-top: 2px;
}
.selected-device-card .seldev-b .seldev-btn:nth-child(3) {
    margin-top: 2px;
}
.selected-device-card .seldev-b .seldev-btn.placeholder {
    visibility: hidden;
    background: transparent;
    border: 1px dashed var(--border-color);
    box-shadow: none;
}
.selected-device-card .seldev-b .seldev-btn:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}
.selected-device-card .remove-device-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    margin: 0;
}
.spec-row > div:first-child:not(.spec-label){
    font-weight: 600;
}
.selected-device {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}
.remove-device-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    margin: 0;
}
.remove-device-btn:hover {
    color: #c82333;
}
@media (max-width: 768px) {
    .spec-row > div:nth-child(4),
    #device-3-header,
    [id^="device-3-"],
    [id*="-3-"] {
        display: none !important;
    }
    .spec-row.header-row {
        grid-template-columns: 1fr 1fr;
        height: clamp(280px, 35vh, 400px);
    }
    .spec-row.header-row > div:first-child {
        display: none !important;
    }
    .spec-row:not(.header-row) {
        grid-template-columns: 0.6fr 1fr 1fr;
    }
    .spec-row > div {
        font-size: 12px;
        padding: 4px 6px;
    }
    .spec-label {
        font-size: 14px;
        padding: 5px 6px;
    }
    .search-input {
        font-size: 13px;
        padding: 8px 12px;
    }
    .selected-device-card {
        height: 100%;
    }
    .selected-device-card .seldev-t1 {
        font-size: 13px;
        flex: 0 0 auto;
        min-height: 32px;
        padding: 6px 8px;
    }
    .selected-device-card .seldev-t2 {
        flex-direction: column;
        flex: 1 1 auto;
        overflow: hidden;
    }
    .selected-device-card .seldev-a {
        width: 100%;
        height: 60%;
        flex: 0 0 60%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
    }
    .selected-device-card .seldev-a img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }
    .selected-device-card .seldev-b {
        width: 100%;
        height: 40%;
        flex: 0 0 40%;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 4px;
        justify-content: center;
        align-items: center;
        overflow: visible;
    }
    .selected-device-card .seldev-btn {
        font-size: clamp(10px, 2.5vw, 13px);
        height: auto;
        flex: 0 0 auto;
        width: 100%;
        justify-content: start;
    }
    .selected-device-card .seldev-b .seldev-btn:nth-child(1),
    .selected-device-card .seldev-b .seldev-btn:nth-child(2),
    .selected-device-card .seldev-b .seldev-btn:nth-child(3) {
        margin-top: 0;
    }
}
.debug-log {
    position: fixed;
    bottom: 0;
    right: 0;
    background: black;
    color: #00ff00;
    padding: 8px;
    width: 384px;
    height: 256px;
    overflow: auto;
    opacity: 0.75;
    font-size: 12px;
    font-family: monospace;
    display: none;
}
.debug-log.show {
    display: block;
}
.loading-indicator {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.loading-content {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.notification {
    position: fixed;
    bottom: 16px;
    right: 16px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    color: white;
}
.notification.error {
    background: #ef4444;
}
.notification.success {
    background: #10b981;
}
.notification.info {
    background: #3b82f6;
}
.spec-label .network-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: transparent;
    color: var(--text-primary);
    border: transparent;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
    font-size: 12px;
}
.network-toggle:hover {
    background: rgba(0,0,0,0.04);
    border-color: var(--text-secondary);
}
.spec-row.spec-label.network-clickable:hover .network-toggle {
    background: rgba(0,0,0,0.04);
    border-color: var(--text-secondary);
}
.network-toggle .toggle-arrow {
    display: inline-block;
    transition: transform .2s ease;
}
.network-toggle[aria-expanded="true"] .toggle-arrow {
    transform: rotate(180deg);
}
.spec-row.spec-label.network-clickable {
    cursor: pointer;
}
.network-band-row {
    overflow: hidden;
    transition: height .25s ease, padding .25s ease, opacity .2s ease, margin .25s ease;
}
.network-band-row.is-collapsed {
    height: 0 !important;
    opacity: 0;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    display: none !important;
    right: 0;
}
.network-band-row.is-collapsed td {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    right: 0;
}
.spec-row > div ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.spec-row > div li {
    padding: 2px 0;
    margin: 0;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-color);
}
.spec-row > div li:last-child {
    border-bottom: none;
}
.hidden {
    display: none !important;
}
@media (max-width: 480px) {
    .spec-row > div {
        font-size: 11px;
        padding: 3px 4px;
    }
    .spec-label {
        font-size: 13px;
        padding: 4px 5px;
    }
    .spec-row > div:first-child:not(.spec-label) {
        font-size: clamp(9px, 3vw, 11px);
    }
    .network-toggle {
        font-size: 10px;
        padding: 4px 6px;
    }
}
