* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: #667eea;
    font-size: 2.5rem;
    font-weight: 700;
}

.wallet-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.connect-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9ff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.disconnect-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.disconnect-btn:hover {
    background: #ff5252;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

h2, h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Courier New', monospace;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.load-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.2s;
}

.load-btn:hover {
    background: #45b7b8;
    transform: translateY(-1px);
}

.functions-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.function-item {
    background: #f8f9ff;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: border-color 0.3s, transform 0.2s;
}

.function-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.function-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.function-header h4 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.function-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.function-type.read {
    background: #e8f5e8;
    color: #2e7d32;
}

.function-type.write {
    background: #fff3e0;
    color: #f57c00;
}

.function-inputs {
    margin-bottom: 15px;
}

.input-field {
    margin-bottom: 12px;
}

.input-field label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.input-field input {
    padding: 8px 12px;
    font-size: 13px;
}

.function-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.read-function {
    background: #4caf50;
    color: white;
}

.read-function:hover {
    background: #45a049;
}

.write-function {
    background: #ff9800;
    color: white;
}

.write-function:hover {
    background: #f57c00;
}

.function-btn:active {
    transform: scale(0.98);
}

.results-section {
    grid-column: 1 / -1;
    margin-top: 0;
}

.results-container {
    background: #f8f9ff;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.result-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.result-item:last-child {
    border-bottom: none;
}

.timestamp {
    color: #888;
    font-size: 12px;
    min-width: 80px;
}

.message {
    flex: 1;
    word-break: break-word;
}

.result-item.success .message {
    color: #2e7d32;
}

.result-item.error .message {
    color: #d32f2f;
}

.result-item.info .message {
    color: #1976d2;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    main {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    section {
        padding: 20px;
    }

    .wallet-info {
        flex-direction: column;
        gap: 10px;
    }

    .function-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}