/**
 * STABLE RELEASE 2.4.38.0 - styles.css
 * Features: Dynamic Viewport Height (dvh), Store-Download UI, and CSS-based Distributor Logo styling.
 */

:root {
    --brand-orange: #f39200;
    --brand-blue: #29abe2;
    --success-green: #15b77e;
    --danger-red: #ef4444;
    --warning-orange: #ffd8a5;
    --status-purple: #ad40ff;
    --text-color: #3a3a3a;
    
    /* Dynamic product bar color */
    --product-accent: #f39200;
    
    /* Strict font sizes based on px */
    --size-heading: 18px;
    --size-body: 16px;
    --size-list: 13px;
    --size-caption: 12px;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: #f8f9fa;
    color: var(--text-color);
    line-height: 1.4;
    padding: 10px;
    font-size: var(--size-body);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: -1;
    background-image: url("images/app-check-background.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: transform 0.4s ease-in-out;
}

.onboarding-body {
    min-height: 100dvh;
    overflow-y: auto;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 25px 15px;
    position: relative;
    border-radius: 10px;
}

.full-height {
    min-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
}

.container::before {
    content: ''; 
    position: absolute; 
    top: 0; left: 0; right: 0; height: 10px; 
    border-radius: 20px 20px 0 0;
    background: var(--product-accent);
}

.onboarding-body .container::before {
    background: transparent;
}

.back-btn {
    position: absolute;
    left: 11px;
    top: 23px;
    font-size: 24px;
    color: var(--product-accent);
    cursor: pointer;
    z-index: 20;
}

header { 
    text-align: center; 
    margin-bottom: 20px; 
    flex-shrink: 0;
}

h1 { 
    color: #666; 
    font-weight: 700;
    font-size: 30px;
}

.question {
    color: var(--brand-orange);
    font-weight: 700;
    margin-top: 5px;
    font-size: var(--size-heading);
    padding: 5px 25px;
}

.intro-text {
    color: var(--text-color);
    margin-top: 10px;
    padding: 0 25px;
}

header .selection-header {
    margin-top: 15px;
}

.selection-header {
    text-align: center;
    color: #3a3a3a;
}

.logo-icon { 
    font-size: 3rem; 
    color: #555; 
    margin-bottom: 5px; 
}

.body-font { font-size: var(--size-body); color: var(--text-color); }
.caption { font-size: var(--size-caption); color: #888; }
.bold { font-weight: 700; }
.text-white { color: white !important; }
.text-right { text-align: right; }

.brand-color { color: var(--brand-blue) !important; }

.result-box {
    padding: 22px; 
    border-radius: 15px; 
    text-align: center; 
    margin-bottom: 20px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.result-box i { font-size: 2.5rem; }
.result-box h2 { font-size: var(--size-heading); margin: 10px 0; }
.result-box p { font-size: var(--size-body); margin-bottom: 15px; }

.green  { background: var(--success-green); color: white; }
.red    { background: var(--danger-red); color: white; }
.purple { background: var(--status-purple); color: white; }
.blue   { background: var(--brand-blue); color: white; }

.green h2, .green p, .green i,
.red h2, .red p, .red i,
.purple h2, .purple p, .purple i,
.blue h2, .blue p, .blue i { 
    color: white; 
}

.orange { background: var(--warning-orange); color: #7e3e00; }
.orange h2, .orange p, .orange i { 
    color: #7e3e00; 
}

.support-text {
    text-align: left; background: #fffcf8; padding: 15px; border-radius: 10px;
    font-size: var(--size-body); line-height: 1.5; color: var(--text-color);
}
.support-text a { color: var(--brand-blue); text-decoration: underline; }

.video-embed-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 25px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.video-embed-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.device-card {
    background: #fff; 
    border: 1px solid #f0f0f0; 
    border-radius: 15px; 
    padding: 15px; 
    margin-bottom: 20px;
}

.device-table { 
    width: 100%; 
    border-collapse: collapse; 
}

.device-table td {
    padding: 0 5px 5px 0;
    vertical-align: top;
}

.label-cell {
    color: #888;
    font-weight: bolder;
}

.hidden-details { 
    margin-top: 10px; 
    padding-top: 10px; 
    border-top: 1px dashed #eee; 
    display: none; 
}

.detail-table td { 
    font-size: var(--size-body); 
}

.search-container {
    margin-top: 15px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 45px 15px 15px; 
    border-radius: 25px;
    border: 1px solid #ddd;
    font-size: var(--size-body);
    outline: none;
}

.search-clear-btn {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    color: #ededed;
    cursor: pointer;
    display: none; 
    font-size: 2rem;
    transition: color 0.2s;
    z-index: 10;
}

.search-clear-btn:hover {
    color: #999;
}

.search-results {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: absolute;
    width: 100%;
    z-index: 100;
    max-height: 350px; 
    overflow-y: auto; 
    margin-top: 5px;
    text-align: left;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-color);
    font-size: var(--size-body); 
}

.search-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.search-item:hover {
    background: #f8f9fa;
    color: var(--brand-blue);
}

.whitelist-section {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 15px;
    background: #fff;
}

.whitelist-brand-group {
    margin-bottom: 12px; 
}

.whitelist-brand-title {
    font-size: 16px;
    font-weight: bolder;
    color: var(--text-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.whitelist-model-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    font-size: var(--size-list); 
    color: #666;
}

.whitelist-label-text {
    color: #29abe2;
}

.whitelist-icon {
    margin-right: 5px;
}

.btn {
    width: 100%; 
    padding: 14px; 
    border-radius: 50px; 
    border: none; 
    font-size: var(--size-body); 
    font-weight: 400; 
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.btn-primary { 
    background: var(--brand-blue); 
    color: white; 
}

.btn-share {
    background: #29abe2;
    border: 0;
    color: #ffffff;
    padding: 6px 25px;
    border-radius: 50px;
    font-size: var(--size-body);
    display: block;
    margin: 0 auto 30px auto;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.qr-section {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 15px;
}

#qr-code-image {
    margin-top: 20px;
    text-align: center;
}

#qr-code-image img { 
    margin: 0 auto; 
    width: 130px; 
    border: 1px solid #eee; 
    padding: 5px; 
    border-radius: 8px; 
}

footer { 
    text-align: center; 
    margin-top: auto; 
    padding-top: 10px;
    flex-shrink: 0;
    opacity: 0.8; 
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--brand-blue);
}

.product-list {
    margin-top: 5px;
    flex-grow: 1;
    overflow-y: visible;
    margin-bottom: 0px;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 2px;
    padding-right: 15px;
    border: none;
    border-radius: 50px;
    margin-bottom: 10px;
    cursor: pointer;
    text-decoration: none;
}

.product-thumb {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 2px;
    flex-shrink: 0;
}

.product-name {
    flex-grow: 1;
    line-height: 1.2;
    color: white;
}

.product-arrow {
    font-size: 24px;
    flex-shrink: 0;
    color: white;
}

.lang-toggle {
    position: absolute;
    right: 10px;
    top: 21px;
    width: 25px;
    height: 25px;
    background: #32aedf; 
    color: #ffffff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    z-index: 20;
}

.onboarding-body .lang-toggle {
    background: linear-gradient(90deg, #ffc20e 0%, #f7941d 100%);
}

.product-thumb-header {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.switcher-section {
    margin-top: 20px;
    margin-bottom: 15px;
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 15px;
}

.switcher-grid {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
}

.switcher-item {
    text-decoration: none;
    transition: transform 0.2s;
    display: grid;
    justify-items: center;
    color: inherit;
}

.switcher-item:hover {
    transform: scale(1.1);
}

.switcher-thumb {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: white;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    border: 3px solid transparent;
    margin-bottom: 5px;
}

.registered-symbol {
    vertical-align: super;
    font-size: smaller;
    line-height: 0;
    display: inline-block;
    transform: translateY(2px);
}

.instruction-text {
    color: #666;
    margin: 10px 0;
    padding: 0 25px;
}

.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.6); 
    z-index: 10000; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
    box-sizing: border-box; 
    backdrop-filter: blur(4px);
}

.modal-card { 
    background: white; 
    width: 100%; 
    max-width: 800px; 
    max-height: 85vh; 
    border-radius: 15px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
    position: relative; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
}

.modal-close { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: #eee; 
    border-radius: 50%; 
    width: 35px; 
    height: 35px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    color: #666; 
    transition: background 0.2s, color 0.2s; 
    z-index: 10;
}

.modal-close:hover { 
    background: var(--brand-orange); 
    color: white; 
}

.modal-content { 
    padding: 40px; 
    overflow-y: auto; 
    text-align: left; 
}

.modal-content h1 { 
    color: #666; 
    font-size: 1.5rem; 
    margin-bottom: 20px; 
    border-bottom: 2px solid var(--brand-orange); 
    padding-bottom: 10px; 
}

.modal-content h2 { 
    color: var(--brand-orange); 
    font-size: 1.1rem; 
    margin-top: 25px; 
    margin-bottom: 10px; 
}

.modal-content p { 
    font-size: 14px; 
    line-height: 1.6; 
    margin-bottom: 15px; 
    color: #333; 
}

.sync-timestamp {
    display: block;
    font-size: var(--size-list);
    font-weight: bold;
    margin-top: 15px;
}

.dist-logo-wrapper {
    display: none;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 10px;
}

.dist-logo-img {
    max-height: 35px;
    width: auto;
    margin: 0 auto;
    display: block;
}

/**
 * STORE DOWNLOAD UI STYLES
 */
.download-icon-stores {
    cursor: pointer;
    transition: opacity 0.2s;
    mix-blend-mode: screen;
    height: 75px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.download-icon-stores:hover {
    opacity: 0.8;
}

/* Apple Badge height alignment */
.badge-apple {
    height: 50px;
}

/* Google Badge height alignment (higher to compensate for internal padding) */
.badge-google {
    height: 75px;
}

@media screen and (orientation: landscape) {
    body::before {
        width: 100vh;
        height: 100vw;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(90deg);
    }

    .container {
        width: 100%;
        max-width: 400px;
        margin: 20px auto;
        position: relative;
        z-index: 1;
    }

    body {
        background-attachment: fixed;
        overflow-y: auto;
    }

    .onboarding-body {
        height: unset;
    }
}