/* Components CSS - ВИПРАВЛЕНИЙ СКРОЛ DEPLOY СЕКЦІЇ + MULTIWALLET СТИЛІ */

/* Compiler секція */
.compiler-config {
    padding: 16px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: #cccccc;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 6px 8px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 4px;
    color: #cccccc;
    font-size: 12px;
}

.form-control:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 1px #007acc;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.checkbox-group input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.checkbox-group label {
    margin: 0;
    font-size: 12px;
    cursor: pointer;
}

/* Кнопки */
.remix-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.remix-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remix-btn-primary {
    background: #007acc;
    color: white;
}

.remix-btn-primary:hover:not(:disabled) {
    background: #005a9e;
}

.remix-btn-orange {
    background: #f6851b;
    color: white;
}

.remix-btn-orange:hover:not(:disabled) {
    background: #e2761b;
}

.remix-btn-secondary {
    background: #5a5a5a;
    color: white;
}

.remix-btn-secondary:hover:not(:disabled) {
    background: #6a6a6a;
}

.compile-button {
    margin-top: 8px;
}

/* ВИПРАВЛЕНА Deploy секція - правильний скрол */
.deploy-config {
    padding: 0;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.deploy-form-section {
    padding: 16px;
    flex-shrink: 0;
}

.constructor-params {
    margin-bottom: 16px;
}

.param-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-input {
    padding: 6px 8px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 4px;
    color: #cccccc;
    font-size: 12px;
}

.account-balance {
    font-size: 11px;
    color: #888888;
    margin-top: 4px;
}

/* ВИПРАВЛЕНА Deployed Contracts секція */
.deployed-contracts {
    margin-top: 0;
    max-height: none;
    overflow-y: visible;
    padding: 0px 16px 8px 16px;
    flex: 1;
    min-height: 0;
}

.deployed-contracts h4 {
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 12px;
}

.contract-address-input {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.contract-address-input input {
    flex: 1;
}

.contract-address-input button {
    width: auto;
    min-width: 80px;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deployed-contract {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #383838;
    cursor: pointer;
    min-height: 40px;
}

.contract-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 12px;
    word-break: break-word;
}

.contract-address {
    font-size: 9px;
    color: #888888;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    margin-top: 2px;
}

/* НОВІ СТИЛІ ФУНКЦІЙ КОНТРАКТІВ */
.contract-functions {
    padding: 8px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    background: #252526;
}

.contract-functions.expanded {
    display: block;
}

/* Function with parameters - горизонтальний layout */
.function-item-horizontal {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Звичайні функції без параметрів */
.function-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* ВСІ КНОПКИ ФУНКЦІЙ - ПОКРАЩЕНИЙ ДИЗАЙН */
.function-button,
.function-button-small {
    background: #f6851b;
    color: white;
    border: 1px solid #3e3e42 !important;
    padding: 8px 8px 8px 6px !important;
    font-size: 10px !important;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 50% !important;
    height: 36px !important;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0;
    text-transform: none !important;
    letter-spacing: normal !important;
    /* ВИПРАВЛЕННЯ OVERFLOW */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
}

/* Кольори кнопок */
.function-button.remix-btn-primary,
.function-button-small.remix-btn-primary {
    background: #007acc !important;
}

.function-button.remix-btn-orange,
.function-button-small.remix-btn-orange {
    background: #f6851b !important;
}

.function-button:hover,
.function-button-small:hover {
    filter: brightness(1.1);
}

/* Контейнер для dropdown параметрів */
.function-inputs-horizontal {
    flex: 1;
    background: #3c3c3c;
    border: 1px solid #555555;
    border-radius: 4px;
    height: 36px;
    position: relative;
    display: flex;
    align-items: center;
    width: 40%;
}

/* Dropdown стилі */
.function-param-dropdown {
    width: 100%;
    position: relative;
}

.function-param-type {
    color: #cccccc;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    cursor: pointer;
    padding: 8px 8px;
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    transition: background-color 0.2s;
}

.function-param-type:hover {
    background: #424242;
}

.function-dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888888;
    font-size: 10px;
    pointer-events: none;
}

/* Input поле (показується при кліку) */
.function-param-input {
    width: 100%;
    background: #3c3c3c;
    border: 1px solid #555555;
    border-radius: 4px;
    color: #ffffff;
    font-size: 11px;
    padding: 8px 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    display: none;
    height: 36px;
    box-sizing: border-box;
}

.function-param-input.active {
    display: block;
}

.function-param-input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

/* Результати функцій */
.function-result {
    padding: 6px 8px;
    background: #1a1a1a;
    border-top: 1px solid #3e3e42;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 10px;
    max-height: 80px;
    overflow-y: auto;
    word-break: break-all;
    line-height: 1.3;
    animation: fadeIn 0.2s ease-in;
}

.function-result a {
    color: #007acc;
    text-decoration: none;
    word-break: break-all;
}

.function-result a:hover {
    text-decoration: underline;
}

/* Результати компіляції */
.compilation-output {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    max-height: 200px;
    overflow-y: auto;
}

.output-placeholder {
    color: #888888;
    text-align: center;
    padding: 16px;
}

.compilation-success {
    color: #4caf50;
}

.compilation-error {
    color: #f44336;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: #2d2d30;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    border: 1px solid #3e3e42;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header h2 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    color: #cccccc;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .remix-btn {
    width: auto;
    min-width: 100px;
}

/* НОВІ СТИЛІ ДЛЯ MULTIWALLET МОДАЛЬНОГО ВІКНА */
.wallet-selection-modal {
    max-width: 480px;
    width: 95%;
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #3c3c3c;
    border: 2px solid #464647;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.wallet-option:hover {
    background: #424242;
    border-color: #007acc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.2);
}

.wallet-option:active {
    transform: translateY(0);
}

.wallet-icon {
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.wallet-name {
    flex: 1;
    font-weight: 600;
    color: #ffffff;
}

.wallet-install-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.wallet-install-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #007acc;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.wallet-install-btn:hover {
    background: #005a9e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.wallet-install-btn:nth-child(2) {
    background: #0052ff;
}

.wallet-install-btn:nth-child(2):hover {
    background: #0041cc;
}

.wallet-install-btn:nth-child(3) {
    background: #3375bb;
}

.wallet-install-btn:nth-child(3):hover {
    background: #2a5d99;
}

/* Search, Debugger, Settings стилі - залишаю як є */
.search-config {
    padding: 16px;
    overflow-y: auto;
}

.search-input-group {
    display: flex;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 4px 0 0 4px;
    color: #cccccc;
    font-size: 13px;
}

.search-input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 1px #007acc;
}

.search-button {
    background: #007acc;
    border: 1px solid #007acc;
    border-radius: 0 4px 4px 0;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button:hover {
    background: #005a9e;
}

.search-options {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.search-option label {
    font-size: 12px;
    color: #cccccc;
    cursor: pointer;
}

.search-tabs {
    display: flex;
    border-bottom: 1px solid #3e3e42;
    margin-bottom: 12px;
}

.search-tab {
    background: none;
    border: none;
    color: #cccccc;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.search-tab:hover {
    color: #ffffff;
    background: #37373d;
}

.search-tab.active {
    color: #007acc;
    border-bottom-color: #007acc;
}

.debugger-config {
    padding: 16px;
    overflow-y: auto;
}

.debug-tabs {
    display: flex;
    border-bottom: 1px solid #3e3e42;
    margin-bottom: 16px;
}

.debug-tab {
    background: none;
    border: none;
    color: #cccccc;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.debug-tab:hover {
    color: #ffffff;
    background: #37373d;
}

.debug-tab.active {
    color: #007acc;
    border-bottom-color: #007acc;
}

.settings-config {
    padding: 16px;
    overflow-y: auto;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid #3e3e42;
    margin-bottom: 16px;
}

.settings-tab {
    background: none;
    border: none;
    color: #cccccc;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.settings-tab:hover {
    color: #ffffff;
    background: #37373d;
}

.settings-tab.active {
    color: #007acc;
    border-bottom-color: #007acc;
}

/* Анімації */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive правила */
@media (max-width: 768px) {
    .search-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .debug-tabs,
    .settings-tabs {
        flex-wrap: wrap;
    }
    
    .debug-tab,
    .settings-tab {
        flex: 1;
        min-width: 80px;
    }
    
    .wallet-options {
        gap: 8px;
    }
    
    .wallet-option {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .wallet-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
    
    .wallet-name {
        font-size: 13px;
    }
    
    .wallet-install-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .function-button,
    .function-button-small {
        font-size: 10px !important;
        padding: 6px 6px !important;
    }
}

@media (max-width: 900px) {
    .function-button,
    .function-button-small {
        font-size: 9px !important;
        padding: 4px 8px !important;
    }
}

/* Scrollbars */
.contract-functions::-webkit-scrollbar {
    width: 4px;
}

.contract-functions::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.contract-functions::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 2px;
}

.contract-functions::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}

.deploy-config::-webkit-scrollbar {
    width: 6px;
}

.deploy-config::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.deploy-config::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 3px;
}

.deploy-config::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}