:root {
    --primary-color: #bcff30;
    --bg-dark: #000000;
    --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 Navigation */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    border-bottom: 1px solid var(--primary-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-dark);
    z-index: 1000;
    width: 100%;
}

.logo-lang-wrapper {
    display: flex;
    align-items: center;
}

.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 {
    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);
}

/* Wallet Button */
.wallet-button {
    display: flex;
    align-items: center;
    gap: 8px;
    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;
    margin-right: 80px;
}

.wallet-button:hover {
    background-color: #a3e625;
    transform: scale(1.05);
}

/* Announcement Banner */
.announcement-banner {
    background: linear-gradient(135deg, var(--primary-color), #a3e625);
    color: var(--bg-dark);
    padding: 10px 20px;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 56px;
}

/* Chatroom Container */
.chatroom-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
    width: 100%;
}

/* Connection Status */
.connection-status {
    margin: 53px 0 20px 0;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(188, 255, 48, 0.3);
    background: rgba(188, 255, 48, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

/* Chat Interface */
.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid rgba(188, 255, 48, 0.1);
    overflow: hidden;
    /* min-height: 540px !important; */
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-darker);
    border-bottom: 1px solid rgba(188, 255, 48, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.online-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #848e9c;
    font-size: 14px;
}

.online-indicator {
    color: #00efa9;
    font-size: 8px;
}

/* Messages Container */
.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 255, 48, 0.3) transparent;
    /* min-height: 400px; */
    /* max-height: 500px; */
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background-color: rgba(188, 255, 48, 0.3);
    border-radius: 3px;
}

/* Message Styles */
.message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(188, 255, 48, 0.05);
    border: 1px solid rgba(188, 255, 48, 0.1);
    animation: fadeIn 0.3s ease;
    max-width: 80%;
}

.message.own {
    background: rgba(188, 255, 48, 0.1);
    border-color: rgba(188, 255, 48, 0.2);
    margin-left: auto;
    margin-right: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-username {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

.message-time {
    color: #848e9c;
    font-size: 12px;
}

.message-content {
    color: #fff;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Message Input */
.message-input-container {
    padding: 20px;
    background: var(--bg-darker);
    border-top: 1px solid rgba(188, 255, 48, 0.1);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid rgba(188, 255, 48, 0.3);
    border-radius: 25px;
    background: var(--bg-card);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
}

.input-wrapper input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-wrapper button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--bg-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.input-wrapper button:hover:not(:disabled) {
    background: #a3e625;
    transform: scale(1.05);
}

.input-wrapper button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.input-info {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.char-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem;
    background: var(--bg-dark);
    border-top: 1px solid var(--primary-color);
}

.copyright {
    color: #fff;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language selector */
.language-selector {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
}

/* Language button and dropdown */
.lang-btn {
    background-color: #242730;
    color: #fff;
    border: 1px solid #bcff30;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #242730;
    border: 1px solid #bcff30;
    border-radius: 5px;
    margin-top: 5px;
    z-index: 1000;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    padding: 10px 20px;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.lang-option:hover {
    background-color: #5e6673;
}

.lang-btn:hover {
    background-color: #bcff30;
    color: #000000;
}

/* Mobile search bar */
.search-bar-mobile {
    display: none;
    align-items: center;
    margin-right: 10px;
}

.search-icon {
    color: #bcff30;
    font-size: 20px;
    cursor: pointer;
}

.search-input-wrapper {
    display: none;
    position: absolute;
    top: 100%;
    right: 60px;
    background-color: #242730;
    border: 1px solid #bcff30;
    border-radius: 5px;
    padding: 10px;
    z-index: 1001;
}

.search-input-wrapper.show {
    display: flex;
    gap: 10px;
}

.search-bar-mobile input {
    padding: 8px;
    border: none;
    border-radius: 5px;
    background-color: #1e2329;
    color: #fff;
    width: 200px;
}

.search-btn-mobile {
    padding: 8px 16px;
    background-color: #bcff30;
    border: none;
    border-radius: 5px;
    color: #000000;
    cursor: pointer;
}

/* Bottom bar */
.bottom-bar {
    display: none;
}

/* Token prices in bottom bar */
.token-prices {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.token-price {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    background-color: rgba(188, 255, 48, 0.1);
    border: 1px solid rgba(188, 255, 48, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.token-price.active {
    display: flex;
}

.token-price img {
    width: 20px;
    height: 20px;
}

.token-price span {
    color: #bcff30;
    font-size: 12px;
    font-weight: 500;
}

.token-price:hover {
    background-color: rgba(188, 255, 48, 0.2);
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .top-bar {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: #181a20;
        z-index: 1000;
    }

    .logo-lang-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .language-selector {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
    }

    .nav-buttons {
        position: static;
        transform: none;
        width: 100%;
        margin: 10px 0;
        justify-content: center;
        gap: 15px;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 16px;
    }

    .wallet-button {
        align-self: center;
        margin-bottom: 10px;
        margin-right: 0;
    }

    .search-bar-mobile {
        display: flex;
    }

    .bottom-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background-color: #000000;
        border-top: 1px solid #bcff30;
        z-index: 900;
        padding: 10px;
    }

    .announcement-banner {
        margin-top: 140px;
        padding: 8px 15px;
        font-size: 14px;
    }

    .chatroom-container {
        padding: 10px;
        margin-top: 10px;
        margin-bottom: 85px;
        /* Add space for fixed input and bottom bar */
    }

    .connection-status {
        margin: 10px 0;
        padding: 12px 15px;
        font-size: 13px;
    }

    .chat-interface {
        min-height: calc(100vh - 380px);
        position: relative;
    }

    .chat-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .chat-title {
        font-size: 16px;
    }

    .online-count {
        font-size: 12px;
    }

    .messages-container {
        padding: 15px;
        min-height: 300px;
        /* max-height: calc(100vh - 380px); */
        padding-bottom: 20px;
    }

    .message {
        max-width: 90%;
        padding: 10px 12px;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .message-username {
        font-size: 13px;
    }

    .message-time {
        font-size: 11px;
    }

    .message-content {
        font-size: 14px;
    }

    .message-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-darker);
        border-top: 1px solid rgba(188, 255, 48, 0.1);
        padding: 15px;
        z-index: 950;
    }

    .input-wrapper {
        gap: 8px;
    }

    .input-wrapper input {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .input-wrapper button {
        width: 40px;
        height: 40px;
    }

    .char-count {
        font-size: 11px;
    }

    .footer {
        display: none;
    }

    /* User address display below input */
    .user-address-display {
        font-size: 11px;
        color: rgba(188, 255, 48, 0.7);
        font-family: monospace;
        margin: 5px;
    }

    .input-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        margin-right: 5px;
        float: right;
    }

    .wallet-button {
        display: none;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .logo span {
        font-size: 24px;
    }

    .nav-buttons {
        gap: 10px;
    }

    .nav-btn {
        padding: 4px 8px;
        font-size: 16px;
    }

    .wallet-button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .announcement-banner {
        margin-top: 160px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .chatroom-container {
        padding: 100px 0 10px 0;
    }

    .chat-interface {
        border-radius: 8px;
    }

    .messages-container {
        padding: 10px;
    }

    .message {
        padding: 8px 10px;
        border-radius: 8px;
    }

    .message-input-container {
        padding: 10px;
    }
}

* Welcome Message */ .welcome-message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(188, 255, 48, 0.1);
    border: 1px solid rgba(188, 255, 48, 0.2);
    text-align: center;
}

.welcome-message .message-username {
    color: var(--primary-color);
    font-weight: bold;
}

.welcome-message .message-content {
    color: #fff;
    font-style: italic;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.notification.success {
    background: linear-gradient(135deg, #bcff30, #a3e625);
    color: #000;
}

.notification.info {
    background: linear-gradient(135deg, #4639ff, #00efa9);
}