:root {
    --primary-color: #fcd535;
    --bg-dark: #181a20;
    --bg-darker: #121212;
    --bg-card: #242730;
}

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

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-dark);
    color: #fff;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-bar {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 20px;
    border-bottom: 1px solid var(--primary-color);
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-dark);
    z-index: 1000;
    width: 100%;
}

.logo-lang-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    color: var(--primary-color);
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo img {
    width: 30px;
}

.logo span {
    display: inline-block;
    font-family: "Bowlby One SC", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.nav-buttons {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
}

.nav-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 18px;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-dark);
}

.chat-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 72px;
    margin-bottom: 48px;
}

.messages {
    flex: 1;
    /* background: var(--bg-card); */
    border-radius: 12px;
    padding: 4rem 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(252, 213, 53, 0.3) transparent;
    display: flex;
    flex-direction: column;
}

.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    /* background-color: rgba(252, 213, 53, 0.3); */
    border-radius: 3px;
}

.input-area {
    position: fixed;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 1rem;
    background: var(--bg-dark);
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.2rem;
    border-radius: 8px;
    z-index: 10;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.8rem 10px;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    max-width: 65%;
    width: fit-content;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    animation: fadeIn 0.3s ease;
}

.message.received {
    align-self: flex-start;
    background: none;
}

.message.sent {
    align-self: flex-end;
    margin-left: auto;
    background: rgba(252, 213, 53, 0.1);
    flex-direction: row-reverse;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.message.received .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    padding: 2px;
}

.message.received .message-content {
    background: var(--bg-card);
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(252, 213, 53, 0.1);
}

.message.sent .message-content {
    padding: 0;
    background: none;
    text-align: right;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-username {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.message-timestamp {
    font-size: 0.7rem;
    color: #848e9c;
    margin-top: 0.2rem;
}

.message.sent .message-timestamp {
    text-align: right;
}

input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: var(--bg-card);
    color: #fff;
    font-size: 1rem;
    border: 1px solid rgba(252, 213, 53, 0.1);
}

button {
    padding: 0 2rem;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: var(--bg-dark);
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
    
}
#autoWalletBtn{
    background-image: url(../img/metamask.gif);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

button:hover {
    transform: translateY(-2px);
    background: #e5c130;
}

footer {
    text-align: center;
    padding: 1rem;
    background: var(--bg-dark);
    border-top: 1px solid var(--primary-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.copyright {
    color: #fff;
}

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

    .top-bar {
        flex-direction: column;
        padding: 10px;
        height: auto;
        background-color: var(--bg-dark);
    }

    .logo-lang-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .login-button button {
        background-color: var(--primary-color);
        color: var(--bg-dark);
        border: none;
        border-radius: 20px;
        padding: 8px 16px;
        font-size: 12px !important;
        cursor: pointer;
        transition: all 0.3s;
        position: relative;
        top: -12px;
    }
    .nav-buttons {
        position: static;
        transform: none;
        width: 100%;
        gap: 10px;
        justify-content: flex-start;
        padding-left: 1rem;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 16px;
    }

    .chat-container {
        padding: 1rem;
        margin-top: 120px;
    }

    .messages {
        padding: 1rem;
    }

    .input-area {
        padding: 0.8rem;
    }

    footer {
        display: none;
    }

    .messages {
        padding: 2rem 0;
    }
    .input-area {
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        max-width: 1200px;
        padding: 1rem;
        background: var(--bg-dark);
        display: flex;
        gap: 1rem;
        z-index: 100;
    }
}


.message {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.message-content {
    background: #242730;
    padding: 1rem;
    border-radius: 10px;
    max-width: 70%;
    /* border: 1px solid rgba(252, 213, 53, 0.1); */
}



.message-username {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.message-timestamp {
    color: #848e9c;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    text-align: right;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #242730;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--primary-color);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.wallet-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#walletInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
}

.login-btn {
    width: 100%;
    background: var(--primary-color);
    color: var(--bg-dark);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--primary-color);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.wallet-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wallet-input-group input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid rgba(252, 213, 53, 0.3);
    border-radius: 8px;
    background: var(--bg-dark);
    color: #fff;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: #e5c130;
}

.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.confirm-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--primary-color);
    text-align: center;
}

.confirm-content p {
    margin-bottom: 1.5rem;
    color: #fff;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-buttons button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn {
    background: var(--primary-color);
    color: var(--bg-dark);
}

.cancel-btn {
    background: var(--bg-dark);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.confirm-btn:hover {
    background: #e5c130;
}

.cancel-btn:hover {
    background: rgba(252, 213, 53, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    right: 20px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    background-color: var(--bg-card);
    border: 1px solid rgba(252, 213, 53, 0.3);
    transition: all 0.3s;
}

.user-info:hover {
    border-color: var(--primary-color);
}

.user-info img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
}

.user-info span {
    color: var(--primary-color);
    font-size: 14px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    padding: 5px;
    display: none;
    z-index: 1000;
    margin-top: 5px;
}

.dropdown-menu.active {
    display: block;
}

#logoutBtn {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 5px 10px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    font-size: 14px;
}

#logoutBtn:hover {
    background-color: rgba(252, 213, 53, 0.1);
    transform: none;
}

.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.confirm-content {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--primary-color);
}

.confirm-content p {
    margin-bottom: 20px;
    color: #fff;
}

.confirm-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-btn, .cancel-btn {
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
}

.confirm-btn {
    background-color: var(--primary-color);
    color: var(--bg-dark);
}

.cancel-btn {
    background-color: #555;
    color: #fff;
}

.login-button {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 100;
}

.login-button button {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    
}

.login-button button:hover {
    background-color: #e5c130;
    transform: translateY(-2px);
}

button.disabled {
    background-color: #555 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

button.disabled:hover {
    background-color: #555 !important;
    transform: none !important;
}

.kline-widget {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 900;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    resize: both;
    min-width: 300px;
    min-height: 500px;
    max-width: 800px;
    max-height: 800px;
}

.kline-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--primary-color);
    cursor: move;
}

.kline-drag-handle {
    color: var(--primary-color);
    margin-right: 10px;
    cursor: move;
}

.kline-search {
    display: flex;
    flex: 1;
    gap: 5px;
}

.kline-search input {
    flex: 1;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid rgba(252, 213, 53, 0.3);
    background-color: var(--bg-dark);
    color: #fff;
    font-size: 12px;
}

.kline-search button {
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.kline-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.kline-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.mobile-kline-trigger {
    display: none;
    position: fixed;
    top: 87px;
    left: 0;
    right: 0;
    background-color: #242730;
    border-bottom: 1px solid var(--primary-color);
    padding: 10px 15px;
    z-index: 1001;
    cursor: pointer;
}

.mobile-kline-header {
    display: flex;
    align-items: center;
}

.mobile-kline-icon {
    color: var(--primary-color);
    margin-right: 10px;
}

.mobile-kline-title {
    color: #fff;
    font-size: 14px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 850;
}

@media (max-width: 768px) {
    .kline-widget {
        display: none;
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 50vh;
        resize: none;
        min-width: 100%;
        min-height: auto;
        max-width: 100%;
        max-height: 50vh;
        border-radius: 10px 10px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .kline-widget.mobile-active {
        display: flex;
        transform: translateY(0);
    }
    
    .mobile-kline-trigger {
        display: block;
    }
    
    .mobile-overlay.active {
        display: block;
    }
}