:root {
    /* Core Colors */
    --bg-deep: #050505;
    --glass-bg: rgba(20, 20, 25, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    
    /* Accents */
    --primary-cyan: #00f2ff;
    --cyan-glow: rgba(0, 242, 255, 0.4);
    
    --primary-green: #00ff9d;
    --green-glow: rgba(0, 255, 157, 0.3);
    
    --primary-red: #ff2a5d;
    --red-glow: rgba(255, 42, 93, 0.3);
    
    --primary-blue: #2d6eff;
    
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
}

/* Brand assets */
.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, #ff9b9b, #ff4c4c 60%, #c62828 100%);
    box-shadow: 0 0 12px var(--cyan-glow);
    overflow: hidden;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-logo-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at 30% 30%, #ff9b9b, #ff4c4c 60%, #c62828 100%);
    box-shadow: 0 0 8px var(--cyan-glow);
}

.brand-logo-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(100, 200, 255, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    font-size: 0.85rem;
    color: var(--text-main);
}

.avatar-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 6px var(--cyan-glow);
}

.ai-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 12px var(--cyan-glow);
}

.ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-bubble-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--cyan-glow);
}

.chat-bubble-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(45, 110, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(0, 242, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(0, 255, 157, 0.05) 0%, transparent 50%);
    background-size: 150% 150%;
    animation: bgDrift 20s ease infinite alternate;
    overflow-x: hidden;
}

/* --- Animations --- */
@keyframes bgDrift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px var(--cyan-glow), inset 0 0 5px var(--cyan-glow); }
    50% { box-shadow: 0 0 25px var(--cyan-glow), inset 0 0 15px var(--cyan-glow); }
    100% { box-shadow: 0 0 10px var(--cyan-glow), inset 0 0 5px var(--cyan-glow); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Glass Components --- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.glass-panel {
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.glass-panel:hover {
    border-color: var(--glass-highlight);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* --- Layout --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.header-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.bot-icon { 
    color: var(--primary-cyan); 
    text-shadow: 0 0 10px var(--cyan-glow); 
}

.main-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* --- Left Panel --- */
.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.market-name { 
    color: var(--primary-cyan); 
    font-size: 1.4rem; 
    font-weight: 300;
    text-shadow: 0 0 15px var(--cyan-glow);
}

.stats-display {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 25px;
}

.stats-list { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    line-height: 1.6; 
}

.stats-list span { 
    font-weight: 700; 
}

.stats-list .green { 
    color: var(--primary-green); 
    text-shadow: 0 0 5px var(--green-glow); 
}

.stats-list .red { 
    color: var(--primary-red); 
    text-shadow: 0 0 5px var(--red-glow); 
}

.stats-list .blue { 
    color: var(--primary-blue); 
}

.current-price {
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    font-weight: 800;
    color: white;
    align-self: center;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.digit-container {
    padding: 25px;
    position: relative;
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    letter-spacing: 5px;
    pointer-events: none;
    user-select: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    position: relative;
    z-index: 1;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeInScale 0.5s forwards;
}

.grid-item:nth-child(1) { animation-delay: 0.1s; }
.grid-item:nth-child(2) { animation-delay: 0.15s; }
.grid-item:nth-child(3) { animation-delay: 0.2s; }
.grid-item:nth-child(4) { animation-delay: 0.25s; }
.grid-item:nth-child(5) { animation-delay: 0.3s; }
.grid-item:nth-child(6) { animation-delay: 0.35s; }
.grid-item:nth-child(7) { animation-delay: 0.4s; }
.grid-item:nth-child(8) { animation-delay: 0.45s; }
.grid-item:nth-child(9) { animation-delay: 0.5s; }
.grid-item:nth-child(10) { animation-delay: 0.55s; }

.digit-box {
    width: 100%; 
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.digit-box:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.digit-box.highlight-blue { 
    color: var(--primary-blue); 
    border-color: rgba(45, 110, 255, 0.5);
    box-shadow: 0 0 15px rgba(45, 110, 255, 0.2);
}

.digit-box.active {
    background: rgba(0, 242, 255, 0.15);
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
    animation: pulseGlow 2s infinite;
}

.percentage { 
    font-size: 0.75rem; 
    font-weight: 600; 
    color: #555; 
}

.percentage.high { 
    color: var(--primary-green); 
    text-shadow: 0 0 5px var(--green-glow); 
}

.percentage.low { 
    color: var(--primary-red); 
    text-shadow: 0 0 5px var(--red-glow); 
}

/* --- Right Panel --- */
.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.balance-row:hover { 
    background: rgba(0,0,0,0.5); 
}

.account-select {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.balance-amount {
    font-size: 1.2rem;
    font-weight: 700;
}

.tabs {
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 5px;
    border-radius: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.05);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover { 
    color: white; 
    background: rgba(255,255,255,0.05); 
}

.tab-btn.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(45, 110, 255, 0.4);
    transform: scale(1.05);
}

.controls-inner { 
    padding: 10px 5px; 
    position: relative; 
}

.pl-text { 
    color: var(--primary-green); 
    font-weight: 700; 
    margin-bottom: 20px; 
    font-size: 1.1rem;
    text-align: center;
    padding: 10px;
    background: rgba(0, 255, 157, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 157, 0.1);
}

/* Floating FAB */
.fab-email {
    position: absolute;
    right: 0;
    top: 55px;
    background: linear-gradient(135deg, #00bfa5, #009688);
    width: 50px; 
    height: 50px;
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 191, 165, 0.4);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    animation: float 4s ease-in-out infinite;
}

.fab-email:hover { 
    animation-play-state: paused; 
    transform: scale(1.1); 
    box-shadow: 0 8px 25px rgba(0, 191, 165, 0.6);
}

.tick-row {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 20px; 
    margin-top: 10px;
}

.auto-settings {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
}

.auto-settings-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auto-settings-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.auto-settings-row input {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    padding: 8px 10px;
    border-radius: 10px;
    font-weight: 700;
}

.auto-settings-row input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.15);
}

.auto-btn {
    background: linear-gradient(135deg, #7986cb, #5c6bc0);
    color: white;
    padding: 8px 25px;
    border-radius: 20px;
    font-weight: 700;
    display: flex; 
    align-items: center; 
    gap: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(92, 107, 192, 0.4);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auto-btn:hover { 
    transform: scale(1.05) translateY(-2px); 
    filter: brightness(1.2); 
}

.auto-btn:active { 
    transform: scale(0.95); 
}

.action-buttons { 
    display: flex; 
    gap: 20px; 
    margin-top: 30px; 
}

.btn-large {
    flex: 1;
    padding: 25px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-weight: 800;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.btn-large::after {
    content: '';
    position: absolute;
    top: 50%; 
    left: 50%; 
    width: 0; 
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-large:active::after { 
    width: 300px; 
    height: 300px; 
}

.btn-large:active { 
    transform: scale(0.96); 
}

.btn-over { 
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.8), rgba(46, 125, 50, 0.8));
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.btn-over:hover { 
    box-shadow: 0 15px 30px rgba(76, 175, 80, 0.5); 
    transform: translateY(-2px); 
}

.btn-under { 
    background: linear-gradient(145deg, rgba(211, 47, 47, 0.8), rgba(183, 28, 28, 0.8));
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3);
}

.btn-under:hover { 
    box-shadow: 0 15px 30px rgba(211, 47, 47, 0.5); 
    transform: translateY(-2px); 
}

.btn-val {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* Chat Modal */
.chat-modal {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: min(90vw, 380px);
    height: 500px;
    max-height: calc(100vh - 80px);
    overflow: hidden;
    background: transparent;
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.chat-modal.active {
    display: block;
}

.chat-container {
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 260px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    cursor: move;
    user-select: none;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    margin: 0;
}

.close-btn:hover {
    color: white;
}

.new-chat-btn {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    margin-right: 8px;
}

.new-chat-btn:hover {
    background: rgba(0, 242, 255, 0.2);
    transform: translateY(-1px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 255, 0.3);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 255, 0.5);
}

.chat-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 100%;
}

.chat-message .chat-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 82vw;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.user .chat-bubble {
    background: rgba(0, 242, 255, 0.15);
    color: var(--primary-cyan);
    border: 1px solid rgba(0, 242, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 242, 255, 0.08);
}

.chat-message.ai .chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.chat-message.ai.status .chat-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    opacity: 0.85;
    font-style: italic;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
}

#chatInput {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary-cyan);
}

#chatInput::placeholder {
    color: var(--text-muted);
}

#chatSend {
    background: var(--primary-cyan);
    color: black;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#chatSend:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Chat Confirmation Buttons */
.chat-confirmation-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-self: stretch;
    padding: 0 5px;
}

.chat-confirmation-buttons button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-green);
    border: 1px solid var(--success-green) !important;
}

.confirm-btn:hover {
    background: rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

.modify-btn {
    background: rgba(0, 242, 255, 0.15);
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan) !important;
}

.modify-btn:hover {
    background: rgba(0, 242, 255, 0.25);
    transform: translateY(-2px);
}

/* Bot Selection Modal */
.bot-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.bot-selection-modal.active {
    display: flex;
}

.bot-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.bot-selection-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    animation: fadeInScale 0.3s ease;
}

.bot-selection-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-selection-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-action-btn {
    background: rgba(0, 242, 255, 0.12);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.bot-action-btn:hover {
    background: rgba(0, 242, 255, 0.2);
    transform: translateY(-1px);
}

.bot-selection-header h2 {
    color: var(--primary-cyan);
    font-size: 1.5rem;
    font-weight: 700;
}

.bot-list {
    padding: 25px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.bot-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bot-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bot-card-actions .bot-action-btn {
    flex: 1;
    text-align: center;
}

.bot-card:hover {
    border-color: var(--primary-cyan);
    background: rgba(0, 242, 255, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.2);
}

.bot-card.ai-generated {
    border-color: rgba(0, 255, 157, 0.3);
}

.bot-card.ai-generated:hover {
    border-color: var(--primary-green);
    background: rgba(0, 255, 157, 0.05);
    box-shadow: 0 10px 30px rgba(0, 255, 157, 0.2);
}

.bot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bot-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.bot-card-risk {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.bot-card-risk.low {
    background: rgba(76, 175, 80, 0.2);
    color: var(--primary-green);
}

.bot-card-risk.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.bot-card-risk.high {
    background: rgba(255, 42, 93, 0.2);
    color: var(--primary-red);
}

.bot-card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.bot-card-details {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bot-card-badge {
    display: inline-block;
    background: rgba(0, 255, 157, 0.15);
    color: var(--primary-green);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 8px;
}

/* --- Responsive --- */
@media (min-width: 900px) {
    .main-container { 
        flex-direction: row; 
        align-items: flex-start; 
        padding: 40px; 
    }
    
    .visual-panel { 
        flex: 2; 
        margin-right: 30px; 
    }
    
    .control-panel { 
        flex: 1; 
        position: sticky; 
        top: 100px; 
    }
    
    .digit-box { 
        font-size: 2.2rem; 
    }
    
    .watermark { 
        font-size: 2.5rem; 
    }
}

@media (max-width: 900px) {
    .main-container {
        flex-direction: column;
    }

    .visual-panel,
    .control-panel {
        width: 100%;
    }

    .digit-box {
        font-size: 1.4rem;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1001;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: var(--primary-cyan);
    font-size: 1.2rem;
}

.sidebar-content {
    padding: 10px;
}

.menu-item {
    padding: 15px 20px;
    margin: 5px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-top: 5px;
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

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

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-muted);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.dropdown-item.selected {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary-cyan);
}

/* Market dropdown specific styling */
#marketDropdown {
    position: absolute;
    top: 40px;
    left: 10px;
    right: 10px;
    width: auto;
}

/* Account dropdown specific styling */
#accountDropdown {
    top: 100%;
    left: 0;
    min-width: 180px;
}

/* Stake buttons */
.stake-btn, .tick-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stake-btn:hover, .tick-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.stake-btn:active, .tick-btn:active {
    transform: scale(0.95);
}

#stakeInput {
    outline: none;
}

#stakeInput::-webkit-inner-spin-button,
#stakeInput::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Digit box selection */
.digit-box.selected {
    border: 2px solid #2196F3 !important;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.6);
    transform: scale(1.05);
    color: #2196F3;
    text-shadow: 0 0 10px rgba(33, 150, 243, 0.8);
}

.digit-box.clickable {
    cursor: pointer;
}

.digit-box.clickable:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Action buttons grid for MATCH */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.btn-even {
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.8), rgba(46, 125, 50, 0.8));
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.btn-even:hover {
    box-shadow: 0 15px 30px rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
}

.btn-odd {
    background: linear-gradient(145deg, rgba(211, 47, 47, 0.8), rgba(183, 28, 28, 0.8));
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3);
}

.btn-odd:hover {
    box-shadow: 0 15px 30px rgba(211, 47, 47, 0.5);
    transform: translateY(-2px);
}

.btn-match, .btn-diff {
    background: linear-gradient(145deg, rgba(45, 110, 255, 0.8), rgba(30, 80, 200, 0.8));
    box-shadow: 0 10px 20px rgba(45, 110, 255, 0.3);
}

.btn-match:hover, .btn-diff:hover {
    box-shadow: 0 15px 30px rgba(45, 110, 255, 0.5);
    transform: translateY(-2px);
}

/* Contract result animations */
.digit-box.result-win {
    animation: pulseGreen 1s ease-in-out 3;
    border: 2px solid #4CAF50 !important;
}

.digit-box.result-loss {
    animation: pulseRed 1s ease-in-out 3;
    border: 2px solid #f44336 !important;
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(76, 175, 80, 1);
        transform: scale(1.1);
    }
}

@keyframes pulseRed {
    0%, 100% {
        box-shadow: 0 0 20px rgba(244, 67, 54, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(244, 67, 54, 1);
        transform: scale(1.1);
    }
}

/* Trend View Styles */
.trend-view {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pie-chart-container {
    position: relative;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.pie-chart {
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.3));
}

.pie-chart circle {
    transition: all 0.5s ease;
}

/* Toast Notifications */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes blink {
    0%, 20%, 50%, 80%, 100% {
        opacity: 1;
    }
    40% {
        opacity: 0.3;
    }
    60% {
        opacity: 0.6;
    }
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(100, 200, 255, 0.8);
    display: inline-block;
}

.toast {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-success {
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95)) !important;
}

.toast-error {
    background: linear-gradient(145deg, rgba(244, 67, 54, 0.95), rgba(211, 47, 47, 0.95)) !important;
}

.toast-info {
    background: linear-gradient(145deg, rgba(33, 150, 243, 0.95), rgba(30, 136, 229, 0.95)) !important;
}

/* --- Modal Styles --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 242, 255, 0.2);
    border: 1px solid rgba(100, 200, 255, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--text-main);
}

.modal-actions,
.modal-header > div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.modal-filters {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(100, 200, 255, 0.1);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(100, 200, 255, 0.3);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 200, 255, 0.5);
}

/* --- Trade History Modal --- */
.trade-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trade-item-modal {
    padding: 15px;
    background: rgba(100, 200, 255, 0.05);
    border-left: 3px solid var(--primary-cyan);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.trade-item-modal:hover {
    background: rgba(100, 200, 255, 0.1);
    border-left-color: var(--primary-green);
}

.trade-item-modal.win {
    border-left-color: var(--primary-green);
}

.trade-item-modal.loss {
    border-left-color: var(--primary-red);
}

.trade-item-info {
    display: flex;
    gap: 15px;
    flex: 1;
    align-items: center;
}

.trade-result {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

.trade-result.win {
    background: rgba(0, 255, 157, 0.2);
    color: var(--primary-green);
}

.trade-result.loss {
    background: rgba(255, 42, 93, 0.2);
    color: var(--primary-red);
}

.trade-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trade-details small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.trade-amount {
    font-size: 1rem;
    font-weight: bold;
    min-width: 80px;
    text-align: right;
}

/* --- Statistics Modal --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    padding: 15px;
    background: rgba(100, 200, 255, 0.05);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-cyan);
}

.stat-value.green {
    color: var(--primary-green);
}

.stat-value.red {
    color: var(--primary-red);
}

/* --- Settings Modal --- */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--primary-cyan);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.setting-item input[type="checkbox"] {
    cursor: pointer;
}

.setting-item input[type="number"] {
    width: 100px;
}

/* --- About Modal --- */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-section {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.1);
}

.about-section:last-child {
    border-bottom: none;
}

.about-section h3 {
    color: var(--primary-cyan);
    margin-bottom: 10px;
}

.about-section p {
    color: var(--text-muted);
    line-height: 1.6;
}

.about-section ul {
    color: var(--text-muted);
}

.about-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* --- Button Styles in Modals --- */
.export-btn,
.import-btn,
.clear-btn {
    padding: 8px 12px;
    border: 1px solid rgba(100, 200, 255, 0.3);
    background: rgba(100, 200, 255, 0.1);
    color: var(--primary-cyan);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.export-btn:hover {
    background: rgba(100, 200, 255, 0.2);
    border-color: var(--primary-cyan);
}

.clear-btn {
    color: var(--primary-red);
    border-color: rgba(255, 42, 93, 0.3);
    background: rgba(255, 42, 93, 0.1);
}

.clear-btn:hover {
    background: rgba(255, 42, 93, 0.2);
    border-color: var(--primary-red);
}

.import-btn {
    color: var(--primary-green);
    border-color: rgba(0, 255, 157, 0.3);
    background: rgba(0, 255, 157, 0.1);
}

.import-btn:hover {
    background: rgba(0, 255, 157, 0.2);
    border-color: var(--primary-green);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--primary-cyan);
}

