/* app/static/css/smart_contracts.css */

/* =========================================================
   SMART CONTRACTS PAGE — CLEAN BUILDER VERSION
   Removed old deployed-contract action panels.
   Includes dark theme, light theme, and mobile adaptation.
   ========================================================= */

/* ========================= */
/* PAGE */
/* ========================= */

.smart-contracts-page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px 60px;
    box-sizing: border-box;
    color: #ffffff;
}

/* ========================= */
/* HERO */
/* ========================= */

.smart-contracts-hero {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;

    min-height: 230px;
    padding: 22px 26px;
    margin-bottom: 22px;

    border: 2px solid #037d9c;
    border-radius: 20px;

    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.02)),
        rgba(4, 22, 32, 0.55);

    box-shadow:
        0 0 18px rgba(3, 125, 156, 0.55),
        0 12px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);

    box-sizing: border-box;
}

.smart-contracts-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;

    background: url("/static/img/smart_contracts_header.webp?v=1") center center / cover no-repeat;
    opacity: 1;

    pointer-events: none;
}

.smart-contracts-hero::after {
    content: none;
    display: none;
}

/* ========================= */
/* HERO TEXT */
/* Заголовок слева как в dApp, размеры шапки не меняем */
/* ========================= */

.smart-contracts-hero-text {
    position: relative;
    z-index: 3;

    min-width: 0;
    max-width: 560px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    text-align: left;
}

.smart-contracts-eyebrow {
    display: inline-flex;
    align-items: center;

    margin-bottom: 10px;
    padding: 6px 12px;

    border: 1px solid rgba(232, 251, 255, 0.34);
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.62);
    color: #e8fbff;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    box-shadow:
        0 0 10px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    box-sizing: border-box;
    backdrop-filter: blur(6px);
}

.smart-contracts-hero h1 {
    position: relative;
    z-index: 3;

    margin: 0 0 10px;

    border: none;
    background: transparent;
    box-shadow: none;

    color: #ffffff;

    font-size: 31px;
    font-weight: 800;
    line-height: 1.15;

    text-align: left;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.smart-contracts-hero p {
    position: relative;
    z-index: 3;

    max-width: 520px;
    margin: 0;

    border: none;
    background: transparent;
    box-shadow: none;

    color: #e8fbff;

    font-size: 15px;
    line-height: 1.55;

    text-align: left;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ========================= */
/* HERO BADGE */
/* Правая плашка Solidity Templates */
/* ========================= */

.smart-contracts-hero-badge {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 20;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 44px;
    margin: 0;
    padding: 10px 18px;

    border: 1px solid rgba(232, 251, 255, 0.55);
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.38);
    color: #ffffff;

    white-space: nowrap;

    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(6px);
}

.smart-contracts-hero-badge i {
    color: #ffffff;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

.smart-contracts-hero-badge span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* ========================= */
/* OLD HERO VISUAL LAYERS */
/* Отключены, потому что фон уже в smart_contracts_header.webp */
/* ========================= */

.smart-contracts-hero-visual,
.smart-earth-image,
.smart-hands-ring {
    display: none;
}

/* ========================= */
/* BUILDER STATUS */
/* Нижний статус Smart Builder Ready */
/* ========================= */

.smart-builder-status {
    position: absolute;
    right: 70px;
    bottom: 30px;
    z-index: 5;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    width: 112px;
    min-height: 25px;
    padding: 5px 8px;

    border: 1px solid rgba(232, 251, 255, 0.34);
    border-radius: 9px;

    background: rgba(15, 18, 22, 0.86);
    color: #ffffff;

    box-shadow:
        0 0 14px rgba(3, 125, 156, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.smart-builder-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;

    background: #4df2a7;
    box-shadow: 0 0 16px rgba(77, 242, 167, 0.8);
}

#smart-builder-status-text {
    overflow: hidden;

    color: #ffffff;

    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.smart-builder-status[data-status="loading"] .smart-builder-status-dot {
    background: #06d9ff;
    box-shadow: 0 0 16px rgba(6, 217, 255, 0.78);
}

.smart-builder-status[data-status="generated"] .smart-builder-status-dot,
.smart-builder-status[data-status="valid"] .smart-builder-status-dot,
.smart-builder-status[data-status="success"] .smart-builder-status-dot {
    background: #5dff8b;
    box-shadow: 0 0 16px rgba(93, 255, 139, 0.76);
}

.smart-builder-status[data-status="error"] .smart-builder-status-dot {
    background: #ff6b6b;
    box-shadow: 0 0 16px rgba(255, 107, 107, 0.72);
}

.smart-builder-status[data-status="warning"] .smart-builder-status-dot {
    background: #ffd56a;
    box-shadow: 0 0 16px rgba(255, 213, 106, 0.72);
}

/* ========================= */
/* MAIN GRID / CARDS */
/* ========================= */

.smart-contracts-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
    align-items: start;
    gap: 22px;

    margin-bottom: 22px;
}

.smart-card {
    padding: 20px;

    border: 1px solid rgba(6, 171, 212, 0.24);
    border-radius: 18px;

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        rgba(0, 0, 0, 0.74);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);

    box-sizing: border-box;
}

.builder-panel {
    align-self: start;
}

/* Прижимаем верхние голубые шапки к верхнему краю темных карточек,
   чтобы над ними не выглядывал темный фон основной рамки. */
.builder-panel,
.code-panel {
    padding-top: 0;
    overflow: hidden;
}

.code-panel {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-self: start;
    height: var(--builder-panel-height, min(820px, calc(100vh - 120px)));
    max-height: var(--builder-panel-height, calc(100vh - 120px));
}

.code-panel .card-header {
    flex: 0 0 auto;
}

/* ========================= */
/* CARD HEADERS */
/* Голубые шапки внутри карточек */
/* ========================= */

.card-header {
    position: relative;
    overflow: hidden;

    min-height: 92px;
    width: calc(100% + 40px);
    margin: 0 -20px 17px;
    padding: 16px 24px;

    border: 2px solid #037d9c;
    border-radius: 15px;

    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.14) 48%, rgba(0, 0, 0, 0.04)),
        radial-gradient(circle at 78% 48%, rgba(3, 125, 156, 0.42), transparent 38%),
        linear-gradient(180deg, rgba(3, 125, 156, 0.38), rgba(4, 22, 32, 0.84));

    box-shadow:
        0 0 16px rgba(3, 125, 156, 0.48),
        0 10px 24px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);

    box-sizing: border-box;
}

.card-header::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 42%),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 32%);

    pointer-events: none;
}

.card-header h2,
.card-header span {
    position: relative;
    z-index: 2;
}

.card-header h2 {
    margin: 0 0 6px;

    color: #ffffff;

    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.48);
}

.card-header span {
    display: block;

    color: #e8fbff;

    font-size: 13px;
    line-height: 1.4;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ========================= */
/* FORM */
/* ========================= */

.smart-contract-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #c6c6c6;
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 43px;
    padding: 11px 12px;
    border: 1px solid rgba(6, 171, 212, 0.34);
    border-radius: 11px;
    background: rgba(15, 18, 22, 0.98);
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(6, 217, 255, 0.78);
    background: rgba(12, 16, 20, 1);
    box-shadow: 0 0 0 3px rgba(6, 217, 255, 0.12);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

/* ========================= */
/* CUSTOM NETWORK SELECT */
/* ========================= */

.custom-network-select {
    position: relative;
    z-index: 50;
    width: 100%;
    user-select: none;
}

.custom-network-select.open {
    z-index: 5000;
}

.custom-network-trigger {
    position: relative;
    z-index: 2;

    width: 100%;
    min-height: 43px;
    padding: 10px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    border: 1px solid rgba(6, 171, 212, 0.34);
    border-radius: 11px;

    background: rgba(15, 18, 22, 0.98);
    color: #ffffff;

    font-size: 14px;
    text-align: left;

    cursor: pointer;
    box-sizing: border-box;
}

.custom-network-trigger:focus {
    outline: none;
    border-color: rgba(6, 217, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(6, 217, 255, 0.12);
}

.custom-network-trigger-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.custom-network-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-network-logo {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    object-fit: contain;
}

.custom-network-arrow {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.25s ease;
}

.custom-network-select.open .custom-network-arrow {
    transform: rotate(180deg);
}

.custom-network-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 9999;

    display: none;

    width: 100%;
    max-height: 285px;
    overflow-y: auto;

    border: 1px solid rgba(6, 171, 212, 0.45);
    border-radius: 11px;

    background: rgba(10, 14, 18, 0.98);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);

    pointer-events: auto;
}

.custom-network-select.open .custom-network-dropdown {
    display: block;
}

.custom-network-option {
    position: relative;
    z-index: 10000;

    width: 100%;
    padding: 10px 12px;

    display: flex;
    align-items: center;
    gap: 10px;

    border: none;
    background: transparent;
    color: #ffffff;

    font-size: 14px;
    text-align: left;

    cursor: pointer;
    pointer-events: auto;
    box-sizing: border-box;

    transition: background 0.2s ease;
}

.custom-network-option:hover {
    background: rgba(21, 135, 163, 0.35);
}

.custom-network-option.selected {
    background: rgba(3, 125, 156, 0.45);
}

.custom-network-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================= */
/* BUTTONS */
/* ========================= */

.builder-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.smart-primary-btn,
.smart-secondary-btn,
.smart-deploy-btn {
    min-height: 43px;
    padding: 0 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 11px;
    font-weight: 600;
    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.smart-primary-btn {
    grid-column: span 2;
    border: 1px solid rgba(6, 171, 212, 0.68);
    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.26), rgba(0, 255, 204, 0.11)),
        rgba(6, 171, 212, 0.14);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(6, 171, 212, 0.12);
}

.smart-primary-btn:hover {
    transform: translateY(-1px);
    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.36), rgba(0, 255, 204, 0.16)),
        rgba(6, 171, 212, 0.18);
    box-shadow: 0 0 18px rgba(6, 171, 212, 0.18);
}

.smart-primary-btn.generated-success {
    border-color: rgba(93, 255, 139, 0.7);
    background:
        linear-gradient(90deg, rgba(93, 255, 139, 0.28), rgba(0, 255, 204, 0.14)),
        rgba(93, 255, 139, 0.12);
    box-shadow: 0 0 18px rgba(93, 255, 139, 0.18);
}

.smart-secondary-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
}

.smart-secondary-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(6, 171, 212, 0.58);
    background: rgba(6, 171, 212, 0.13);
}

.compile-check-btn {
    border-color: rgba(0, 255, 204, 0.34);
    color: #eafffa;
}

.compile-check-btn:hover {
    border-color: rgba(0, 255, 204, 0.75);
    background: rgba(0, 255, 204, 0.12);
}

.compile-check-btn.loading,
.smart-deploy-btn.loading {
    opacity: 0.78;
    pointer-events: none;
}

.compile-check-btn.loading i,
.smart-deploy-btn.loading i {
    animation: smartCompileSpin 1s linear infinite;
}

.smart-deploy-btn {
    width: 100%;
    border: 1px solid rgba(255, 195, 60, 0.38);
    background: rgba(255, 195, 60, 0.10);
    color: #ffc34a;
}

.smart-deploy-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

.smart-deploy-btn:not(:disabled) {
    border-color: rgba(255, 195, 60, 0.75);
    background:
        linear-gradient(90deg, rgba(255, 195, 60, 0.22), rgba(255, 145, 0, 0.12)),
        rgba(255, 195, 60, 0.12);
    color: #ffd56a;
}

.smart-deploy-btn:not(:disabled):hover {
    transform: translateY(-1px);
    background:
        linear-gradient(90deg, rgba(255, 195, 60, 0.30), rgba(255, 145, 0, 0.16)),
        rgba(255, 195, 60, 0.16);
    box-shadow: 0 0 14px rgba(255, 195, 60, 0.12);
}

.builder-note {
    margin: 0;
    color: #a9a9a9;
    font-size: 13px;
    line-height: 1.45;
}

/* ========================= */
/* WALLET BALANCE PREVIEW */
/* ========================= */

.wallet-balance-preview {
    padding: 14px;
    border: 1px solid #037d9c;
    border-radius: 14px;
    background: rgba(3, 125, 156, 0.12);
    box-shadow: 0 0 12px rgba(3, 125, 156, 0.18);
}

.wallet-balance-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #e8fbff;
    font-weight: 700;
}

.wallet-balance-preview-header i {
    color: #00ccff;
}

.wallet-balance-preview-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.wallet-balance-preview-row span {
    color: #bdefff;
}

.wallet-balance-preview-row strong {
    overflow: hidden;
    color: #ffffff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-balance-preview-status {
    margin: 10px 0 0;
    color: #d7faff;
    font-size: 13px;
    line-height: 1.4;
}

.wallet-balance-preview-status.success {
    color: #5dff8b;
}

.wallet-balance-preview-status.warning {
    color: #ffc34a;
}

.wallet-balance-preview-status.error {
    color: #ff7777;
}

/* ========================= */
/* STATUS BADGE */
/* Бейдж статуса компиляции / генерации */
/* ========================= */

.contract-status-badge {
    position: absolute;
    right: 8px;
    bottom: 12px;
    left: auto;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;
    padding: 12px 34px;

    border: 1px solid rgba(6, 217, 255, 0.68);
    border-radius: 999px;

    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.36), rgba(0, 255, 204, 0.18)),
        rgba(6, 171, 212, 0.20);

    color: #ffffff;

    font-size: 30px;
    font-weight: 900;
    line-height: 1;

    white-space: nowrap;

    box-shadow:
        0 0 22px rgba(6, 217, 255, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);

    box-sizing: border-box;
}

.contract-status-badge[data-status="ready"] {
    border-color: rgba(6, 217, 255, 0.52);
    color: #8feeff;
}

.contract-status-badge[data-status="generated"] {
    border-color: rgba(0, 255, 204, 0.52);

    background:
        linear-gradient(90deg, rgba(0, 255, 204, 0.22), rgba(6, 171, 212, 0.16)),
        rgba(15, 18, 22, 0.82);

    color: #00ffcc;

    box-shadow:
        0 0 14px rgba(0, 255, 204, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.contract-status-badge[data-status="valid"] {
    border-color: rgba(93, 255, 139, 0.52);

    background:
        linear-gradient(90deg, rgba(93, 255, 139, 0.22), rgba(0, 255, 204, 0.10)),
        rgba(15, 18, 22, 0.82);

    color: #5dff8b;
}

.contract-status-badge[data-status="warning"] {
    border-color: rgba(255, 195, 74, 0.56);

    background:
        linear-gradient(90deg, rgba(255, 195, 74, 0.22), rgba(255, 145, 0, 0.10)),
        rgba(15, 18, 22, 0.82);

    color: #ffd56a;
}

.contract-status-badge[data-status="error"] {
    border-color: rgba(255, 90, 90, 0.58);

    background:
        linear-gradient(90deg, rgba(255, 90, 90, 0.22), rgba(255, 145, 145, 0.08)),
        rgba(15, 18, 22, 0.82);

    color: #ff7777;
}

/* ========================= */
/* CODE PREVIEW */
/* ========================= */

.code-panel {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-self: start;
}

.code-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    min-height: 92px;
    padding-bottom: 16px;
    padding-right: 130px;
}

.code-preview {
    flex: 1 1 auto;

    width: 100%;
    min-height: 0;
    height: 100%;

    margin: 0;
    padding: 17px;

    overflow: auto;

    border: 1px solid rgba(6, 171, 212, 0.20);
    border-radius: 15px;

    background:
        linear-gradient(180deg, rgba(6, 171, 212, 0.035), transparent 26%),
        rgba(4, 6, 9, 0.98);

    color: #d7faff;

    font-size: 13px;
    line-height: 1.56;

    scrollbar-width: thin;
    scrollbar-color: rgba(6, 217, 255, 0.5) rgba(255, 255, 255, 0.06);

    box-sizing: border-box;
}

.code-preview::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.code-preview::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.code-preview::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(6, 217, 255, 0.45);
}

.code-preview code {
    display: block;

    min-height: 100%;

    font-family: Consolas, Monaco, "Courier New", monospace;
    white-space: pre;
}

.code-preview.generated-flash {
    animation: generatedPreviewFlash 0.9s ease;
}

/* ========================= */
/* TEMPLATE FEATURES */
/* ========================= */

.smart-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.feature-card {
    min-height: 165px;
}

.feature-card i {
    margin-bottom: 12px;
    color: #06d9ff;
    font-size: 26px;
}

.feature-card h3 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 17px;
}

.feature-card p {
    margin: 0;
    color: #cfcfcf;
    font-size: 14px;
    line-height: 1.45;
}

/* ========================= */
/* ANIMATIONS */
/* ========================= */

@keyframes smartHandsPulse {
    0%,
    100% {
        opacity: 0.86;
        filter:
            brightness(0.96)
            saturate(1.02)
            drop-shadow(0 0 14px rgba(3, 125, 156, 0.26))
            drop-shadow(0 0 20px rgba(238, 253, 255, 0.12));
    }

    45% {
        opacity: 0.98;
        filter:
            brightness(1.13)
            saturate(1.22)
            drop-shadow(0 0 28px rgba(3, 125, 156, 0.62))
            drop-shadow(0 0 34px rgba(238, 253, 255, 0.34));
    }

    58% {
        opacity: 0.93;
        filter:
            brightness(1.04)
            saturate(1.12)
            drop-shadow(0 0 20px rgba(3, 125, 156, 0.42))
            drop-shadow(0 0 26px rgba(238, 253, 255, 0.20));
    }
}

@keyframes smartCompileSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes generatedPreviewFlash {
    0% {
        border-color: rgba(93, 255, 139, 0.95);
        box-shadow: 0 0 0 rgba(93, 255, 139, 0);
    }

    45% {
        border-color: rgba(93, 255, 139, 0.95);
        box-shadow: 0 0 22px rgba(93, 255, 139, 0.24);
    }

    100% {
        border-color: rgba(6, 171, 212, 0.20);
        box-shadow: none;
    }
}

/* ========================= */
/* LIGHT THEME */
/* ========================= */

.light-theme .smart-contracts-page {
    color: #20252a;
}


/* ========================= */
/* LIGHT THEME: HERO */
/* ========================= */

.light-theme .smart-contracts-hero {
    border-color: #037d9c;

    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.06) 45%, rgba(0, 0, 0, 0.02)),
        url("/static/img/smart_contracts_header.webp?v=1") center center / cover no-repeat;

    box-shadow:
        0 0 16px rgba(3, 125, 156, 0.28),
        0 10px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.light-theme .smart-contracts-hero::before {
    display: none;
}


.light-theme .smart-contracts-hero h1,
.light-theme .smart-contracts-hero p,
.light-theme .smart-contracts-hero-badge i,
.light-theme .smart-contracts-hero-badge span {
    color: #ffffff;
}

.light-theme .smart-contracts-hero-badge {
    border-color: rgba(232, 251, 255, 0.55);

    background: rgba(0, 0, 0, 0.32);
    color: #ffffff;
}

.light-theme .smart-earth-image {
    opacity: 0.62;
}

.light-theme .smart-builder-status {
    border-color: rgba(232, 251, 255, 0.34);

    background: rgba(15, 18, 22, 0.86);
    color: #ffffff;
}


/* ========================= */
/* LIGHT THEME: MAIN CARDS */
/* ========================= */

.light-theme .smart-card {
    border-color: rgba(3, 125, 156, 0.24);

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 253, 0.94));

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}


/* ========================= */
/* LIGHT THEME: CARD HEADERS */
/* Голубые мини-шапки внутри карточек */
/* ========================= */

.light-theme .card-header {
    border-color: #037d9c;

    background:
        linear-gradient(90deg, rgba(3, 125, 156, 0.92), rgba(3, 125, 156, 0.72)),
        radial-gradient(circle at 78% 48%, rgba(255, 255, 255, 0.18), transparent 38%),
        #037d9c;

    box-shadow:
        0 0 16px rgba(3, 125, 156, 0.26),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.light-theme .card-header::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 42%),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16), transparent 32%);
}

.light-theme .card-header h2,
.light-theme .card-header span {
    color: #ffffff;
}

.light-theme .feature-card h3 {
    color: #20252a;
}

.light-theme .form-group label,
.light-theme .feature-card p,
.light-theme .builder-note {
    color: #4f5b63;
}


/* ========================= */
/* LIGHT THEME: FORM */
/* ========================= */

.light-theme .form-group input,
.light-theme .form-group select,
.light-theme .custom-network-trigger {
    border-color: rgba(3, 125, 156, 0.30);

    background: #ffffff;
    color: #1e252b;
}

.light-theme .form-group input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.light-theme .form-group input:focus,
.light-theme .form-group select:focus,
.light-theme .custom-network-trigger:focus {
    border-color: rgba(3, 125, 156, 0.72);
    box-shadow: 0 0 0 3px rgba(3, 125, 156, 0.11);
}


/* ========================= */
/* LIGHT THEME: CUSTOM NETWORK SELECT */
/* ========================= */

.light-theme .custom-network-dropdown {
    border-color: rgba(3, 125, 156, 0.35);

    background: rgba(250, 250, 250, 0.98);
}

.light-theme .custom-network-option {
    color: #20252a;
}

.light-theme .custom-network-option:hover {
    background: rgba(21, 135, 163, 0.16);
}

.light-theme .custom-network-option.selected {
    background: rgba(21, 135, 163, 0.22);
}


/* ========================= */
/* LIGHT THEME: WALLET BALANCE */
/* ========================= */

.light-theme .wallet-balance-preview {
    border-color: #037d9c;

    background: rgba(3, 125, 156, 0.08);
}

.light-theme .wallet-balance-preview-header {
    color: #037d9c;
}

.light-theme .wallet-balance-preview-row span {
    color: #405862;
}

.light-theme .wallet-balance-preview-row strong {
    color: #20252a;
}

.light-theme .wallet-balance-preview-status {
    color: #25323a;
}

.light-theme .wallet-balance-preview-status.success {
    color: #177b33;
}

.light-theme .wallet-balance-preview-status.warning {
    color: #9a6900;
}

.light-theme .wallet-balance-preview-status.error {
    color: #b32626;
}


/* ========================= */
/* LIGHT THEME: BUTTONS */
/* ========================= */

.light-theme .smart-primary-btn {
    border-color: rgba(3, 125, 156, 0.66);

    background:
        linear-gradient(90deg, rgba(3, 125, 156, 0.78), rgba(0, 170, 150, 0.70));

    color: #ffffff;
}

.light-theme .smart-primary-btn:hover {
    background:
        linear-gradient(90deg, rgba(3, 125, 156, 0.90), rgba(0, 170, 150, 0.82));

    box-shadow: 0 0 16px rgba(3, 125, 156, 0.16);
}

.light-theme .smart-primary-btn.generated-success {
    border-color: rgba(23, 123, 51, 0.55);

    background:
        linear-gradient(90deg, rgba(23, 123, 51, 0.78), rgba(0, 145, 120, 0.68));

    color: #ffffff;

    box-shadow: 0 0 16px rgba(23, 123, 51, 0.14);
}

.light-theme .smart-secondary-btn {
    border-color: rgba(0, 0, 0, 0.14);

    background: rgba(0, 0, 0, 0.035);
    color: #20252a;
}

.light-theme .smart-secondary-btn:hover {
    border-color: rgba(3, 125, 156, 0.52);

    background: rgba(3, 125, 156, 0.08);

    box-shadow: 0 0 12px rgba(3, 125, 156, 0.08);
}

.light-theme .compile-check-btn {
    border-color: rgba(0, 145, 120, 0.32);

    color: #176451;
}

.light-theme .compile-check-btn:hover {
    border-color: rgba(0, 145, 120, 0.62);

    background: rgba(0, 145, 120, 0.09);

    box-shadow: 0 0 12px rgba(0, 145, 120, 0.08);
}

.light-theme .compile-check-btn.loading {
    opacity: 0.78;
    pointer-events: none;
}

.light-theme .compile-check-btn.loading i {
    animation: smartCompileSpin 1s linear infinite;
}

.light-theme .smart-deploy-btn {
    border-color: rgba(185, 125, 0, 0.34);

    background: rgba(255, 190, 60, 0.12);
    color: #9a6900;
}

.light-theme .smart-deploy-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

.light-theme .smart-deploy-btn:not(:disabled) {
    border-color: rgba(185, 125, 0, 0.58);

    background:
        linear-gradient(90deg, rgba(255, 195, 74, 0.25), rgba(255, 145, 0, 0.12)),
        rgba(255, 195, 74, 0.10);

    color: #7a5200;
}

.light-theme .smart-deploy-btn:not(:disabled):hover {
    background:
        linear-gradient(90deg, rgba(255, 195, 74, 0.34), rgba(255, 145, 0, 0.18)),
        rgba(255, 195, 74, 0.14);

    box-shadow: 0 0 14px rgba(185, 125, 0, 0.12);
}

.light-theme .smart-deploy-btn.loading {
    opacity: 0.78;
    pointer-events: none;
}

.light-theme .smart-deploy-btn.loading i {
    animation: smartCompileSpin 1s linear infinite;
}

/* ========================= */
/* LIGHT THEME: STATUS BADGE */
/* ========================= */

.light-theme .contract-status-badge {
    border-color: rgba(232, 251, 255, 0.55);

    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(232, 251, 255, 0.08)),
        rgba(0, 0, 0, 0.26);

    color: #ffffff;

    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(8px);
}

.light-theme .contract-status-badge[data-status="ready"] {
    border-color: rgba(232, 251, 255, 0.55);

    color: #ffffff;
}

.light-theme .contract-status-badge[data-status="generated"] {
    border-color: rgba(0, 255, 204, 0.42);

    background:
        linear-gradient(90deg, rgba(0, 255, 204, 0.20), rgba(255, 255, 255, 0.10)),
        rgba(0, 0, 0, 0.24);

    color: #ffffff;

    box-shadow:
        0 0 12px rgba(0, 255, 204, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.light-theme .contract-status-badge[data-status="valid"] {
    border-color: rgba(93, 255, 139, 0.42);

    background:
        linear-gradient(90deg, rgba(93, 255, 139, 0.20), rgba(255, 255, 255, 0.10)),
        rgba(0, 0, 0, 0.24);

    color: #ffffff;

    box-shadow:
        0 0 12px rgba(93, 255, 139, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.light-theme .contract-status-badge[data-status="warning"] {
    border-color: rgba(255, 213, 106, 0.50);

    background:
        linear-gradient(90deg, rgba(255, 213, 106, 0.22), rgba(255, 255, 255, 0.10)),
        rgba(0, 0, 0, 0.24);

    color: #fff1c2;

    box-shadow:
        0 0 12px rgba(255, 213, 106, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.light-theme .contract-status-badge[data-status="error"] {
    border-color: rgba(255, 120, 120, 0.50);

    background:
        linear-gradient(90deg, rgba(255, 90, 90, 0.22), rgba(255, 255, 255, 0.08)),
        rgba(0, 0, 0, 0.24);

    color: #ffd6d6;

    box-shadow:
        0 0 12px rgba(255, 90, 90, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

@media (max-width: 1120px) {
    .smart-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 980px) {
    .smart-contracts-grid {
        grid-template-columns: 1fr;
    }

    .smart-contracts-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-builder-status {
        position: relative;
        right: auto;
        bottom: auto;

        align-self: flex-start;

        margin-top: 12px;
    }

    .code-panel {
        height: auto;
        max-height: none;
    }

    .code-preview {
        min-height: 520px;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .smart-contracts-page {
        padding: 20px 12px 50px;
    }

    .smart-contracts-hero {
        min-height: auto;
        padding: 20px;
    }

    .smart-contracts-hero::before {
        opacity: 0.92;
    }

    .smart-contracts-hero h1 {
    position: relative;
    z-index: 4;

    margin: 0 0 10px;
    padding: 0;

    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    color: #ffffff;
    font-size: 31px;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}


    .builder-actions {
        grid-template-columns: 1fr;
    }

    .smart-primary-btn {
        grid-column: auto;
    }

    .wallet-balance-preview-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .smart-features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .smart-contracts-page {
        padding: 16px 10px 44px;
    }

    .smart-card {
        padding: 16px;
        border-radius: 16px;
    }

    .smart-contracts-hero {
        padding: 18px 16px;
        border-radius: 17px;
    }

    .smart-contracts-hero-badge {
        width: 100%;
        justify-content: center;

        padding: 10px 12px;

        white-space: normal;
    }

    .smart-contracts-hero h1 {
        font-size: 25px;
    }

    .smart-contracts-hero p {
    position: relative;
    z-index: 4;

    max-width: 520px;
    margin: 0;
    padding: 0;

    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    color: #e8fbff;
    font-size: 15px;
    line-height: 1.55;
}

    .card-header {
        min-height: 86px;
        width: calc(100% + 32px);
        margin: 0 -16px 17px;
        padding: 14px 16px;
        border-radius: 14px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .card-header span {
        font-size: 12px;
    }

    .code-header {
        flex-direction: column;
        align-items: flex-start;

        padding-right: 110px;
        padding-bottom: 14px;
    }

    .contract-status-badge {
        right: 16px;
        bottom: 12px;
        left: auto;

        min-height: 26px;
        padding: 5px 11px;

        font-size: 11px;
    }

    .custom-network-dropdown {
        max-height: 235px;
    }

    .code-preview {
        min-height: 420px;
        max-height: none;
        padding: 14px;

        font-size: 12px;
        line-height: 1.5;
    }
}

/* ========================= */
/* HERO BADGE SIZE TWEAKS */
/* ========================= */

.smart-contracts-eyebrow {
    padding: 7px 14px;
    font-size: 13px;
}

.smart-contracts-hero p {
    max-width: 340px;
}

.smart-builder-status {
    right: 22px;
    gap: 9px;
    width: 148px;
    min-height: 34px;
    padding: 7px 12px;
}

.smart-builder-status-dot {
    width: 9px;
    height: 9px;
    flex-basis: 9px;
}

#smart-builder-status-text {
    font-size: 12px;
}

.smart-builder-status[data-status="generated"] #smart-builder-status-text {
    color: #5dff8b;
}

@media (max-width: 980px) {
    .smart-builder-status {
        right: auto;
    }
}


/* =========================================================
   SMART CONTRACTS — GLOBAL PAXOR WALLET INTEGRATION
   ========================================================= */

.wallet-balance-preview {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.smart-global-wallet-btn {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    padding: 9px 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid rgba(6, 171, 212, 0.56);
    border-radius: 11px;

    background:
        linear-gradient(
            90deg,
            rgba(6, 171, 212, 0.22),
            rgba(0, 255, 204, 0.09)
        ),
        rgba(7, 18, 24, 0.94);

    color: #e8fbff;

    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 750;

    cursor: pointer;

    box-shadow:
        0 0 14px rgba(6, 171, 212, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.smart-global-wallet-btn i {
    color: #67ddff;
    font-size: 15px;
}

.smart-global-wallet-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(6, 217, 255, 0.78);

    background:
        linear-gradient(
            90deg,
            rgba(6, 171, 212, 0.32),
            rgba(0, 255, 204, 0.13)
        ),
        rgba(7, 18, 24, 0.98);

    box-shadow:
        0 0 18px rgba(6, 171, 212, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.smart-global-wallet-btn.connected {
    border-color: rgba(24, 200, 136, 0.58);

    background:
        linear-gradient(
            90deg,
            rgba(24, 200, 136, 0.20),
            rgba(3, 125, 156, 0.12)
        ),
        rgba(7, 18, 24, 0.96);
}

.smart-global-wallet-btn.connected i {
    color: #4df2a7;
}

.wallet-balance-preview-status {
    margin-bottom: 0;
}

.light-theme .smart-global-wallet-btn {
    border-color: rgba(3, 125, 156, 0.42);
    background: rgba(3, 125, 156, 0.08);
    color: #17323d;
}

.light-theme .smart-global-wallet-btn.connected {
    border-color: rgba(24, 160, 112, 0.46);
    background: rgba(24, 160, 112, 0.08);
}

@media (max-width: 520px) {
    .smart-global-wallet-btn {
        min-height: 44px;
        font-size: 12.5px;
    }
}
