* {
    transition: background 0.25s ease,
                color 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.25s ease;
}

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --input-bg: #f7f7f8;
    --border-color: #e5e5e5;
    --chat-user-bg: #f4f4f4;
    --chat-bot-bg: transparent;
    --header-bg: #ffffff;
}


/* ===== Alarm Formatting ===== */

.alarm-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.alarm-heading {
    font-size: 16px;
    font-weight: 700;   /* Bold headings */
    margin-top: 8px;    /* small space above */
    margin-bottom: 2px; /* very small space below (fix for Cause section) */
}

.chat.bot {
    line-height: 1.4;
}

.chat.bot li {
    margin-left: 20px;
    margin-top: 4px;
}

/* Dark Mode */
body.dark-mode {
    --bg-color: #111315;
    --text-color: #e6e6e6;
    --input-bg: #1c1f23;
    --border-color: #2c2f33;
    --chat-user-bg: #25292e;
    --chat-bot-bg: transparent;
    --header-bg: #14161a;
}
body.dark-mode .app-header {
    border-bottom: 1px solid #2a2d31;
}


* {
    transition: background 0.25s ease,
                color 0.25s ease,
                border-color 0.25s ease;
}



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

/* ---------------- Layout ---------------- */
.chatbot-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    /* 👈 ADD THIS */
}

/* ================= Sidebar ================= */

.chatbot-sidebar {
    width: 200px;
    background-color: #F0F0F0;
    padding: 10px;
    transition: width 0.3s ease;
}

.chatbot-sidebar {
    width: 240px;
    min-width: 240px;
    padding: 15px;
    overflow: hidden;

    /* Transparent look */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Shadow */
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);

    transition: width 0.45s cubic-bezier(0.4, 0.0, 0.2, 1),
        padding 0.45s cubic-bezier(0.4, 0.0, 0.2, 1);
}



/* When sidebar is hidden */
.chatbot-sidebar.is-hidden>* {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chatbot-sidebar.is-hidden {
    width: 0;
    min-width: 0;
    padding: 0;
}



.chatbot-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-sidebar-logo {
    width: 020px;
}

.closebtn {
    border: 0;
    padding: 0;
    cursor: pointer;
    background: none;
}

.icon-img {
    width: 25px;
    ;
}

.btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #333;
    background: transparent;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 43px;
}

.btn:hover {
    background-color: #00303E;
    color: #fff;
}

/* ================= Main ================= */

.chatbot-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


/* ================= Sidebar Menu Button ================= */


/* Menu Button Transparent */

.open-sidebar-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remove any default button effects */
.open-sidebar-btn:focus,
.open-sidebar-btn:active {
    outline: none;
    box-shadow: none;
}

/* Make icon slightly softer */
.open-sidebar-btn img {
    width: 22px;
    height: 22px;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

/* Subtle hover effect */
.open-sidebar-btn:hover img {
    opacity: 1;
}

/* Hide menu icon when sidebar is open */
.chatbot-sidebar:not(.is-hidden)~.chatbot-main .open-sidebar-btn {
    display: none !important;
}

/* ================= Home Page ================= */

.home-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.home-logo {
    width: 400px;
    margin-bottom: 50px;
}
.home-logo1 {
    width: 300px;
    margin-bottom: -50px;
}

.home-cards {
    display: flex;
    gap: 40px;
}

.home-card {
    width: 220px;
    height: 120px;
    border: 2px solid #00303E;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.home-card:hover {
    transform: scale(1.05);
    background: var(--hover-bg);
}


.home-icon {
    width: 28px;
}

.home-card span {
    font-size: 15px;
    color: #00303E;
    font-weight: 500;
}

/* ================= Search Screen ================= */

.search-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* vertical center */
    align-items: center;
    /* horizontal center */
    text-align: center;
    min-height: 100vh;
    /* full screen height */
}


.chatbot-brand-logo {
    width: 445px;
    margin-bottom: 40px;
}

.chatbot-search {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.chatbot-search-input,
.chatbot-search-input_2 {
    height: 38px;
    border-radius: 8px;
    border: 1px solid #000;
    padding: 0 10px;
    text-align: center;
}

.chatbot-search-input {
    width: 360px;
}

.chatbot-search-input_2 {
    width: 180px;
}

.chatbot-search-btn {
    margin-top: 12px;
    width: 40%;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: #00303E;
    color: #fff;
}

/* ================= Chat View ================= */

.chat-view {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 24px 18%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: transparent;
}

.chat {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat.user {
    align-self: flex-end;
    background-color: #F4F4F4;
    color: black;
    border-bottom-right-radius: 4px;
}

.chat.bot {
    align-self: flex-start;
    background-color: transparent;
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

/* ================= Chat Input ================= */


.chat-input-bar {
    padding: 20px 18%;
    background: var(--bg-color);
}

.chat-input-wrapper {
    position: relative;
    background: var(--input-bg);
    border-radius: 26px;
    border: 1px solid var(--border-color);
}


/* Textarea */
.chat-input-wrapper textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 15px;
    line-height: 1.6;
    padding: 14px 55px 14px 18px;
    border-radius: 26px;
    max-height: 220px;
    overflow-y: auto;

    color: var(--text-color);   /* 👈 ADD THIS */
}
.chat-input-wrapper textarea::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

body.dark-mode .chat-input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}


/* Send button inside */
.chat-send-btn {
    position: absolute;
    bottom: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #000;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #333;
}


/* ================= Recent Chats ================= */

.recent-chats {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 18%;
}

.recent-chats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.btn-close,
.btn-clear {
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
}

.btn-close {
    background-color: #007bff;
}

.btn-clear {
    background-color: #dc3545;
}

.recent-chats-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 0;
}

.recent-chat-item {
    padding: 12px 16px;
    background-color: var(--input-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-chat-item:hover {
    background-color: #d1d1d6;
}

.recent-chat-item strong {
    display: block;
    font-size: 16px;
    color: var(--text-color);
}

.recent-chat-item p {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7; /* softer timestamp */
}

/* ================= Responsive ================= */

@media (max-width: 900px) {

    .chat-messages,
    .chat-input-bar {
        padding: 20px;
    }
}

.home-btn {
    background-color: transparent;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1000;
    font-size: 14px;
}

.home-btn:hover {
    background-color: transparent
}

/* Hide home button on home page */
body.home-active .home-btn {
    display: none !important;
}

.home-btn img {
    width: 22px;
    height: 22px;
    display: block;
}

/* ================= Modern Search Bar ================= */

.modern-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 650px;
    padding: 12px 18px;
    border-radius: 50px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

/* Input */
.modern-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

/* Icon buttons */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.icon-btn img {
    width: 18px;
    height: 18px;
}

/* Send button */
.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #333;
}

/* Focus effect */
.modern-search:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* ================= GLOBAL HEADER ================= */

.app-header {
    height: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 1000;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1;
    justify-content: flex-start;
}

.header-center h3 {
    font-size: 16px;
    font-weight: 600;
    color: #00303E;
}

/* Remove fixed positioning */
.open-sidebar-btn {
    position: relative;
    top: auto;
    left: auto;
}

.home-btn {
    position: relative;
    top: auto;
    right: auto;
}

/* Adjust pages below header */
.home-wrapper,
.search-screen,
.chat-view,
.recent-chats {
    height: calc(100vh - 60px);
}

/* ================= HEADER LOGO ================= */

.header-logo {
    height: 32px;
    object-fit: contain;
}

/* ================= HIDE HEADER ON HOME ================= */

body.home-active .app-header {
    display: none;
}

/* Adjust layout when header hidden */
body.home-active .home-wrapper {
    height: 100vh;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

.app-header {
    background: var(--header-bg);
}

.chat-input-wrapper {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
}

.chat.user {
    background-color: var(--chat-user-bg);
    color: var(--text-color);
}


.theme-toggle-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-right: 15px;
    color: var(--text-color);
}

body.dark-mode .chatbot-sidebar {
    background: rgba(20, 22, 26, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.6);
}

body.dark-mode .chat-input-wrapper {
    background: #1c1f23;
    border: 1px solid #2c2f33;
}

body.dark-mode .chat-send-btn {
    background: #2e7dff;
}

body.dark-mode .chat-send-btn:hover {
    background: #1f6feb;
}

body.dark-mode .recent-chat-item {
    background: #1c1f23;
}

body.dark-mode .recent-chat-item:hover {
    background: #262a2f;
}

/* Sidebar text white in dark mode */
body.dark-mode .chatbot-sidebar,
body.dark-mode .chatbot-sidebar .btn,
body.dark-mode .chatbot-sidebar p,
body.dark-mode .chatbot-sidebar span {
    color: #ffffff;
}
body.dark-mode .chatbot-sidebar .btn {
    border: 1px solid #444;
}
body.dark-mode .chatbot-sidebar .btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Make header icons white in dark mode */
body.dark-mode .home-btn img {
    filter: brightness(0) invert(1);
}

/* Dark mode: only turn small icons white */
body.dark-mode .icon-img,
body.dark-mode .open-sidebar-btn img,
body.dark-mode .home-btn img,
body.dark-mode .home-icon {
    filter: brightness(0) invert(1);
}

body.dark-mode .home-card span {
    color: #ffffff;
}
body.dark-mode .home-card {
    border: 2px solid #444;
    background: var(--input-bg);
}

body.dark-mode .home-icon {
    filter: brightness(0) invert(1);
}

/* Hide dark logo by default */
.logo-dark {
    display: none;
}

/* When dark mode is active */
body.dark-mode .logo-light {
    display: none;
}

body.dark-mode .logo-dark {
    display: inline-block;
}



/* Input & Textarea text color */
.chat-input-wrapper textarea,
.modern-search input {
    color: var(--text-color);
}

.header-logo {
    height: 32px;
    width: auto;
}

.home-logo {
    width: 200px;
    height: auto;
}

.home-logo1 {
    width: 350px;
    height: auto;
}

.chatbot-brand-logo {
    width: 320px;
    height: auto;
}

/* NEVER apply filter to logos */
.header-logo,
.home-logo,
.chatbot-brand-logo {
    filter: none !important;
}
.home-logo1,
.chatbot-brand-logo {
    filter: none !important;
}

/* Only specific UI icons */
body.dark-mode button img,
body.dark-mode .icon-img {
    filter: brightness(0) invert(1);
}

/* LIGHT MODE SEARCH */
body:not(.dark-mode) .modern-search {
    background: transparent;
    border: 1px solid #dcdfe3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body:not(.dark-mode) .modern-search input {
    color: #333;
}

body:not(.dark-mode) .modern-search input::placeholder {
    color: #88888883;
}

/* ================= MODERN SCROLLBAR ================= */

/* Chrome, Edge, Brave */
.chat-messages::-webkit-scrollbar,
.recent-chats-list::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.recent-chats-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.recent-chats-list::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 120, 0.35);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.recent-chats-list::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.6);
}


/* Dark Mode Scrollbar */
body.dark-mode .chat-messages::-webkit-scrollbar-thumb,
body.dark-mode .recent-chats-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
}

body.dark-mode .chat-messages::-webkit-scrollbar-thumb:hover,
body.dark-mode .recent-chats-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}


/* Firefox Support */
.chat-messages,
.recent-chats-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(120,120,120,0.4) transparent;
}

body.dark-mode .chat-messages,
body.dark-mode .recent-chats-list {
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}
