html {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: linear-gradient(#3523ae,#1c0446) fixed;
}

body {
    letter-spacing: 0.3px;
    color: #333;
    margin: auto;
    max-width: 1200px;
    min-height: 100%;
}

[client="pico"] [hide-pico],
[client="nano"] [hide-nano],
[client="light"] [hide-light],
[client="full"] [hide-full] {
    display: none;
}

header {
    margin: auto;
    margin-bottom: 25px;
    text-align: center;
    display: flex;
    color: white;
    justify-content: center;
    align-items: center;
}

header .name {
    line-height: 85px;
    font-size: 62px;
    font-family: sans-serif;
    font-weight: bold;
}

header .icon-krypton::before {
    content: '';
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    margin-right: 15px;
    display: inline-block;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    position: relative;
    top: 2px;
}

header .subheader {
    padding-bottom: 3px;
    padding-left: 8px;
    width: 227px;
}

header .subtitle {
    font-size: 15px;
    letter-spacing: 2px;
    position: absolute;
    top: 80px;
}


#client-types {
    display: flex;
    justify-content: space-between;
}

#client-types .client-link-container {
    /* to avoid that the page jumps to the selected anchor target */
    padding-top: 96px;
}

#client-types a {
    text-decoration: none;
    color: rgba(255,255,255,0.6);
}

#client-types .client-link-container:target a {
    font-weight: bold;
    color: white;
}

input,
select {
    max-width: 92%;
    border-radius: 3px;
    padding: 10px 10px;
    line-height: 1;
    background-color: #FFF;
    border: 1px solid #EEE;
    font-size: 14px;
}

select {
    padding: 9px 6px;
}

button {
    border: 0;
    border-radius: 3px;
    display: inline-block;
    text-align: center;
    background: #1c0446;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1;
    padding: 12px 50px;
    box-sizing: border-box;
    outline: none;
    cursor: pointer;
}

button:hover {
    background: #43A047;
    color: #FFF;
}

button:disabled {
    pointer-events: none;
    opacity: 0.4;
    cursor: auto;
}

button.greenbutton {
    background-color: #2dad2d;
    opacity: 0.8;
    transition: all 0.2s;
}

button.greenbutton:hover {
    opacity: 1;
}

input.error {
    border: 1px solid #f44336;
}

hash {
    font-size: 12px;
    font-family: monospace;
}

.f-left {
    float: left;
}

.f-right {
    float: right;
}

.clr-both {
    clear: both;
}


/* Main UI */

.main {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
}

.left, .right {
    float: left;
    width: 50%;
}

@media (max-width: 768px) {
    .left, .right {
        width: 100%;
    }
}

.main > .info {
    width: 100%;
}
.info {
    margin: 0 10px 15px 10px;
    font-size: 15px;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
    overflow: hidden;
}

.info.collapsed .info-block, .info.collapsed .input-group, .info.collapsed form {
    display: none;
}

.info hr {
    padding: 0;
    margin: 0;
    border: 3px solid rgba(255, 255, 255, 0.89);
}

.info hr.morespace {
    border: 6px solid rgba(255, 255, 255, 0.89);
}

.info-block {
    padding: 6px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: rgba(255, 255, 255, 0.89);
    color: #000;
    letter-spacing: 0.3px;
}

.info-block:empty {
    padding: 0;
}

.info-block strong {
    display: inline-block;
}

.info-title {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #FFF;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.info-title::before,
.info-title::after {
    /* close icon in CSS */
    content: '';
    position: absolute;
    top: 16px;
    margin-right: 10px;
    display: inline-block;
    height: 3px;
    width: 14px;
    background: #FFC107;
}

.info-title::before {
    transform: rotate(-45deg);
    right: 8px;
}

.info-title::after {
    transform: rotate(45deg);
    right: 0;
}

.collapsed > .info-title::before {
    transform: rotate(45deg);
}

.collapsed > .info-title::after {
    transform: rotate(-45deg);
}

.input-group {
    padding: 3px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: rgba(255, 255, 255, 0.89);
    color: #000;
}

.input-group label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

label strong {
    margin-right: 8px;
}

.input-group strong {
    display: inline-block;
}

.input-group-button {
    padding: 0;
}

.input-group.input-group-button button {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: 14px 0;
    width: 100%;
}

.address {
    font-family: monospace;
    word-break: break-word;
}

.list-entry {
    display: flex;
    padding-top: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.list-entry > :first-child {
    flex-grow: 1;
    cursor: pointer;
}

.list-entry button {
    padding: 4px 8px;
    background-color: #1c0446;
    color: white;
}

.list-entry .list-entry-export {
    margin-right: 8px;
}

.list-entry .list-entry-export:before {
    content: 'Export';
}

.list-entry .list-entry-export.clicked {
    background-color: #FFC107;
}

.list-entry .list-entry-delete:before {
    content: 'Delete';
}

.entry-privateKey {
    border-radius: 3px;
    padding: 4px;
    line-height: 1;
    background-color: #FFF;
    display: none;
    overflow: hidden;
    word-break: break-word;
}

.entry-privateKey.clicked{
    display: block;
}

#content {
    position: relative;
}

[overlay] {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    background: rgba(239, 239, 239, 0.95);
    z-index: 1000;
}

[overlay] .message {
    font-size: 18pt;
    text-align: center;
    margin-top: 15%;
    padding: 15px;
}

/* Block UI */

[blockchain-ui] [block-height-input] {
    width: 70px;
}

/* The order of these consensus classes is important to enable overwriting */

[blockchain-ui] [title] {
    transition: background ease 0.5s;
    position: relative;
}

/* [blockchain-ui] [title]:after {
    position: absolute;
    top: 7px;
    right: 7px;
    font-style: italic;
    font-size: 14px;
    opacity: 0.65;
    font-weight: 400;
} */

[blockchain-ui] .not-connected {
    background: #B71C1C;
    opacity: 0.6;
}

[blockchain-ui] .not-connected span::after {
    content: "Not connected";
}

[blockchain-ui] .initializing {
    background: #F9A825;
    opacity: 0.8;
}

[blockchain-ui] .initializing span::after {
    content: "Initializing...";
}

[blockchain-ui] .connecting span::after {
    content: "Connecting...";
}

[blockchain-ui] .syncing {
    background: #EF6C00;
    opacity: 0.8;
}
[blockchain-ui] .syncing span::after {
    content: "Synchronizing...";
}
[blockchain-ui] .sync-chain-proof span::after {
    content: "Downloading proof...";
}
[blockchain-ui] .verify-chain-proof span::after {
    content: "Verifying proof...";
}
[blockchain-ui] .sync-accounts-tree span::after {
    content: "Downloading accounts...";
}
[blockchain-ui] .verify-accounts-tree span::after {
    content: "Verifying accounts...";
}

[blockchain-ui] .consensus-established {
    background: #43A047;
    opacity: 1.0;
}

[blockchain-ui] .consensus-established span::after {
    content: "Consensus established";
}

/* [blockchain-ui] .info:first-child {
    margin-bottom: 0px;
    border-radius: 0px;
} */

.collapsible > :first-child {
    position: relative;
    padding-right: 32px;
}

.collapsible > :first-child::before,
.collapsible > :first-child::after {
    /* close icon in CSS */
    content: '';
    position: absolute;
    top: 6px;
    display: inline-block;
    height: 3px;
    width: 14px;
    background: #FFC107;
}

.collapsible > :first-child::before {
    transform: rotate(-45deg);
    right: 8px;
}

.collapsible > :first-child::after {
    transform: rotate(45deg);
    right: 0;
}

.collapsible.collapsed > :first-child::before {
    transform: rotate(45deg);
}

.collapsible.collapsed > :first-child::after {
    transform: rotate(-45deg);
}

.collapsible.collapsed > :not(:first-child) {
    display: none;
}


.button-padding {
    padding: 6px 0px;
}

/* Account Info UI */

[account-info-ui] [clear-button] {
    display: inline-block;
    height: 38px;
}

[account-info-ui] [account-details],
[account-info-ui] [vesting-account-details],
[account-info-ui] [htlc-account-details] {
    display: none;
}

[account-info-ui][account-type="basic"] [account-details],
[account-info-ui][account-type="vesting"] [account-details],
[account-info-ui][account-type="vesting"] [vesting-account-details],
[account-info-ui][account-type="htlc"] [account-details],
[account-info-ui][account-type="htlc"] [htlc-account-details] {
    display: block;
}

[account-info-ui][account-type="unknown"] [account-type]:after {
    content: 'Unknown account type.';
}
[account-info-ui][account-type="basic"] [account-type]:after {
    content: 'Basic';
}
[account-info-ui][account-type="vesting"] [account-type]:after {
    content: 'Vesting';
}
[account-info-ui][account-type="htlc"] [account-type]:after {
    content: 'HTLC';
}

/* Transaction UI */

[transaction-ui] .error {
    background-color: #B71C1C;
}

[transaction-ui] .warning {
    background-color: #EF6C00;
}

[transaction-ui] .expire {
    background-color: #EEE;
}

[transaction-ui] .success {
    background-color: #43A047;
}

[transaction-ui] select {
    display: block;
}

[transaction-ui] .input-group strong {
    width: 100px;
}

[transaction-ui] [show] {
    /* hide elements by default that should only be visible in specific states */
    display: none;
}

[transaction-ui][tx-type="basic"] [show~="basic"],
[transaction-ui][tx-type="general"] [show~="general"],
[transaction-ui][tx-type="plain"] [show~="plain"],
[transaction-ui][tx-type="vesting-creation"] [show~="vesting-creation"],
[transaction-ui][tx-type="htlc-creation"] [show~="htlc-creation"] {
    display: block;
}
/* Miner */

[miner-ui] select {
    display: block;
}

[miner-ui] [show] {
    /* hide elements by default that should only be visible in specific states */
    display: none;
}
[miner-ui][miner-mode="smart"] [show~="smart"] {
    display: block;
}

[miner-ui] .started {
    background: #B71C1C;
}
/* Statistics Bar */
#stats-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 20px;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 15px;
    transition: all 0.3s ease;
}

.stat-item.clickable {
    cursor: pointer;
}

.stat-item.clickable:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.75em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    transition: color 0.5s ease;
}

/* Block height color based on consensus state */
#stat-height.consensus-connecting {
    color: #ff6b6b !important;
}

#stat-height.consensus-syncing {
    color: #ffd93d !important;
}

#stat-height.consensus-established {
    color: #6bcf7f !important;
}

.explorer-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.explorer-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Thread Slider - Progress Gauge */
.thread-slider-wrapper {
    position: relative;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.thread-display-label {
    position: absolute;
    top: -22px;
    right: 50px;
    font-size: 1.2em;
    font-weight: bold;
    color: #5f4bcc;
    pointer-events: none;
    white-space: nowrap;
}

.thread-min-label {
    position: absolute;
    bottom: -2px;
    left: 0;
    font-size: 0.85em;
    color: #999;
    pointer-events: none;
    white-space: nowrap;
}

.thread-max-label {
    position: absolute;
    bottom: -2px;
    right: 50px;
    font-size: 0.85em;
    color: #999;
    pointer-events: none;
    white-space: nowrap;
}



.thread-slider-track {
    width: calc(100% - 43px);
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.thread-slider-fill {
    height: 100%;
    width: var(--fill-percentage, 0%);
    background: linear-gradient(90deg, #3a4fc6 0%, #4f3bbc 50%, #6a3bb2 100%);
    border-radius: 4px 0 0 4px;
    transition: width 0.15s ease-out;
    pointer-events: none;
    position: relative;
    display: block;
}

#thread-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 14px;
    background: transparent;
    outline: none;
    border: none;
    position: relative;
    margin: 0;
    padding: 0;
    cursor: pointer;
    z-index: 10;
}

/* 크롬의 내부 여백 강제 제거 */
#thread-slider::-webkit-slider-container {
    margin: 0;
    padding: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
    margin: 0 !important;
    padding: 0 !important;
}

#thread-slider:focus {
    outline: none;
}

/* WebKit (Chrome, Safari, Edge) */
#thread-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #5f4bcc;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s, transform 0.2s;
}

#thread-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
}

#thread-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 14px;
    background: transparent;
    border: none;
    box-sizing: border-box;
}

/* Firefox */
#thread-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #5f4bcc;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s, transform 0.2s;
}

#thread-slider::-moz-range-thumb:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
}

#thread-slider::-moz-range-track {
    width: 100%;
    height: 14px;
    background: transparent;
    border: none;
}

#thread-display {
    font-size: 1.1em;
    color: #333 !important;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    color: #333;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: black;
}

#modal-body h2 {
    margin-top: 0;
    color: #667eea;
}

#modal-body .info-block {
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

#modal-body strong {
    color: #764ba2;
}

/* Network & Blockchain 섹션 숨김 (데이터는 수집, 화면에만 안보임) */
[network-ui], [blockchain-ui] {
    display: none !important;
}

/* ========================================
   모바일 반응형 스타일
   ======================================== */

/* 태블릿 및 작은 화면 (768px 이하) */
@media (max-width: 768px) {
    body {
        max-width: 100%;
        padding: 10px;
    }

    header {
        flex-direction: column;
        margin-bottom: 15px;
    }

    header .name {
        font-size: 36px;
        line-height: 1.2;
        margin-top: 10px;
    }

    header .icon-krypton::before {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }

    /* 통계바 반응형 - 2열 정렬 */
    #stats-bar {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
    }

    .stat-item {
        width: calc(50% - 4px);
        padding: 8px 10px;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        box-sizing: border-box;
    }

    .stat-item:last-child {
        border: 1px solid rgba(255,255,255,0.1);
    }

    .stat-label {
        font-size: 0.7em;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .explorer-link {
        width: 100%;
        text-align: center;
        padding: 8px 10px;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
        box-sizing: border-box;
        margin-top: 0;
    }

    /* 섹션들 */
    section {
        margin-bottom: 15px;
    }

    /* 모달 */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    header .name {
        font-size: 28px;
    }

    header .icon-krypton::before {
        width: 35px;
        height: 35px;
    }

    #stats-bar {
        padding: 5px;
        gap: 5px;
    }

    .stat-item {
        width: calc(50% - 2.5px);
        padding: 6px 8px;
    }

    .stat-label {
        font-size: 0.65em;
    }

    .stat-value {
        font-size: 1em;
    }

    .explorer-link {
        width: 100%;
        padding: 6px 8px;
        font-size: 0.9em;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 8px;
    }

    /* 버튼 크기 조정 */
    button {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* 입력 필드 */
    input[type="text"],
    input[type="number"] {
        font-size: 14px;
        padding: 8px;
    }

    /* 모달 */
    .modal-content {
        width: 98%;
        padding: 15px;
    }

    .close {
        font-size: 32px;
    }
}

/* 뷰포트 메타태그 추가 필요 */

/* Mempool 트랜잭션 정보를 얇고 가는 폰트로 */
[mempool-ui] [transactions] {
    font-family: monospace;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.6;
    word-break: break-all;
}

[mempool-ui] [transactions] hash {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
}


/* 모바일 최적화 - ACCOUNTS와 ACCOUNT INFO 섹션의 주소만 */
@media (max-width: 600px) {
    [accounts-ui] .address,
    [account-info-ui] .address,
    [accounts-ui] hash,
    [account-info-ui] hash {
        font-size: 15px !important;
        letter-spacing: -0.8px !important;
        word-spacing: -1px !important;
        line-height: 1.3 !important;
    }
}

/* 모바일 팝업창 최적화 (600px 이하) */
@media (max-width: 600px) {
    .modal-content {
        width: 90% !important;
        max-width: 90% !important;
        max-height: 70vh !important;
        margin: 15% auto !important;
        padding: 15px !important;
        font-size: 14px !important;
        word-break: break-all !important;
        overflow-wrap: break-word !important;
    }
    
    .modal-close {
        font-size: 36px !important;
        line-height: 1 !important;
        padding: 5px 10px !important;
        margin: -10px -10px 0 0 !important;
        background: rgba(0,0,0,0.1);
        border-radius: 5px;
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #modal-body h2 {
        font-size: 18px !important;
        margin-top: 10px !important;
        clear: both;
    }
    
    #modal-body .info-block {
        padding: 8px !important;
        margin: 8px 0 !important;
        font-size: 13px !important;
    }
    
    #modal-body strong {
    }
    
    #modal-body p,
    #modal-body div,
    #modal-body span {
        word-break: break-all !important;
        overflow-wrap: break-word !important;
        font-size: 14px !important;
        word-break: break-all !important;
        overflow-wrap: break-word !important;
    }
}

/* Community Section Styles */
#community-section a:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: #5f4bcc !important;
}

#community-section a:hover img {
    transform: scale(1.1);
}

@media (max-width: 600px) {
    #community-section .info-block > div {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    #community-section a {
        padding: 12px 8px !important;
        min-height: 90px !important;
    }
    #community-section img {
        width: 35px !important;
        height: 35px !important;
    }
    #community-section span {
        font-size: 0.7em !important;
    }
}

@media (max-width: 400px) {
    #community-section .info-block > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 800px) {
    #community-section .info-block > div {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}
