:root {
    /* GM3 Seed Color: Google Blue (#0b57d0) */
    --md-sys-color-primary: #0b57d0;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d3e3fd;
    --md-sys-color-on-primary-container: #041e49;
    
    --md-sys-color-secondary: #0b57d0;
    
    /* GM3 Surfaces */
    --md-sys-color-surface: #ffffff;
    --md-sys-color-surface-container-lowest: #ffffff;
    --md-sys-color-surface-container-low: #f8fbff;
    --md-sys-color-surface-container: #f0f4f9;
    --md-sys-color-surface-container-high: #e9eff6;
    --md-sys-color-surface-container-highest: #dde4ed;
    
    --md-sys-color-outline: #74777f;
    --md-sys-color-outline-variant: #c4c6cf;
    
    /* Typography Weights & Families */
    --md-sys-typescale-font-family: "Google Sans", "Product Sans", Inter, Roboto, sans-serif;
    
    /* Shape Elevations */
    --md-sys-shape-corner-none: 0px;
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 9999px;
}

body {
    font-family: var(--md-sys-typescale-font-family);
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background-color: var(--md-sys-color-surface);
    color: #1f1f1f;
    overflow: hidden;
}

#mainContainer {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#topBar {
    height: 64px; /* Standard GM3 AppBar height */
    min-height: 64px;
    padding: 8px;
    padding-left: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: var(--md-sys-color-surface-container-low);
    box-sizing: border-box;
}

#title {
    font-size: 22px;
}

#googleLogo {
    background-image: url(../img/internal/google.svg);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 74px;
    height: 100%;
    margin-right: 16px;
}

#middleSection {
    display: flex;
    flex-direction: row;
    align-self: stretch;
    flex-grow: 1;
    overflow: hidden;
}

#sideBar {
    background-color: var(--md-sys-color-surface-container-low);
    width: 80px; /* Standard GM3 Rail width */
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 4px;
    cursor: pointer;
    background-color: transparent;
    width: 100%;
}

.nav-item:hover,
.nav-item.selected {
    background-color: transparent;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 32px;
    border-radius: 16px;
    transition: background-color 0.2s ease;
    color: #444746;
}

.nav-item:hover .nav-icon {
    background-color: rgba(68, 71, 70, 0.08);
}

.nav-item.selected .nav-icon {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.nav-item.selected .nav-icon span {
    font-variation-settings: 'FILL' 1;
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #444746;
}

.nav-item.selected .nav-label {
    color: #1f1f1f;
    font-weight: 700;
}

#contentSection {
    flex: 1;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

#checkSection, #aboutSection, #detailsSection {
    margin: 24px;
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 24px;
    gap: 12px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#checkSection, #aboutSection {
    max-width: 600px;
    width: 50vw;
}

#detailsSection {
    width: 380px;
    margin-left: 0; /* Align tight to the right of checkSection */
    display: none;
}

#detailsSection:not(.hidden) {
    display: flex;
}

#checkSection {
    min-height: calc(100vh - 64px - 48px);
}

#aboutSection {
    scroll-behavior: smooth;
}

.toc-link {
    font-size: 16px;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
}

.toc-link:hover {
    color: var(--md-sys-color-on-primary-container);
    text-decoration: underline;
}

.topic-header {
    font-size: 24px;
    font-weight: 400;
    width: calc(100% - 20px);
    color: #1f1f1f;
    line-height: 32px;
    margin-bottom: 8px;
    font-family: 'Google Sans', 'Google Sans Text', Roboto, sans-serif;
}

#checkSectionNav {
    font-size: 14px;
    min-height: 48px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-left: 16px; 
    padding-right: 16px;
}

#checkSectionNav > div {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--md-sys-shape-corner-full);
    transition: background-color 0.2s ease, color 0.2s ease;
    color: #444746;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

#checkSectionNav > div:hover {
    background-color: rgba(68, 71, 70, 0.08);
}

#checkSectionNav > div.selected {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 600;
}

b {
    display:inline-block;
    background-color:white;
    padding:4px;
    padding-left:8px;
    padding-right: 8px;
    border-radius:8px;
}

#instructions{
    display:flex;
    padding:16px;
    flex-direction: column;
    gap:32px;

}

.page {
    max-width: 600px;
    display: flex;
}

.hidden {
    display: none !important;
}

.selected {
    font-weight: bold;
}

.bigText {
    font-size: 32px;
    font-weight: 400;
    color: #1f1f1f;
    line-height: 40px;
    margin-bottom: 8px;
    font-family: 'Google Sans', 'Google Sans Text', Roboto, sans-serif;
}
.regText {
    font-size: 16px;
}
.centerer {
    /*background-color: rgba(0,0,128,0.02);*/
    width:100%;
    padding:16px;
    display: block;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrCode {
    /*background-image: url(../img/qrcode.svg);*/ /* Replaced with inline variable */
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    width: 400px;
    height: 400px;
    /*margin-left: calc(50% - 200px); /* Fixed unit */
    background-color: white;
    border-radius: 48px;
}

#status, #statusError, #statusContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

/* Material Status Card */
.status-card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Elevated shadow instead of border */
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.status-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.status-icon.success {
    background-color: #c4eed0;
    color: #0f5223;
}

.status-title {
    font-size: 24px;
    font-weight: 500;
    color: #1f1f1f;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #757575;
    font-size: 14px;
}

.detail-value {
    color: #1f1f1f;
    font-weight: 500;
    font-size: 14px;
}

.detail-value.verified {
    color: #0b8043;
}

/* Circular Loader for Pending */


#pending {
    display: flex;
    flex: 1;
}
#pending .centerer {
    /*height: 100%;*/
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    height:100%;
}

.circular-loader {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #0b57d0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 16px;
    color: #444746;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Verification Accordions */
.status-summary {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--md-sys-color-surface-container-low, #f0f0f0);
    border-radius: var(--md-sys-shape-corner-full);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 24px;
}

.summary-shield {
    display: flex;
    align-items: start;
    justify-content: center;
}

.summary-shield .material-symbols-outlined {
    font-size: 24px;
    color: #1f1f1f;
}

.summary-text {
    font-size: 16px;
    color: #1f1f1f;
    font-weight: 500;
}

.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Slight separation between the unified items */
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.accordion-item {
    background-color: transparent;
    border-radius: 20px; /* Modern pill/rounded aesthetic upon hover */
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.accordion-item:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align to the top of the robust text block */
    padding: 16px 20px; 
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-item.active .accordion-header {
    /* No forced header background, keep it seamless */
}

.header-main {
    display: flex;
    align-items: flex-start; /* Align icon with the top of the title */
    gap: 16px; 
}

.check-icon.success {
    color: #1e8e3e; /* Google Verify Green */
    width: 24px;
    height: 24px;
    margin-top: 4px; /* Mathematically center against the 32px line-height font */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-variation-settings:
        'FILL' 1,
        'ROND' 100,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;

}

.material-symbols-outlined {
    font-family: "Google Symbols";
}

.material-symbols-outlined.filled {

    font-variation-settings: 'FILL' 1;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.check-certified-title, .check-build-title, .check-bootloader-title, .check-root-title {
    font-size: 24px;
    font-weight: bold;
    color: #1f1f1f;
    line-height: 32px;
    font-family: 'Google Sans', 'Google Sans Text', Roboto, sans-serif;
}

.check-certified-status, .check-build-status, .check-bootloader-status, .check-root-status {
    font-size: 16px;
    color: #444746;
}

.text-green { color: #1e8e3e; font-weight: bold; }
.text-yellow { color: #fbbc04; font-weight: bold; }
.text-gray { color: #747775; font-weight: bold; }

.chevron {
    font-size: 24px;
    color: #444746;
    margin-top: 4px; /* Align to top text baseline */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: transparent;
}

.accordion-item.active .accordion-content {
    /* Inner border rule removed */
}

.content-inner {
    padding: 8px 20px 24px 60px; /* Aligned precisely with header title */
    font-size: 16px; /* Slightly elevated to bridge the gap with the 24px title */
    color: #444746;
    line-height: 1.5;
}

/* Error Status Layout Components */
.error-summary {
    display: flex;
    flex-direction: row;
    align-items: start;
    justify-content: flex-start;
    padding: 16px 20px;
    background-color: var(--md-sys-color-surface-container-lowest, #ffffff);
    border-radius: 20px;
    margin-bottom: 24px;
    gap: 16px;
}

.error-title {
    font-family: 'Google Sans', 'Google Sans Text', Roboto, sans-serif;
    font-size: 24px;
    /*font-weight: 500;*/
    color: #1f1f1f;
}

.error-desc {
    font-size: 16px;
    color: #444746;
    line-height: 1.4;
    margin-bottom: 8px;
}

.check-icon.warning {
    color: #fbbc04; /* Yellow icon matching the mockup */
    width: 24px;
    height: 24px;
    margin-top: 4px; /* Mathematically center against the 32px line-height font */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-variation-settings:
        'FILL' 1,
        'ROND' 100,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

.check-icon.gray {
    color: #747775; /* Google Gray */
    width: 24px;
    height: 24px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-variation-settings:
        'FILL' 1,
        'ROND' 100,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

.outline-btn {
    display: inline-flex;
    margin-top: 16px;
    background-color: transparent;
    color: #444746;
    font-family: 'Google Sans', 'Google Sans Text', Roboto, sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid #747775;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.outline-btn:hover {
    background-color: var(--md-sys-color-surface-variant, #e1e3e1);
}

.details-header {
    display: flex;
    justify-content: flex-end;
    /* width: 100%; */
    /* margin-bottom: 8px; */
    position: absolute;
    right: 20px;
    top: 20px;
}
.close-icon {
    font-size: 20px !important;
    position: absolute;
    width: 24px;
    text-align: center;
}

/* Device Identifiers Section */
.device-identifiers-section {
    width: 100%;
    max-width: 600px;
    margin-top: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.di-title {
    font-size: 16px;
    color: #444746;
    font-weight: 500;
    padding-left: 0;
}

.di-card-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.di-card {
    background-color: var(--md-sys-color-surface-container-lowest, #ffffff);
    padding: 16px 20px;
    display: flex;
    flex-direction: row;
    align-items: start;
    gap: 16px;
}

.di-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.di-card-icon {
    font-size: 24px;
    color: #444746;
    flex-shrink: 0;
}

.di-card:first-child {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.di-card:not(:first-child):not(:last-child) {
    border-radius: 4px;
}

.di-card:last-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.di-card-title {
    font-size: 24px;
    color: #1f1f1f;
    font-family: 'Google Sans', 'Google Sans Text', Roboto, sans-serif;
}

.di-card-value {
    font-size: 16px;
    color: #444746;
    word-break: break-all;
}

.di-warning {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px 16px 20px;
    border-radius: 20px;
    background-color: #FFEEAC;
}

.di-warning-icon {
    color: #fbbc04;
    font-size: 24px;
}

.di-warning-text {
    font-size: 16px;
    color: #8c5000;
    line-height: 1.5;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
    /* Top Bar Simplification */
    #topBar {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Convert SideBar to Bottom Navigation */
    #sideBar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 80px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0;
        z-index: 90;
        border-top: 1px solid var(--md-sys-color-surface-container-highest);
        background-color: var(--md-sys-color-surface-container-low);
    }
    
    .nav-item {
        width: auto;
        padding: 0 16px;
        height: 100%;
    }

    /* Update Content Section to block layout and full width */
    #contentSection {
        display: block;
    }

    /* Standardize main surface cards for mobile full-width */
    #checkSection, #aboutSection {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        padding-bottom: 100px; /* offset for bottom navigation */
        min-height: 100vh;
    }

    #qrCode {
        width: 80vw;
        height: 80vw;
        max-width: 400px;
        max-height: 400px;
        margin: 0 auto;
    }

    /* Backdrop styling */
    #modalBackdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 100;
    }
    
    #modalBackdrop.hidden {
        display: none !important;
    }

    /* Details Section as a Modal Dialog */
    #detailsSection {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100% - 32px) !important;
        max-width: 400px;
        max-height: 80vh;
        margin: 0 !important;
        z-index: 101;
        box-shadow: 0 4px 24px rgba(0,0,0,0.3);
        overflow-y: auto;
        border-radius: 28px; /* Material 3 modal style */
    }
}
