File size: 8,337 Bytes
822ac98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
"""
Brand-specific theming module for the AI Messaging System Visualization Tool.

Provides dynamic color schemes and styling based on selected brand.
"""

import streamlit as st
from typing import Dict, Tuple

# Brand color definitions (primary, secondary, accent)
BRAND_COLORS = {
    "base": {
        "primary": "#FFD700",      # Gold
        "secondary": "#2C2C2C",    # Dark gray
        "accent": "#1A1A1A",       # Black
        "text": "#FFFFFF",         # White
        "background": "#0D0D0D",   # Very dark
        "sidebar_bg": "#8B7500"    # Darker gold for sidebar
    },
    "drumeo": {
        "primary": "#5DADE2",      # Light blue
        "secondary": "#FFD700",    # Gold
        "accent": "#2874A6",       # Darker blue
        "text": "#FFFFFF",         # White
        "background": "#1C2833",   # Dark blue-gray
        "sidebar_bg": "#1A4D6B"    # Darker blue for sidebar
    },
    "pianote": {
        "primary": "#EC7063",      # Light red
        "secondary": "#FFD700",    # Gold
        "accent": "#C0392B",       # Darker red
        "text": "#FFFFFF",         # White
        "background": "#1C1C1C",   # Dark
        "sidebar_bg": "#8B2500"    # Darker red for sidebar
    },
    "guitareo": {
        "primary": "#58D68D",      # Light green
        "secondary": "#FFD700",    # Gold
        "accent": "#229954",       # Darker green
        "text": "#FFFFFF",         # White
        "background": "#1C2E1F",   # Dark green-gray
        "sidebar_bg": "#1B5E20"    # Darker green for sidebar
    },
    "singeo": {
        "primary": "#BB8FCE",      # Light purple
        "secondary": "#FFD700",    # Gold
        "accent": "#7D3C98",       # Darker purple
        "text": "#FFFFFF",         # White
        "background": "#1F1926",   # Dark purple-gray
        "sidebar_bg": "#4A148C"    # Darker purple for sidebar
    }
}

# Brand emojis
BRAND_EMOJIS = {
    "drumeo": "🥁",
    "pianote": "🎹",
    "guitareo": "🎸",
    "singeo": "🎤"
}


def get_brand_theme(brand: str) -> Dict[str, str]:
    """
    Get color theme for specified brand.

    Args:
        brand: Brand name (drumeo, pianote, guitareo, singeo)

    Returns:
        dict: Color theme dictionary
    """
    brand_lower = brand.lower() if brand else "base"
    return BRAND_COLORS.get(brand_lower, BRAND_COLORS["base"])


def get_brand_emoji(brand: str) -> str:
    """
    Get emoji for specified brand.

    Args:
        brand: Brand name

    Returns:
        str: Brand emoji
    """
    brand_lower = brand.lower() if brand else ""
    return BRAND_EMOJIS.get(brand_lower, "🎵")


def apply_theme(brand: str = None):
    """
    Apply brand-specific theme to Streamlit app.

    Args:
        brand: Brand name (optional, uses session state if not provided)
    """
    if brand is None:
        brand = st.session_state.get("selected_brand", "base")

    theme = get_brand_theme(brand)

    # Custom CSS for brand theming
    css = f"""
    <style>
    /* Global styles */
    .stApp {{
        background-color: {theme['background']};
    }}

    /* Text colors */
    h1, h2, h3, h4, h5, h6 {{
        color: {theme['primary']} !important;
    }}

    p, span, div {{
        color: {theme['text']} !important;
    }}

    /* Button styles */
    .stButton > button {{
        background-color: {theme['primary']};
        color: {theme['background']};
        border: none;
        border-radius: 8px;
        padding: 0.5rem 1rem;
        font-weight: 600;
        transition: all 0.3s ease;
    }}

    .stButton > button:hover {{
        background-color: {theme['secondary']};
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }}

    /* Download button */
    .stDownloadButton > button {{
        background-color: {theme['accent']};
        color: {theme['text']};
        border-radius: 8px;
        font-weight: 600;
    }}

    /* Input fields */
    .stTextInput > div > div > input,
    .stTextArea > div > div > textarea,
    .stNumberInput > div > div > input {{
        background-color: {theme['secondary']};
        color: {theme['text']};
        border: 1px solid {theme['primary']};
        border-radius: 5px;
    }}

    /* Select boxes */
    .stSelectbox > div > div {{
        background-color: {theme['secondary']};
        color: {theme['text']};
        border-radius: 5px;
    }}

    /* Multiselect */
    .stMultiSelect > div > div {{
        background-color: {theme['secondary']};
        border-radius: 5px;
    }}

    /* Tabs */
    .stTabs [data-baseweb="tab-list"] {{
        gap: 8px;
    }}

    .stTabs [data-baseweb="tab"] {{
        background-color: {theme['secondary']};
        color: {theme['text']};
        border-radius: 5px 5px 0 0;
        padding: 10px 20px;
        font-weight: 600;
    }}

    .stTabs [aria-selected="true"] {{
        background-color: {theme['primary']};
        color: {theme['background']};
    }}

    /* Progress bar */
    .stProgress > div > div > div {{
        background-color: {theme['primary']};
    }}

    /* Expanders */
    .streamlit-expanderHeader {{
        background-color: {theme['secondary']};
        color: {theme['primary']};
        border-radius: 5px;
        font-weight: 600;
    }}

    /* Cards/Containers */
    .element-container {{
        background-color: transparent;
    }}

    /* Sidebar */
    [data-testid="stSidebar"] {{
        background-color: {theme['sidebar_bg']};
    }}

    [data-testid="stSidebar"] h1,
    [data-testid="stSidebar"] h2,
    [data-testid="stSidebar"] h3 {{
        color: {theme['text']} !important;
    }}

    [data-testid="stSidebar"] p,
    [data-testid="stSidebar"] span,
    [data-testid="stSidebar"] div,
    [data-testid="stSidebar"] label {{
        color: {theme['text']} !important;
    }}

    /* Metrics */
    [data-testid="stMetricValue"] {{
        color: {theme['primary']} !important;
        font-size: 2rem;
        font-weight: bold;
    }}

    /* Divider */
    hr {{
        border-color: {theme['primary']};
        opacity: 0.3;
    }}

    /* Checkbox */
    .stCheckbox {{
        color: {theme['text']};
    }}

    /* Radio */
    .stRadio > div {{
        color: {theme['text']};
    }}

    /* Success/Info/Warning/Error boxes */
    .stSuccess {{
        background-color: rgba(88, 214, 141, 0.1);
        color: {theme['text']};
    }}

    .stInfo {{
        background-color: rgba(93, 173, 226, 0.1);
        color: {theme['text']};
    }}

    .stWarning {{
        background-color: rgba(255, 215, 0, 0.1);
        color: {theme['text']};
    }}

    .stError {{
        background-color: rgba(236, 112, 99, 0.1);
        color: {theme['text']};
    }}

    /* DataFrames */
    .dataframe {{
        border: 1px solid {theme['primary']};
    }}

    /* Custom card styling */
    .message-card {{
        background-color: {theme['secondary']};
        border-left: 4px solid {theme['primary']};
        border-radius: 8px;
        padding: 1rem;
        margin: 0.5rem 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }}

    .message-card:hover {{
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        transform: translateX(4px);
        transition: all 0.3s ease;
    }}

    /* Small text */
    .small {{
        font-size: 0.85rem;
        opacity: 0.7;
    }}

    /* Badge styles */
    .badge {{
        display: inline-block;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
        background-color: {theme['accent']};
        color: {theme['text']};
    }}
    </style>
    """

    st.markdown(css, unsafe_allow_html=True)


def create_card(content: str, key: str = None) -> None:
    """
    Create a styled card container.

    Args:
        content: HTML content to display in card
        key: Optional unique key for the card
    """
    st.markdown(
        f'<div class="message-card">{content}</div>',
        unsafe_allow_html=True
    )


def create_badge(text: str, color: str = None) -> str:
    """
    Create a styled badge element.

    Args:
        text: Badge text
        color: Optional custom color

    Returns:
        str: HTML for badge
    """
    style = f'background-color: {color};' if color else ''
    return f'<span class="badge" style="{style}">{text}</span>'