/* Global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    overflow: hidden;
    height: 100%;
    background-color: #e7e8e9;
    color: #333;
    overscroll-behavior: none; /* Prevent bounce/scroll effect on mobile */
    position: fixed;
    width: 100%;
}

/* App container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden; /* Prevent scrolling of entire container */
}

/* Header */
.header {
    background-color: #0088cc; /* Telegram blue */
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #0077b6;
    z-index: 5;
}

.app-title {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.app-title i {
    margin-right: 8px;
    color: white;
}

.status-active {
    color: #4ade80;
    font-weight: bold;
}

/* Chat container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #e7ebf0; /* Telegram background color */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.05"><text x="30" y="40" font-family="Arial" font-size="12" transform="rotate(45, 50, 50)">WONG~AI</text></svg>');
    position: relative;
    padding-bottom: 40px; /* Space for watermark */
}

/* Watermark */
.watermark {
    position: fixed;
    bottom: 75px; /* Adjust based on input container height */
    right: 10px;
    font-size: 11px;
    color: #546e7a;
    opacity: 0.7;
    text-align: right;
    pointer-events: none;
    z-index: 10;
    background-color: rgba(231, 235, 240, 0.7);
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Message styles */
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.user-message {
    align-self: flex-end;
    background-color: #effdde; /* Light green for user messages */
    border-bottom-right-radius: 4px;
    color: #000;
}

.bot-message {
    align-self: flex-start;
    background-color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.notification-message {
    align-self: center;
    background-color: rgba(231, 240, 253, 0.8);
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #d1e3fa;
}

.profit-message {
    background-color: #E8F5E9;
    border-left: 4px solid #4CAF50;
}

.loss-message {
    background-color: #FFEBEE;
    border-left: 4px solid #F44336;
}

.message-time {
    font-size: 0.7rem;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

/* Input container */
.input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e6e6e6;
    background-color: white;
    z-index: 5;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e6e6e6;
    border-radius: 20px;
    background-color: #f5f5f5;
    outline: none;
    font-size: 1rem;
}

#message-input:focus {
    border-color: #0088cc;
}

#send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: #0088cc; /* Telegram blue */
    color: white;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

#send-btn:hover {
    background-color: #0077b6;
}

/* Suggestion chips */
.suggestion-chips {
    display: flex;
    padding: 10px;
    gap: 10px;
    overflow-x: auto;
    background-color: white;
    border-top: 1px solid #e6e6e6;
    z-index: 5;
}

.chip {
    padding: 8px 15px;
    background-color: #f0f2f5;
    border: none;
    border-radius: 18px;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    color: #0088cc; /* Telegram blue */
}

.chip:hover {
    background-color: #e0e3e8;
}

/* Trading info card */
.trading-card {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    margin: 5px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-data {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.profit {
    color: #4CAF50;
    font-weight: bold;
}

.loss {
    color: #F44336;
    font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message {
    animation: fadeIn 0.3s ease;
}

/* Loader animation */
.loading {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #a0aec0;
    animation: bouncing 1.2s infinite alternate;
}

.loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bouncing {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Telegram style unread badge */
.status-badge {
    background-color: #4ade80;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

/* Wong AI branding banner */
.wong-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 136, 204, 0.9);
    color: white;
    text-align: center;
    padding: 4px 0;
    font-size: 10px;
    z-index: 4;
}

/* Timer Display */
.timer-display {
    position: fixed;
    top: 70px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 15px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Timer warning animation */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.timer-warning {
    color: #f44336;
    animation: blink 1s infinite;
}