:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #f59e0b;
    --text-color: #000000;
    --light-gray: #f0f0f0;
    --dark-gray: #e0e0e0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --chat-bg: #FFF0F5;
    --header-text: #ffffff;
    --header-bg: #000000;
    --user-bubble: #000000;
    --bot-bubble: #ffffff;
    --input-bg: #ffffff;
    --input-border: #cccccc;
    --input-text: #000000;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--chat-bg);
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Ensure all elements use border-box sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Main header styles */
.main-header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    width: 100%;
    height: 100px;
    border-radius: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
}

.logo {
    height: 100px;
    width: auto;
}

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

.home-btn {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.home-btn:hover {
    background: var(--secondary-color);
}

/* Old header styles for compatibility */
header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--header-bg);
    color: var(--header-text);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--header-text);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    font-weight: 600;
    color: #ffffff !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    font-weight: 600;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-style: italic;
    font-weight: 400;
    font-size: 0.85rem;
    gap: 8px;
}

/* Chat Container */
.chat-container {
    background: var(--chat-bg);
    padding: 0;
    margin: 0;
    min-height: calc(100vh - 100px);
}

/* Removed iframe-specific styles - now optimized for direct mobile viewing */

.chat-messages {
    padding: 10px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--chat-bg);
    color: var(--text-color);
}

.message {
    display: flex;
    max-width: 80%;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-out;
}

.message .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: white;
}

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

.message.user .avatar {
    background: var(--primary-color);
    color: white;
    margin-right: 0;
    margin-left: 12px;
}

.message.bot .content {
    background: var(--bot-bubble);
    padding: 6px 10px;
    border-radius: 14px 14px 14px 4px;
    color: var(--text-color);
    border: 1px solid #cccccc;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.user .content {
    background: var(--user-bubble);
    color: white;
    border-radius: 14px 14px 0 14px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    max-width: 80%;
    word-wrap: break-word;
    color: white !important;
    font-size: 0.8rem;
}

.message .content p {
    margin: 0;
    line-height: 1.5;
}

.chat-input-container {
    display: flex;
    padding: 6px;
    border-top: 1px solid var(--input-border);
    background: var(--chat-bg);
    gap: 4px;
    align-items: flex-end;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    min-height: 44px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

#user-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--input-border);
    border-radius: 18px;
    font-size: 12px;
    resize: none;
    max-height: 80px;
    min-height: 32px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--input-text);
}

#user-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#user-input::placeholder {
    color: #9ca3af;
}

#send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    font-size: 0.8rem;
}

#send-button:hover {
    background: #5048e5;
    transform: scale(1.05);
}

/* Booking button styles */
.booking-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px 0;
    font-weight: 500;
}

.booking-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Remove this duplicate/conflicting chat container rule */

.message.bot .class-card {
    background: var(--card-bg);
    border: 1px solid #cccccc;
    border-radius: 8px;
    padding: 8px;
    margin: 6px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 100%;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.bot .class-card h4 {
    margin: 0 0 4px 0;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.message.bot .class-card p {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    opacity: 0.9;
    color: var(--text-color);
}

.message.bot .class-card .class-description {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #cccccc;
    color: var(--text-color);
    font-size: 0.9em;
}

.message.bot .class-card i {
    width: 16px;
    margin-right: 8px;
    color: #9ca3af;
}

.message.bot .class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border-color: var(--primary-color);
}

.class-card {
    background-color: var(--card-bg);
    border: 1px solid #cccccc;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeIn 0.3s ease-out;
    padding: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.class-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.class-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.class-card p {
    margin: 5px 0;
    color: var(--text-color);
    font-size: 0.95em;
}

.class-card strong {
    color: var(--primary-color);
    font-weight: 600;
}

.class-card .class-time {
    font-weight: bold;
    color: var(--accent-color);
}

/* Class Grid Section */
.class-grid-container {
max-width: 1200px;
margin: 2rem auto;
padding: 0 1rem;
}

.class-grid-container h2 {
color: var(--primary-color);
margin-bottom: 1.5rem;
text-align: center;
font-size: 1.8rem;
}

.class-grid {
margin: 0 auto;
}

/* Accordion styles */
.classes-accordion {
display: flex;
flex-direction: column;
gap: 10px;
}

.accordion-section {
background: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
overflow: hidden;
transition: box-shadow 0.3s ease;
}

.accordion-section:hover {
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.accordion-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
background: var(--primary-color);
color: white;
cursor: pointer;
user-select: none;
transition: background-color 0.2s;
}

.accordion-header:hover {
background: var(--secondary-color);
}

.accordion-header h3 {
margin: 0;
font-size: 1.3em;
font-weight: 600;
}

.class-count {
font-size: 0.9em;
opacity: 0.9;
background: rgba(255,255,255,0.2);
padding: 4px 8px;
border-radius: 12px;
}

.accordion-toggle {
font-size: 1.2em;
font-weight: bold;
transition: transform 0.2s;
}

.accordion-section.open .accordion-toggle {
transform: rotate(180deg);
}

.accordion-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
}

.day-classes-grid {
display: grid;
}

.class-card {
background: var(--card-bg);
border: 1px solid #4b5563;
border-radius: 12px;
padding: 20px;
margin-bottom: 16px;
transition: transform 0.2s, box-shadow 0.2s;
color: var(--text-color);
}

.class-card:hover {
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
border-color: var(--primary-color);
}

.class-card h4 {
margin: 0 0 12px 0;
color: #f3f4f6;
font-size: 1.2em;
font-weight: 600;
line-height: 1.3;
}

.class-card p {
margin: 8px 0;
color: var(--text-color);
font-size: 0.95em;
line-height: 1.5;
}

.class-card .class-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #cccccc;
    color: var(--text-color);
    font-size: 0.95em;
    line-height: 1.5;
}

.class-card i {
    width: 18px;
    margin-right: 8px;
    color: #9ca3af;
}

/* Chat-specific card styles */
.message.bot .class-card {
    margin: 15px 0;
    background: var(--card-bg);
    border: 1px solid #4b5563;
}

.message.bot .class-card h4 {
    color: var(--primary-color);
}

.message.bot .suggestion-note {
    font-size: 0.95em;
    color: var(--text-color);
    margin-bottom: 12px;
    font-style: italic;
}

.message.bot .more-classes {
    font-size: 0.9em;
    color: var(--text-color);
    margin-top: 10px;
    font-style: italic;
}

footer {
    text-align: center;
    padding: 15px;
    color: #6c757d;
    font-size: 0.85em;
    margin-top: auto;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    header {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    header h1 {
        font-size: 1.4rem;
        flex-direction: column;
        gap: 5px;
    }

    header p {
        font-size: 0.9rem;
        margin: 5px 0 0 0;
    }

    /* Chat container mobile optimization */
    .chat-container {
        border-radius: 0;
        min-height: calc(100vh - 100px);
    }

    .chat-messages {
        padding: 10px;
        padding-bottom: 80px;
        gap: 0.5rem;
    }

    .message {
        max-width: 90%;
    }

    .message .avatar {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        margin-right: 6px;
    }

    .message.user .avatar {
        margin-right: 0;
        margin-left: 8px;
    }

    .message .content {
        padding: 6px 10px;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    .chat-input-container {
        padding: 6px;
        flex-wrap: wrap;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }

    #user-input {
        padding: 6px 10px;
        font-size: 14px;
        border-radius: 16px;
    }

    #send-btn {
        width: 40px;
        height: 40px;
        margin-left: 8px;
    }

    /* Class grid mobile optimization */
    .class-grid-container {
        margin: 15px auto;
        padding: 0 10px;
    }

    .class-grid-container h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .day-classes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .class-card {
        padding: 15px;
        margin-bottom: 12px;
    }

    .class-card h3,
    .class-card h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .class-card p {
        font-size: 0.9rem;
        margin: 4px 0;
    }

    .class-card .class-description {
        font-size: 0.85rem;
        margin-top: 10px;
        padding-top: 10px;
    }

    /* Accordion mobile optimization */
    .accordion-header {
        padding: 15px;
    }

    .accordion-header h3 {
        font-size: 1.1rem;
    }

    .class-count {
        font-size: 0.8rem;
        padding: 3px 6px;
    }

    /* Footer mobile optimization */
    footer {
        padding: 12px;
        font-size: 0.8rem;
    }
}

/* Additional text color fixes */
.message.bot .content p,
.message.bot .content div,
.message.bot .content span {
    color: var(--text-color) !important;
}

/* Ensure booking summary text is black */
.booking-summary p,
.booking-summary div,
.booking-summary span {
    color: #000000 !important;
}

/* Calendar text colors */
.date-card.selected .day-name,
.date-card.selected .month {
    color: white !important;
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
    body {
        padding: 0;
    }

    header {
        padding: 12px;
        margin-bottom: 12px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    header p {
        font-size: 0.85rem;
    }


    .chat-messages {
        padding: 8px;
        padding-bottom: 80px;
        gap: 0.5rem;
    }

    .message .content {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .chat-input-container {
        padding: 6px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }

    #user-input {
        padding: 6px 8px;
        font-size: 14px;
    }

    #send-btn {
        width: 36px;
        height: 36px;
    }

    .class-grid-container {
        padding: 0 5px;
    }

    .class-grid-container h2 {
        font-size: 1.2rem;
    }

    .day-classes-grid {
        padding: 12px;
        gap: 12px;
    }

    .class-card {
        padding: 12px;
    }

    .class-card h3,
    .class-card h4 {
        font-size: 1rem;
    }

    .class-card p {
        font-size: 0.85rem;
    }

    .accordion-header {
        padding: 12px;
    }

    .accordion-header h3 {
        font-size: 1rem;
    }
}

/* Mobile optimizations for direct viewing */
@media screen and (max-width: 768px) {
    /* Optimize touch targets for mobile */
    button,
    .date-card,
    .time-slot,
    .class-card {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Improve text readability on mobile */
    .message .content,
    .class-card p,
    .class-card h4 {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}
