:root {
    /* Original Palette */
    --primary-color: #00A9E0;       /* Electric Blue */
    --secondary-color: #70C8E0;     /* Lighter Electric Blue */
    --accent-color: #00E0C8;        /* Electric Teal/Cyan for accents */
    --text-color-dark: #222222;     /* Dark Grey */
    --text-color-light: #F0F0F0;    /* Light Grey/Off-White for dark backgrounds */
    --background-color-main: #F4F7F9; /* Very Light Cool Grey */
    --background-color-widget: #FFFFFF; /* White for widgets */
    --border-color-light: #fff;  /* White for all borders */
    --border-color-dark: #fff;   /* White for all borders */
    --button-primary-bg: var(--primary-color);
    --button-primary-text: #FFFFFF;
    --box-shadow-light: 0 2px 8px rgba(0, 169, 224, 0.1);
    --box-shadow-strong: 0 4px 15px rgba(0, 169, 224, 0.15);
    --glow-effect: 0 0 15px rgba(0, 224, 200, 0.5);
    --border-radius: 12px; /* Slightly more rounded corners */
    --transition-speed: 0.3s;
    --animation-duration: 0.5s;

    /* Legacy variables for home.html compatibility */
    --text-color: #333;
    --light-text-color: #fff;
    --bg-color: #fff;
    --light-gray-bg: #f4f8fb;
    --font-family-opensans: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif; /* Default font for the app */
    color: var(--text-color-dark);
    background-color: var(--background-color-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* From style2.css body, for pages that use its styling (e.g. home.html) */
    overflow-x: hidden;
}

html { /* From style2.css */
    scroll-behavior: smooth;
    font-size: 16px; /* Set a base font size */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* overflow: hidden; removed to allow scrolling */
}

/* Header (Matches your example for ai-chat.html, login.html) */
.app-header.sticky {
    width: 100%;
    background-color: transparent; /* Make header transparent */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px; /* Adjust padding */
    box-shadow: none; /* Remove shadow for a flatter look */
    position: sticky;
    top: 0;
    z-index: 10;
    height: 70px; /* Adjust height */
    flex-shrink: 0;
    /* border-bottom: 1px solid #fff; White border removed */
}

.app-header #logo-img {
    height: 40px; /* Standardized logo height */
    vertical-align: middle; /* Ensure proper alignment */
}

.app-header .top-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.app-header .top-nav a {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-color-dark);
    position: relative; /* Needed for the ::after pseudo-element */
    padding-bottom: 8px; /* Match home.html nav a for consistent baseline */
    transition: color 0.3s ease; /* Added transition for color */
}

.app-header .top-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width var(--transition-speed) ease, background-color var(--transition-speed) ease;
    opacity: 0;
}

.app-header .top-nav a:hover,
.app-header .top-nav a.active {
    color: var(--primary-color);
}

.app-header .top-nav a:hover::after,
.app-header .top-nav a.active::after {
    width: 100%;
    opacity: 1;
}

/* Main Content Area (for ai-chat.html, login.html) */
.main-content {
    display: flex;
    flex-grow: 1;
    /* overflow: hidden; removed to allow scrolling */
    margin-top: 0;
    transition: margin 0.3s, width 0.3s;
}

/* Collapsible Sidebar for ai-chat.html */
.sidebar-collapsible {
    width: 16rem;
    min-width: 12rem;
    max-width: 18rem;
    background: var(--background-color-widget);
    border-right: 1px solid #fff;
    box-shadow: 2px 0 8px rgba(0, 169, 224, 0.04);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center; /* Vertically center children */
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1), min-width 0.4s cubic-bezier(0.4,0,0.2,1), max-width 0.4s cubic-bezier(0.4,0,0.2,1), padding 0.4s cubic-bezier(0.4,0,0.2,1), margin 0.4s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    z-index: 10;
    font-size: 1rem;
    gap: 0.5rem;
}

.sidebar-collapsible.collapsed {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    overflow-x: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    /* Padding is already white space, so no change needed for padding */
    box-shadow: none;
    padding: 0;
    margin: 0 auto;
    width: 80%;
    max-width: 48px;
    min-width: 36px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1), max-width 0.4s cubic-bezier(0.4,0,0.2,1), min-width 0.4s cubic-bezier(0.4,0,0.2,1), height 0.4s cubic-bezier(0.4,0,0.2,1), margin 0.4s cubic-bezier(0.4,0,0.2,1);
    outline: none;
    position: relative;
}

/* Vertically center sidebar toggle on desktop */
@media (min-width: 769px) {
    .sidebar-collapsible {
        position: relative;
    }
    .sidebar-toggle {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        margin-left: 0;
        margin-right: 0;
        z-index: 20;
    }
    .sidebar-logo {
        position: absolute;
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        z-index: 10;
    }
}
.sidebar-toggle:focus {
    outline: none;
}
.sidebar-toggle:hover {
    background: none;
}

.hamburger-line {
    display: block;
    width: 28px;
    height: 3px;
    background: #222;
    margin: 4px 0;
    border-radius: 2px;
    transition: background 0.2s;
}

.sidebar-collapsible.collapsed .sidebar-toggle {
    align-items: center;
    justify-content: flex-start;
    margin: 12px auto 18px auto;
    position: static;
    top: auto;
    left: auto;
    transform: none;
    display: flex;
}

.sidebar-collapsible:not(.collapsed) .sidebar-toggle {
    align-items: flex-end;
    justify-content: flex-start;
    margin: 12px 0 18px 0;
    position: static;
    top: auto;
    left: auto;
    transform: none;
}

.tab-navigation-vertical {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 10px 10px 10px;
}

.sidebar-collapsible.collapsed .tab-btn {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    font-size: 0;
    min-width: 40px;
    min-height: 40px;
    transition: background 0.2s, color 0.2s, font-size 0.3s, padding 0.3s, min-width 0.3s;
}
.sidebar-collapsible.collapsed .tab-btn::before {
    font-size: 1.2em;
    display: inline-block;
}
.sidebar-collapsible .tab-btn {
    text-align: left;
    justify-content: flex-start;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    min-width: 100px;
    min-height: 40px;
    transition: background 0.2s, color 0.2s, font-size 0.3s, padding 0.3s, min-width 0.3s;
    margin-bottom: 0.7em;
    outline: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
}
.sidebar-collapsible .tab-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    z-index: 2;
}
.sidebar-collapsible .tab-btn.active,
.sidebar-collapsible .tab-btn:active,
.sidebar-collapsible .tab-btn:hover,
.sidebar-collapsible .tab-btn:focus {
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
}

/* Hide text in collapsed state, show only icons if desired (optional) */
.sidebar-collapsible.collapsed .tab-btn span {
    display: none;
}
.sidebar-collapsible.collapsed .sidebar-nav-links span {
    display: none;
}
.sidebar-collapsible .sidebar-logout-btn {
    background: none;
    color: #e74c3c !important;
    border-radius: 0.5em;
    font-weight: 400;
    padding: 0 0 0 0.5em;
    margin-top: 0;
    text-align: left;
    box-shadow: none;
    border: none;
    transition: color 0.2s;
    letter-spacing: 0;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5em;
    min-height: 2.75em;
    cursor: pointer;
    outline: none;
}
.sidebar-collapsible .sidebar-logout-btn:focus-visible {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
    z-index: 2;
}
.sidebar-collapsible .sidebar-logout-btn svg {
    margin-left: 0;
    margin-right: 0;
    display: inline-block;
    vertical-align: middle;
    width: 1.4em;
    height: 1.4em;
    pointer-events: none;
}
.sidebar-collapsible.collapsed .sidebar-logout-btn {
    justify-content: center;
}
.sidebar-collapsible.collapsed .sidebar-logout-btn svg {
    margin-left: auto;
    margin-right: auto;
    display: block;
}
/* Hide all bottom nav icons except logout when collapsed */
.sidebar-collapsible.collapsed .sidebar-nav-links > a:not(.sidebar-logout-btn) {
    display: none !important;
}
.sidebar-collapsible .sidebar-logout-btn:hover,
.sidebar-collapsible .sidebar-logout-btn:focus {
    color: #b03a2e !important;
    background: none;
    text-decoration: underline;
    box-shadow: none;
}
.sidebar-collapsible.collapsed .sidebar-logout-btn span {
    display: inline !important;
}

/* Main content area next to sidebar */
.chat-interface-container {
    flex-grow: 1;
    padding: 20px 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow: hidden;
    transition: margin-left 0.3s, padding 0.3s, width 0.3s;
}

@media (max-width: 900px) {
    .sidebar-collapsible {
        width: 3.5em;
        min-width: 3.5em;
        max-width: 3.5em;
    }
    .sidebar-collapsible:not(.collapsed) {
        width: 12em;
        min-width: 8em;
        max-width: 14em;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    .sidebar-collapsible,
    .sidebar-collapsible.collapsed {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        min-height: 100vh;
        width: 80vw;
        max-width: 90vw;
        z-index: 2000;
        border-right: 1px solid var(--border-color-light);
        border-bottom: none;
        flex-direction: column;
        align-items: flex-start;
        box-shadow: 2px 0 8px rgba(0, 169, 224, 0.12);
        background: var(--background-color-widget);
        transition: width 0.3s, left 0.3s;
        font-size: 1.1em;
        overflow-y: auto;
        padding-top: 1.5em;
        padding-bottom: 1.5em;
    }
    .sidebar-collapsible.collapsed {
        left: -100vw;
        width: 0;
        min-width: 0;
        max-width: 0;
        box-shadow: none;
        border-right: none;
        padding-top: 0;
        padding-bottom: 0;
    }
    .tab-navigation-vertical {
        flex-direction: column;
        gap: 0.5em;
        padding: 0 0.5em 0.5em 0.5em;
        width: 100%;
    }
    .sidebar-toggle {
        margin: 0.75em 0 1.1em 0.75em;
        border-radius: 0.5em;
    }
    .sidebar-collapsible .tab-btn,
    .sidebar-collapsible.collapsed .tab-btn {
        width: 100%;
        min-width: 100%;
        font-size: 1em;
        padding: 1em 1.25em;
        margin-bottom: 0.5em;
        justify-content: flex-start;
        text-align: left;
        border-radius: 0.5em;
        transition: background 0.2s, color 0.2s, font-size 0.3s, padding 0.3s, min-width 0.3s;
        min-height: 44px;
    }
    .sidebar-collapsible.collapsed .tab-btn span {
        display: inline;
    }
    .sidebar-collapsible .sidebar-logout-btn {
        min-height: 44px;
        padding-left: 0.75em;
    }
    .chat-interface-container {
        padding: 0;
        margin-left: 0 !important;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
        box-shadow: none;
    }
    .chat-box {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
}

/* Chat Interface Container (Main area next to sidebar for ai-chat.html) */
.chat-interface-container {
    flex-grow: 1;
    padding: 20px 15px 0; /* Add padding to the top and sides */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow: hidden; /* Hide overflow to contain the scrolling messages */
}

/* Tab Navigation (for ai-chat.html) */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid #fff;
    position: relative;
    z-index: 1;
}

.tab-btn {
    background: #e1f5fe; /* Lighter, less saturated blue for inactive tabs */
    border: 1px solid transparent;
    color: var(--text-color-dark);
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: none;
}
.tab-btn:hover {
    background: var(--secondary-color); /* Use secondary color for hover */
    color: var(--text-color-dark);
}
.tab-btn.active {
    background: var(--background-color-widget);
    color: var(--primary-color);
    border-color: var(--border-color-light);
    font-weight: 600;
    box-shadow: none;
    z-index: 2;
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--background-color-widget); /* Cover the bottom border */
}

/* Tab Content (for ai-chat.html) */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
    padding-top: 10px;
}
.tab-content.active-tab {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tab Overview Styles */
.tab-overview {
    background-color: var(--background-color-widget);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    border: 1px solid #fff;
    box-shadow: var(--box-shadow-light);
}

.tab-overview h2 {
    color: var(--primary-color);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.tab-overview p {
    color: var(--text-color-dark);
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 15px;
}

.tab-overview ul {
    list-style: none; /* Changed from disc to none for custom styling */
    padding-left: 0; /* Remove default padding */
    margin-bottom: 15px;
}

.tab-overview ul li {
    color: var(--text-color-dark);
    font-size: 0.95em;
    margin-bottom: 10px;
    padding-left: 25px; /* Space for custom bullet */
    position: relative;
}

.tab-overview ul li::before {
    content: '➔'; /* Custom bullet */
    color: var(--accent-color); /* Use accent color for bullet */
    font-size: 1.2em;
    position: absolute;
    left: 0;
    top: -1px; /* Adjust vertical alignment */
    font-weight: bold;
}

.tab-overview ul li strong {
    font-weight: 600;
    color: var(--primary-color);
}


/* Condition Selector (Inside tabs - for ai-chat.html) */
.condition-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#feedback-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

#transcriptDropdown {
    width: 300px;
}
.dropdown {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    width: auto;
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid #fff;
    border-radius: 6px;
    background-color: var(--background-color-widget);
    color: var(--text-color-dark);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300A9E0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}
.dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 169, 224, 0.2);
}

.dropdown.condition-blurred-disabled {
    filter: blur(7px);
    color: transparent !important;
    text-shadow: 0 0 0 rgba(0,0,0,0);
    box-shadow: 0 0 15px 4px var(--accent-color);
    opacity: 0.75;
    pointer-events: none;
    user-select: none;
    background-image: none !important;
}
.condition-selector label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-color-dark);
}
.condition-selector input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

/* Shared Controls (Voice buttons, Visualizer, Chat Box for ai-chat.html) */
.shared-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    flex-grow: 1;
    position: relative;
    z-index: 100; /* Ensure it's on top */
}

.chat-mode-selection {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 20;
}

.mode-select-btn {
    background: transparent;
    border: none;
    color: var(--text-color-dark);
    font-size: 1.5rem;
    font-weight: 500;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.mode-select-btn:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.mode-select-btn .btn-icon {
    display: none; /* Hide the icon */
}

.chat-controls-main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    transition: filter 0.3s ease-in-out;
}

.chat-controls-main.blurred {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    margin-bottom: 15px;
}

/* Patient Mood Indicator Styles */
.mood-display {
    display: inline-flex;
    align-items: center;
    background-color: var(--background-color-widget);
    border: 1px solid #fff;
    border-radius: 28px;
    box-shadow: var(--box-shadow-light);
    padding: 8px 20px;
    font-size: 16px;
    color: var(--text-color-dark);
    font-family: 'Poppins', sans-serif;
    margin-right: 10px;
}
.mood-label {
    font-weight: 600;
    margin-right: 0.4em;
}
.mood-value {
    font-weight: 400;
    color: inherit;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.btn-icon-only {
    font-size: 1.2rem;
    padding: 8px 12px;
    min-width: auto;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}
/* General .btn styles for app pages (ai-chat, login) */
.btn {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    font-family: 'Poppins', sans-serif;
    font-size: 14px; /* Slightly smaller font */
    font-weight: 500;
    border: none;
    padding: 10px 16px; /* Adjust padding */
    border-radius: 8px; /* Consistent rounded corners */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: none; /* Remove shadow for a flatter look */
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}
.btn:hover {
    background: var(--accent-color); /* Changed to accent color for hover */
    box-shadow: var(--box-shadow-strong);
    transform: translateY(-2px) scale(1.02);
}
.btn:active {
    transform: translateY(0px) scale(1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Graphic & Circle (Visualizer for ai-chat.html) */
.graphic-container {
    display: none; /* Hide the old visualizer */
}
.circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--background-color-widget);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 169, 224, 0.3), var(--glow-effect);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: box-shadow 0.4s ease-in-out, transform 0.3s ease-in-out, border-color 0.3s ease;
}
.circle:hover {
    transform: scale(1.05);
    box-shadow: var(--box-shadow-strong);
}
.equalizer {
    display: flex;
    gap: 5px;
    position: absolute;
    z-index: 1;
    align-items: flex-end;
    height: 40px;
}
.bar {
    width: 6px; /* Thinner bars */
    height: 8px;
    background: var(--primary-color); /* Use primary color */
    border-radius: 3px;
    animation: idle 1.5s infinite ease-in-out;
}
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.3s; }
.bar:nth-child(1) { animation-delay: 0.4s; }


@keyframes idle {
    0%, 100% { height: 10px; opacity: 0.7; }
    50% { height: 30px; opacity: 1; }
}
.loader {
    position: absolute;
    width: 110px;
    height: 110px;
    border: 5px solid transparent;
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    z-index: 10;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.circle.listening {
    border-color: #39FF14;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.7), 0 0 15px rgba(57, 255, 20, 0.5);
}
.circle.speaking {
    border-color: #FF4500;
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.7), 0 0 15px rgba(255, 69, 0, 0.5);
}
.circle.thinking {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 224, 200, 0.7), var(--glow-effect);
}
.circle.listening .bar {
    background: #39FF14;
    animation: equalizer 0.4s infinite alternate ease-in-out;
}
.circle.speaking .bar {
    background: #FF4500;
    animation: equalizer 0.25s infinite alternate ease-in-out;
}
.circle.thinking .loader { display: block !important; }
.circle.thinking .equalizer { display: none !important; }

@keyframes equalizer {
    0% { height: 8px; opacity: 0.5; }
    100% { height: 35px; opacity: 1; }
}

/* Pulsating Animation Keyframes */
@keyframes pulse-listening {
    0% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.4); }
    50% { box-shadow: 0 0 20px rgba(57, 255, 20, 0.9); }
    100% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.4); }
}
@keyframes pulse-speaking {
    0% { box-shadow: 0 0 5px rgba(255, 69, 0, 0.4); }
    50% { box-shadow: 0 0 20px rgba(255, 69, 0, 0.9); }
    100% { box-shadow: 0 0 5px rgba(255, 69, 0, 0.4); }
}
@keyframes pulse-thinking {
    0% { box-shadow: 0 0 5px rgba(0, 224, 200, 0.4); }
    50% { box-shadow: 0 0 20px rgba(0, 224, 200, 0.9); }
    100% { box-shadow: 0 0 5px rgba(0, 224, 200, 0.4); }
}

/* Chat Box (for ai-chat.html) */
.chat-box {
    width: 100%;
    max-width: 900px; /* Ensure it doesn't get too wide */
    background: transparent;
    display: flex;
    flex-direction: column;
    border: none;
    flex-grow: 1;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: none;
    height: 70vh; /* ADDED: Set a fixed height for the chat area */
}
.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background: transparent;
    color: var(--text-color-dark);
    word-wrap: break-word;
    display: flex;
    flex-direction: column-reverse; /* This is the correct approach for top-down messages */
}
.chat-messages .user-message,
.chat-messages .bot-message {
    padding: 12px 18px;
    border-radius: 18px; /* More rounded bubbles */
    margin-bottom: 12px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 1rem; /* Larger font size */
    box-shadow: none; /* Remove shadow */
    border: none; /* Remove border */
}
.chat-messages .user-message {
    background-color: var(--primary-color);
    color: var(--button-primary-text);
    margin-left: auto;
    border-bottom-right-radius: 3px;
}
.chat-messages .bot-message {
    background-color: var(--background-color-widget);
    color: var(--text-color-dark);
    margin-right: auto;
    border: 1px solid #fff;
    border-bottom-left-radius: 4px; /* Asymmetrical rounding */
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background-color: var(--background-color-widget);
    border: 1px solid #fff;
    border-radius: 28px;
    margin: 10px auto;
    width: 100%;
    max-width: 720px;
    box-shadow: var(--box-shadow-light);
    position: relative;
    transition: border-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

/* New Visualizer Styles for Chat Input */
.chat-input.listening {
    border-color: #39FF14;
    animation: pulse-listening 1.5s infinite;
}
.chat-input.speaking {
    border-color: #FF4500;
    animation: pulse-speaking 1.5s infinite;
}
.chat-input.thinking {
    border-color: var(--accent-color);
    animation: pulse-thinking 1.5s infinite;
}

#chatInput {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: var(--text-color-dark);
    padding: 10px 0;
    min-width: 0;
    line-height: 1.5;
}
#chatInput:focus {
    box-shadow: none;
}
#sendTextMessageButton {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    transition: transform 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}
#sendTextMessageButton:hover {
    transform: scale(1.1);
}
#sendTextMessageButton svg {
    width: 100%;
    height: 100%;
    min-width: 20px;
    min-height: 20px;
    fill: var(--primary-color);
    display: block;
}

#voiceModeButton {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    transition: transform 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#voiceModeButton:hover {
    transform: scale(1.1);
}

#voiceModeButton svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
    transition: stroke 0.3s ease;
}

#voiceModeButton.active {
    border-color: var(--primary-color);
}

#voiceModeButton.active svg {
    stroke: #39FF14; /* Green color for active mic */
}

/* Footer (for ai-chat.html, login.html) */
.app-footer {
    background-color: var(--background-color-widget);
    color: var(--text-color-dark);
    text-align: center;
    padding: 15px 40px;
    font-size: 13px;
    border-top: 1px solid #fff;
    margin-top: auto;
    flex-shrink: 0;
    height: 50px;
}

/* Hide original elements that are replaced by new UI (for ai-chat.html) */
#sphereVisualizerCanvas, #toggleButton, #status,
#mode,
.controls-area .dropdown-controls,
.controls-area .voice-controls
 {
    display: none !important;
}

/* Loading Overlay Styles (for ai-chat.html) */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    padding: 30px;
    background-color: transparent;
    border-radius: 12px;
}

.loading-animation {
    border: 7px solid rgba(243, 243, 243, 0.3);
    border-top: 7px solid var(--text-color-light);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px auto;
}

.loading-text-style {
    color: var(--text-color-light);
    font-size: 1.3em;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}


/* --- Mobile Responsiveness for App Pages (ai-chat, login) --- */
@media (max-width: 768px) {
    .app-header.sticky {
        padding: 10px 15px;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .app-header #logo-img {
        height: 40px;
        margin-bottom: 0;
        margin-left: auto;
        margin-right: 0;
        display: block;
    }

    .app-header .top-nav {
        flex-wrap: wrap;
        gap: 10px;
        /* font-size: 14px; Applied to individual links if needed */
    }
    .app-header .top-nav a { /* General links in app header on mobile */
        padding: 5px 0;
        font-size: 14px;
    }
    .app-header .top-nav a.nav-cta { /* Specific styling for .nav-cta button in app header on mobile */
        padding: 6px 12px; /* Maintain button-like padding */
        font-size: 14px; /* Consistent font size with other mobile nav items */
    }

    .chat-interface-container {
        padding: 15px;
    }

    .tab-navigation {
        gap: 2px;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .condition-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .dropdown, .condition-selector .btn { /* .btn here refers to app's .btn */
        width: 100%;
        min-width: unset;
    }
    .condition-selector label {
        justify-content: flex-start;
        margin-left: 0;
    }


    .top-bar { /* For ai-chat.html */
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-bar .btn { /* For ai-chat.html */
        flex-grow: 1;
        font-size: 14px;
        padding: 8px 15px;
    }

    .graphic-container { /* For ai-chat.html */
        height: 150px;
    }
    .circle { /* For ai-chat.html */
        width: 100px;
        height: 100px;
    }
    .loader { /* For ai-chat.html */
        width: 80px;
        height: 80px;
    }

    .chat-box { /* For ai-chat.html */
        height: auto;
        min-height: 300px;
        max-height: 60vh;
    }

    .chat-messages .user-message, /* For ai-chat.html */
    .chat-messages .bot-message {
        max-width: 90%;
        font-size: 0.9rem;
    }

    #chatInput { /* For ai-chat.html */
        font-size: 14px;
    }
    #sendTextMessageButton { /* For ai-chat.html */
        padding: 10px 15px;
        font-size: 14px;
    }

    .app-footer { /* For ai-chat.html, login.html */
        padding: 10px 15px;
        font-size: 12px;
        height: auto;
    }
}

@media (max-width: 480px) {
    .app-header .top-nav { /* For ai-chat.html, login.html */
        justify-content: center;
    }
    .tab-btn { /* For ai-chat.html */
        flex-basis: calc(50% - 4px);
        text-align: center;
    }
    .chat-messages { /* For ai-chat.html */
        padding: 10px;
    }
    .chat-input { /* For ai-chat.html */
        padding: 8px 8px;
        gap: 8px;
    }
    #chatInput { /* For ai-chat.html */
        font-size: 13px;
        padding: 8px 0;
    }
    #sendTextMessageButton,
    #voiceModeButton {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
}

/* STYLES FROM FORMER style2.css (FOR home.html) APPENDED BELOW */

/* Apply Open Sans font specifically to home.html body if needed, or sections within it */
/* For example, if home.html has <body class="home-page-style"> */
body.home-page-style, .home-page-style {
    font-family: 'Poppins', sans-serif; /* Use the app's main font for home page */
    color: var(--text-color); /* Use text color from style2 for home page */
    background-color: var(--bg-color); /* Use bg color from style2 for home page */
    perspective: 1000px; /* Moved from global body for animations */
}

/* Container for home.html sections */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header for home.html */
.main-header {
    background-color: var(--bg-color);
    padding: 12px 0; /* Reduced padding */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure it's below app-header if they ever overlap */
    animation: slideDown 0.5s ease-out;
}

.main-header .container { /* This redefines .container specifically for .main-header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Override general .container width if needed for full-width header content */
    max-width: none; /* Override general .container max-width */
    /* padding will be inherited from .main-header or specific to its children */
}

/* Styling for the image logo link in home.html's main-header */
.main-header .logo-link img#logo-img { /* More specific selector */
    height: 40px; /* Standardized logo height */
    vertical-align: middle; /* Ensure proper alignment */
}
/* .logo:hover { */ /* This hover was for text logo */
    /* transform: translateZ(10px) scale(1.05); */
/* } */


.main-header nav a {
    text-decoration: none;
    color: var(--text-color); /* Uses home page's text color */
    margin-left: 25px;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 8px;
}

.main-header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--primary-color); /* App's primary color */
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width var(--transition-speed) ease, background-color var(--transition-speed) ease;
    opacity: 0;
}

.main-header nav a:hover::after,
.main-header nav a.active::after {
    width: 100%;
    opacity: 1;
}
.main-header nav a:hover {
    color: var(--primary-color); /* App's primary color */
}

/* General .nav-cta styles for Login/Logout button in headers */
.nav-cta { 
    background-color: var(--primary-color); 
    color: var(--button-primary-text) !important; /* Use consistent button text color */
    padding: 6px 20px; /* Adjusted padding: less vertical, more horizontal */
    border-radius: 6px; /* Consistent with other .btn */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 500; /* Ensure consistent font weight */
    font-size: 16px;  /* Match other .app-header nav links font size */
    line-height: normal; /* Ensure line-height doesn't add extra vertical space */
}
.nav-cta::after { /* Ensure this doesn't apply if it's from .main-header nav a */
    display: none !important; 
}

.nav-cta:hover {
    background-color: var(--accent-color); /* Consistent hover with .btn */
    transform: translateY(-2px); /* Simpler hover transform */
    box-shadow: var(--box-shadow-strong); /* Consistent shadow with .btn */
}




/* Hero Section for home.html */
.hero-section {
    background-color: transparent;
    padding: 100px 0;
    text-align: center;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-background-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18vw;
    font-weight: 700;
    color: rgba(0, 169, 224, 0.05);
    white-space: nowrap;
    user-select: none;
    z-index: 0;
}


.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2); /* Enhanced text shadow for better readability */
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)); /* App's colors */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* Fallback for browsers not supporting background-clip */
}

.hero-content p {
    font-size: 1.25em;
    margin-bottom: 35px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    color: #4a4a4a; /* Specific color from style2 */
}

/* Buttons for home.html - these might need a specific class like .btn-home */
/* to distinguish from the app's .btn if styling is very different */
/* For now, assuming home.html links are styled with .btn.btn-primary or .btn.btn-secondary */
/* and those classes will be defined below for home.html context */

.hero-section .btn-primary { /* Specific to hero section on home page */
    background-color: var(--primary-color); /* App's primary */
    color: var(--light-text-color); /* Home's light text */
    box-shadow: 0 4px 12px rgba(0, 178, 255, 0.3);
    padding: 16px 35px;
    border-radius: var(--border-radius);
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    transform-style: preserve-3d;
    text-decoration: none;
}

.hero-section .btn-primary:hover {
    background-color: var(--accent-color); /* App's accent */
    transform: translateY(-4px) translateZ(10px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 178, 255, 0.5);
}

.hero-content small {
    display: block;
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
}

/* Intro Section for home.html */
.intro-section {
    padding: 80px 0;
    text-align: center;
}
.intro-section h2 {
    font-size: 2.4em;
    margin-bottom: 25px;
    color: var(--primary-color); /* App's primary */
}
.intro-section p {
    max-width: 800px;
    margin: 0 auto 20px auto;
    font-size: 1.15em;
    color: var(--text-color); /* Home page text color */
}


/* Features Section for home.html */
.features-section {
    padding: 100px 0;
    background-color: transparent;
    position: relative;
}

.section-title { /* For home.html sections */
    text-align: center;
    font-size: 2.8em;
    margin-bottom: 70px;
    color: var(--text-color); /* Home page text color */
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    perspective: 1200px;
}

.feature-card {
    text-align: center;
    padding: 20px;
}

.feature-icon-placeholder {
    font-size: 3.5em;
    color: var(--primary-color); /* App's primary */
    margin-bottom: 25px;
    line-height: 1;
}

.feature-card h3 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: var(--primary-color); /* App's primary */
}
.feature-card p {
    color: var(--text-color); /* Home page text color */
}


/* Why Us Section for home.html */
.why-us-section {
    padding: 100px 0;
    background-color: transparent;
}
.why-us-section .container { /* Uses general .container */
    display: flex;
    align-items: center;
    gap: 50px;
}
.why-us-image {
    max-width: 45%;
    border-radius: var(--border-radius); /* Home page border radius */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.why-us-content {
    flex: 1;
    color: var(--text-color); /* Home page text color */
}
.why-us-content ul {
    list-style: none;
    padding-left: 0;
}
.why-us-content ul li {
    margin-bottom: 18px;
    font-size: 1.1em;
    padding-left: 30px;
    position: relative;
}
.why-us-content ul li::before {
    content: '✔';
    color: var(--primary-color); /* App's primary */
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2em;
    top: 2px;
}


/* Interface Showcase Section for home.html */
.interface-section {
    padding: 100px 0;
    text-align: center;
}
.interface-section p {
    max-width: 700px;
    margin: 0 auto 40px auto;
    font-size: 1.15em;
    color: var(--text-color); /* Home page text color */
}
.interface-image {
    max-width: 75%;
    border-radius: var(--border-radius); /* Home page border radius */
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    margin-top: 20px;
    border: 6px solid white;
    transition: transform var(--transition-speed) ease-out, box-shadow var(--transition-speed) ease-out;
}
.interface-image:hover {
    transform: scale(1.03) translateZ(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.interface-video { /* Styles for the new video element */
    display: block; /* To allow margin auto to work */
    margin: 20px auto 0 auto; /* Centering the video if its max-width is less than container */
    max-width: 75%;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border: 6px solid white;
    transition: transform var(--transition-speed) ease-out, box-shadow var(--transition-speed) ease-out;
    outline: none; /* Remove default browser outline on focus for video */
}



/* Testimonials Section for home.html */
.testimonials-section {
    padding: 100px 0;
    background-color: transparent;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    perspective: 1000px;
}

.testimonial-card {
    padding: 20px;
    text-align: center;
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 20px;
    color: #444; /* Specific color from style2 */
    font-size: 1.05em;
}

.testimonial-card span {
    font-weight: 700;
    color: var(--primary-color); /* App's primary */
    font-size: 1em;
}

/* CTA Section for home.html */
.cta-section {
    background: transparent;
    color: var(--text-color-dark);
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.cta-section h2 {
    font-size: 2.8em;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.cta-section p {
    font-size: 1.25em;
    margin-bottom: 40px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
}

.cta-section .btn-secondary { /* Specific to CTA section on home page */
    background-color: var(--primary-color);
    color: var(--button-primary-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 18px 40px;
    border-radius: var(--border-radius);
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    transform-style: preserve-3d;
    text-decoration: none;
}

.cta-section .btn-secondary:hover {
    background-color: var(--accent-color);
    color: var(--button-primary-text);
    transform: translateY(-4px) translateZ(10px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Footer for home.html */
.main-footer-bottom {
    background-color: transparent;
    color: var(--text-color-dark);
    padding: 50px 0;
    text-align: center;
}

.main-footer-bottom .container { /* Uses general .container */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.main-footer-bottom p {
    margin-bottom: 15px;
}
.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: var(--text-color-dark);
    text-decoration: none;
    margin: 0 12px;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color); /* App's primary */
    transform: translateY(-2px);
}


/* ANIMATIONS (from former style2.css, now part of the main sheet) */
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.animate-on-load.fade-in-up {
    opacity: 0;
    transform: translateY(40px) translateZ(-20px);
    animation: fadeInUp3D var(--animation-duration) ease-out forwards;
}
.animate-on-load.fade-in {
    opacity: 0;
    transform: translateZ(-30px) scale(0.95);
    animation: fadeIn3D var(--animation-duration) ease-out forwards;
}

.delay-1 { animation-delay: 0.25s !important; }
.delay-2 { animation-delay: 0.5s !important; }
.delay-3 { animation-delay: 0.75s !important; }


.animate-on-scroll {
    opacity: 0;
    /* transition: opacity var(--animation-duration) ease-out, transform var(--animation-duration) cubic-bezier(0.175, 0.885, 0.32, 1.275); */ /* Removed transition, animation will handle it */
}

.animate-on-scroll.fade-in {
    transform: scale(0.9) translateZ(-50px);
}
.animate-on-scroll.fade-in.in-view {
    animation: fadeIn3D var(--animation-duration) ease-out forwards;
}

.animate-on-scroll.fade-in-up {
    transform: translateY(50px) translateZ(-40px) rotateX(-10deg);
}
.animate-on-scroll.fade-in-up.in-view {
    animation: fadeInUp3D var(--animation-duration) ease-out forwards;
}

.animate-on-scroll.slide-in-left {
    transform: translateX(-80px) translateZ(-60px) rotateY(20deg);
}
.animate-on-scroll.slide-in-left.in-view {
    animation: slideInLeft3D var(--animation-duration) ease-out forwards;
}

.animate-on-scroll.slide-in-right {
    transform: translateX(80px) translateZ(-60px) rotateY(-20deg);
}
.animate-on-scroll.slide-in-right.in-view {
    animation: slideInRight3D var(--animation-duration) ease-out forwards;
}

.animate-on-scroll.slide-in-up {
    transform: translateY(80px) translateZ(-50px) rotateX(-15deg);
}
.animate-on-scroll.slide-in-up.in-view {
    animation: slideInUp3D var(--animation-duration) ease-out forwards;
}

.animate-on-scroll.zoom-in {
    transform: scale(0.8) translateZ(-80px);
}
.animate-on-scroll.zoom-in.in-view {
    animation: zoomIn3D var(--animation-duration) ease-out forwards;
}

/* Keyframes for 3D animations are already defined in the app's section, no need to repeat */
@keyframes fadeIn3D { /* Ensure this is defined once */
    to { opacity: 1; transform: scale(1) translateZ(0); }
}
@keyframes fadeInUp3D { /* Ensure this is defined once */
    to { opacity: 1; transform: translateY(0) translateZ(0) rotateX(0); }
}
@keyframes slideInLeft3D { /* Ensure this is defined once */
    to { opacity: 1; transform: translateX(0) translateZ(0) rotateY(0); }
}
@keyframes slideInRight3D { /* Ensure this is defined once */
    to { opacity: 1; transform: translateX(0) translateZ(0) rotateY(0); }
}
@keyframes slideInUp3D { /* Ensure this is defined once */
    to { opacity: 1; transform: translateY(0) translateZ(0) rotateX(0); }
}
@keyframes zoomIn3D { /* Ensure this is defined once */
    to { opacity: 1; transform: scale(1) translateZ(0); }
}


/* Responsive Design for home.html elements */
/* These will be appended after the app's responsive rules. */
/* Order and specificity will determine final styling. */

@media (max-width: 992px) { /* For home.html elements */
    .hero-content h1 { font-size: 2.6em; }
    .hero-content p { font-size: 1.15em; }
    .section-title { font-size: 2.4em; } /* From home page styles */
    .why-us-section .container { flex-direction: column; text-align: center; }
    .why-us-image { max-width: 70%; margin-bottom: 30px; }
    .why-us-content ul li { text-align: left; }
}

@media (max-width: 768px) { /* For home.html elements */
    .main-header .container { /* home.html header */
        flex-direction: column;
        gap: 15px;
    }
    .main-header nav { /* home.html nav */
        margin-top: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-header nav a { /* home.html nav links */
        margin: 5px 10px;
        padding-bottom: 8px;
    }
    .hero-content h1 { font-size: 2.2em; } /* home.html hero */
    .hero-content p { font-size: 1em; } /* home.html hero */
    .features-grid { grid-template-columns: 1fr; gap: 30px; } /* home.html features */
    .testimonials-grid { grid-template-columns: 1fr; gap: 30px; } /* home.html testimonials */
    .interface-image { max-width: 90%; } /* home.html interface image */
    .section-title { font-size: 2em; margin-bottom: 50px;} /* home.html section title */
}

@media (max-width: 480px) { /* For home.html elements */
    .logo { font-size: 1.6em; } /* home.html logo */
    .hero-content h1 { font-size: 1.9em; } /* home.html hero */
    .hero-content p { font-size: 0.9em; } /* home.html hero */
    .section-title { font-size: 1.9em; margin-bottom: 40px; } /* home.html section title */
    .feature-card { padding: 25px; } /* home.html feature card */
    .feature-card h3 { font-size: 1.4em; } /* home.html feature card */
    .testimonial-card { padding: 25px; } /* home.html testimonial card */
    .cta-section h2 { font-size: 2.2em; } /* home.html CTA */
    .cta-section p { font-size: 1.1em;} /* home.html CTA */
    .footer-links a { /* home.html footer links */
        display: block;
        margin: 8px 0;
    }
}

/* --- Typewriter Effect Styles (from former style2.css) --- */
.type-in { /* This class is used in home.html */
    min-height: 1em;
    /* visibility: hidden; Initially hide if flashing is an issue, then JS makes visible */
}

.type-in.typing-active::after {
    content: '|';
    display: inline;
    animation: blink-caret 0.65s step-end infinite;
    margin-left: 0.05em;
    color: var(--primary-color); /* App's primary color for cursor */
    font-weight: bold;
    position: relative;
    top: -0.05em;
}

@keyframes blink-caret { /* Ensure this is defined once */
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Home Page Pricing Section Styles --- */
.pricing-section-home {
    padding: 80px 0;
    background-color: transparent; /* Consistent with other home page sections */
}

.pricing-section-home .section-title { /* Uses existing .section-title styling */
    margin-bottom: 60px;
}

.pricing-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; /* Slightly reduced gap from reference */
    justify-content: center;
}

.pricing-option-card {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pricing-option-card h3 {
    font-size: 1.8em; /* Adjusted size */
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.pricing-option-card p {
    font-size: 1em; /* Adjusted size */
    margin-bottom: 15px;
    color: var(--text-color); /* Home page text color */
    min-height: 40px; /* Give some consistent height for descriptions */
}

.pricing-option-card .price-tag {
    font-size: 2.2em; /* Adjusted size */
    font-weight: 700;
    color: var(--text-color-dark); /* Darker for price */
    margin-bottom: 20px;
}

.pricing-option-card .btn-primary { /* Style for buttons within pricing cards */
    background-color: var(--primary-color);
    color: var(--button-primary-text);
    padding: 12px 25px; /* Adjusted padding */
    border-radius: 6px; /* Consistent with app buttons */
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.pricing-option-card .btn-primary:hover {
    background-color: var(--accent-color); /* Darker shade on hover */
    transform: translateY(-2px);
}

.pricing-option-card small {
    font-size: 0.85em;
    color: #666;
}
.pricing-option-card small a {
    color: var(--primary-color);
    text-decoration: underline;
}
.pricing-option-card small a:hover {
    color: var(--border-color-dark);
}


/* --- Home Page FAQ Section Styles --- */
.faq-section-home {
    padding: 80px 0;
    background-color: var(--bg-color); /* White background */
}

.faq-section-home .section-title {
    margin-bottom: 60px;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for FAQs initially */
    gap: 20px;
    max-width: 800px; /* Constrain width of FAQ section */
    margin: 0 auto;
}

.faq-item-card {
    background-color: var(--light-gray-bg); /* Light background for each FAQ item */
    padding: 20px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
    border-left: 4px solid #fff; /* White border */
    transition: box-shadow 0.3s ease;
}
.faq-item-card:hover {
    box-shadow: var(--box-shadow-strong);
}

.faq-item-card h3 {
    font-size: 1.3em; /* Adjusted size */
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.faq-item-card p {
    font-size: 1em; /* Adjusted size */
    color: var(--text-color);
    line-height: 1.7;
}


/* --- Profile Page Specific Styles --- */
.chat-interface-container h1 { /* Assuming profile page uses chat-interface-container */
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

#profileDetails {
    background-color: var(--background-color-widget);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
    margin-bottom: 2rem;
}

#profileDetails p {
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: var(--text-color-dark);
}

#profileDetails p strong {
    color: var(--primary-color);
    margin-right: 0.5rem;
    min-width: 120px; /* Align values somewhat */
    display: inline-block;
}

.chat-interface-container h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #fff;
    text-align: left;
}

#editProfileForm, #changePasswordForm {
    background-color: var(--background-color-widget);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
    margin-bottom: 2rem;
}

#editProfileForm div, #changePasswordForm div {
    margin-bottom: 1.2rem;
}

#editProfileForm label, #changePasswordForm label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color-dark);
    font-size: 0.95rem;
}

#editProfileForm input[type="text"],
#editProfileForm input[type="email"],
#editProfileForm input[type="tel"],
#changePasswordForm input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #fff;
    border-radius: 6px; /* Consistent with app's .btn */
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color-dark);
    background-color: var(--background-color-main); /* Light background for inputs */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#editProfileForm input[type="text"]:focus,
#editProfileForm input[type="email"]:focus,
#editProfileForm input[type="tel"]:focus,
#changePasswordForm input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 169, 224, 0.25); /* Glow effect on focus */
}

#editProfileForm button[type="submit"],
#changePasswordForm button[type="submit"] {
    /* Use existing .btn styles by adding class="btn" to the HTML, or replicate here */
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem; /* Match input font size */
    font-weight: 500;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: var(--box-shadow-light);
    display: inline-block;
    text-align: center;
    width: auto; /* Don't make buttons full width by default */
}

#editProfileForm button[type="submit"]:hover,
#changePasswordForm button[type="submit"]:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-strong);
}

#editProfileMessage, #changePasswordMessage {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

#editProfileMessage.success, #changePasswordMessage.success { /* Add .success class via JS */
    background-color: #e6ffed;
    color: #006421;
    border: 1px solid #fff;
}

#editProfileMessage.error, #changePasswordMessage.error { /* Add .error class via JS */
    background-color: #ffe6e6;
    color: #cc0000;
    border: 1px solid #fff;
}

.chat-interface-container hr {
    border: none;
    height: 1px;
    background-color: var(--border-color-light);
    margin: 2.5rem 0;
}

/* Typewriter effect for bot messages */
.chat-messages .bot-message.typing-effect::after {
    content: '▋';
    animation: blink-caret 1s step-end infinite;
    margin-left: 0.2em;
    color: var(--primary-color);
}

/* Vignette Container Styles */
.vignette-container {
    background-color: var(--background-color-widget);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    border: 1px solid #fff;
    box-shadow: var(--box-shadow-light);
    width: 100%;
    max-width: 800px; /* Constrain width */
    margin-left: auto; /* Center align */
    margin-right: auto; /* Center align */
    text-align: center; /* Center text inside */
}

#vignetteTitle {
    color: var(--primary-color);
    font-size: 1.6em;
    margin-bottom: 15px;
    font-weight: 600;
}

#vignetteText {
    color: var(--text-color-dark);
    font-size: 1.1em;
    line-height: 1.7;
    margin-bottom: 20px;
    text-align: left; /* Justify text for readability */
}

.vignette-container .dropdown,
.vignette-container .btn {
    margin-top: 10px;
    margin-right: 10px;
}

/* Right-align logo in header for ai-chat.html */
.app-header #logoLink {
    margin-left: auto;
    margin-right: 0;
    display: flex;
    align-items: center;
}

/* Make sidebar buttons smaller on mobile */
@media (max-width: 600px) {
    .sidebar-collapsible .tab-btn,
    .sidebar-collapsible.collapsed .tab-btn {
        font-size: 12px !important;
        padding: 6px 10px !important;
        min-width: 60px !important;
        min-height: 32px !important;
        margin-bottom: 0.3em !important;
    }
    .sidebar-collapsible .sidebar-logout-btn {
        font-size: 12px !important;
        padding-left: 0.5em !important;
        min-height: 32px !important;
    }
    .sidebar-toggle {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        min-width: 24px !important;
    }
}
