@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");
body { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

/* ========================================
   FIXED SIDEBAR - Better Implementation
   ======================================== */

/* Adjust the main Chainlit container */
/*
 * Step 1: Place the watermark on the main page body,
 * behind everything else.
*/

body::before {
    content: "";
    position: fixed; /* Fixed, so it doesn't scroll */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* === YOUR LOGO SETTINGS === */
    background-image: url('/public/logo_light.png'); /* Ensure this path is correct */
    opacity: 0.08;  /* Set your faintness (0.0 to 1.0) */
    width: 450px;   /* Set your logo's size */
    height: 450px;
    /* === END SETTINGS === */
    
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
    /* Put the watermark behind all content */
    z-index: -1;
}

/*
 * Step 2: Make the main chat container's background transparent.
 * The !important tag is needed to override Chainlit's default theme.
*/

.MuiBox-root[class*="mainContainer"] {
    margin-right: 340px !important;
}



/* Add to custom-theme.css */



/* Floating Disclaimer Button */
#floating-disclaimer-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#floating-disclaimer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#floating-disclaimer-btn svg {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}




/* Disclaimer Modal */
#disclaimer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.disclaimer-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-disclaimer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-disclaimer:hover {
    color: #1f2937;
}

.disclaimer-content h2 {
    font-size: 24px;
    margin: 0 0 20px 0;
    color: #1f2937;
}

.disclaimer-body {
    color: #4b5563;
    line-height: 1.6;
}

.disclaimer-body h3 {
    font-size: 16px;
    color: #374151;
    margin: 15px 0 10px 0;
}

.disclaimer-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.disclaimer-body li {
    margin: 8px 0;
}

.disclaimer-body hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.disclaimer-body strong {
    color: #1f2937;
}

/* Hide default chainlit sidebar */
.MuiDrawer-root,
#sidebar,
[class*="sidebar"] {
    display: none !important;
}


/*On Start Message Customization*/


/* .emps-sidebar-present .MuiBox-root[class*="mainContainer"]{ margin-right: 330px !important; } */

/* Center & style the Summary section rendered in chat */
.MuiBox-root .markdown h2 {
  text-align: center;
  font-size: 1.4rem;
  margin-top: 4px;
  margin-bottom: 8px;
}

.MuiBox-root .markdown h2 + table {
  margin-left: auto !important;
  margin-right: auto !important;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 6px 18px rgba(17,24,39,.06);
  overflow: hidden;
  max-width: 520px; /* keeps it compact like ChatGPT cards */
}

.MuiBox-root .markdown h2 + table th,
.MuiBox-root .markdown h2 + table td {
  padding: 10px 14px;
  vertical-align: middle;
}

.MuiBox-root .markdown h2 + table th:first-child,
.MuiBox-root .markdown h2 + table td:first-child {
  width: 140px;
  text-align: left;
}

.MuiBox-root .markdown h2 + table th:last-child,
.MuiBox-root .markdown h2 + table td:last-child {
  text-align: left;
}

.MuiBox-root .markdown { max-width: 820px; }


/* Hide on mobile */
@media (max-width: 1200px) {
    body::after,
    .info-sidebar-fixed {
        display: none !important;
    }
    
    .MuiBox-root[class*="mainContainer"] {
        margin-right: 0 !important;
    }
}

.watermark, a[href*='https://github.com/Chainlit/chainlit'] {
    visibility: hidden !important;
}

/* Alternative method: Target the Chainlit link specifically */
a[href*='https://github.com/Chainlit/chainlit'] {
    font-size: 0 !important;
}

a[href*='https://github.com/Chainlit/chainlit']::after {
    content: '© 2025 - Energyminds Power Solutions Pvt. Ltd.';
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}
/* public/custom.css */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loader-container {
    text-align: center;
}

.logo-wrapper {
    position: relative;
    width: 300px;    /* Increased from 200px */
    height: 300px;   /* Increased from 200px */
    margin: 0 auto 30px;
}

.company-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;    /* Increased from 120px */
    height: 200px;   /* Increased from 120px */
    background: white;
    border-radius: 50%;
    padding: 25px;   /* Increased padding */
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    z-index: 2;
    animation: pulse 2s ease-in-out infinite;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.spinner-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;    /* Increased from 200px */
    height: 300px;   /* Increased from 200px */
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: rotate 1.5s linear infinite;
    z-index: 1;
}

.spinner-circle-secondary {
    position: absolute;
    top: 15px;       /* Increased from 10px */
    left: 15px;      /* Increased from 10px */
    width: 270px;    /* Increased from 180px */
    height: 270px;   /* Increased from 180px */
    border: 3px solid transparent;
    border-bottom: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: rotate 2s linear infinite reverse;
    z-index: 1;
}


.loading-text {
    color: white;
    font-size: 24px;
    font-weight: 600;
    margin-top: 20px;
}

.loading-subtext {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-top: 10px;
    font-weight: 300;
}

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

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}


/* ---------- Empty-chat landing screen ---------- */
/* When <body> has .cl-empty (set by custom.js), vertically center the composer
   and hide the (empty) message list so the page looks like ChatGPT’s landing UI. */

body.cl-empty .cl__main,
body.cl-empty [data-testid="main-container"] {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.cl-empty [data-testid="message-list"],
body.cl-empty .cl__messages {
  display: none !important;
}

body.cl-empty .cl__composer-wrap,
body.cl-empty [data-testid="composer-wrapper"] {
  flex: 1;
  display: flex;
  align-items: center;      /* vertical centering */
  justify-content: center;  /* horizontal centering */
  padding-bottom: 12vh;     /* lift it a bit, like ChatGPT */
}

/* Big centered headline above the input (inserted by custom.js) */
#cl-hero-title {
  display: none; /* default hidden when chat is not empty */
}

body.cl-empty #cl-hero-title {
  display: block;
  text-align: center;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 600;
  color: #111827;
  margin-bottom: 18px;
}

/* ---------- Input “pill” look & width like ChatGPT ---------- */

.cl__composer,
[data-testid="input-box"] {
  max-width: 820px;              /* narrow, centered column */
  margin: 0 auto;
}

.cl__composer textarea,
[data-testid="input-box"] textarea {
  border-radius: 24px !important; /* pill */
  padding: 14px 18px !important;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
  border: 1px solid #e5e7eb !important;
  line-height: 1.35;
  font-size: 15px;
}

/* keep the send / mic buttons snug on the right */
.cl__composer [role="button"],
[data-testid="input-box"] button {
  border-radius: 999px !important;
}

/* keep message width comfortable after the first message */
.cl__message,
[data-testid="message"] .markdown {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* ======== Centered landing overlay ======== */
#cl-empty-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: transparent;        /* keep your logo visible behind */
  z-index: 50;
  pointer-events: none;           /* clicks pass through except the box */
}
#cl-empty-box {
  width: min(860px, 92vw);
  display: grid;
  gap: 16px;
  justify-items: center;
  pointer-events: auto;           /* allow typing/clicking in the composer */
}
#cl-empty-title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 600;
  color: #111827;
  text-align: center;
}

/* Hide empty message list while overlay is active */
body.cl-empty [data-testid="message-list"],
body.cl-empty .cl__messages {
  display: none !important;
}

/* Nice “pill” input look even when moved into overlay */
#cl-empty-box .cl__composer,
#cl-empty-box [data-testid="input-box"] {
  width: 100%;
}
#cl-empty-box textarea {
  border-radius: 24px !important;
  padding: 14px 18px !important;
  box-shadow: 0 6px 18px rgba(17,24,39,.06);
  border: 1px solid #e5e7eb !important;
  font-size: 15px;
  line-height: 1.35;
}

/* Keep chat messages comfortably narrow after first send */
.cl__message,
[data-testid="message"] .markdown {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* Header brand (top-left AppBar) — catch both <img> and MUI Avatar cases */
header .MuiToolbar-root img {
  height: 32px !important;   /* tweak: 28–40 */
  width: auto !important;
}

header .MuiToolbar-root .MuiAvatar-root {
  width: 36px !important;    /* tweak: 32–44 */
  height: 36px !important;
}

/* If your header uses a div with a background image instead of <img> */
header [class*="logo"], header [data-testid*="logo"] {
  background-size: contain !important;
  width: 180px !important;   /* tweak as needed */
  height: 36px !important;
}


/* Assistant & user avatars next to messages */
.cl__message .MuiAvatar-root,
[data-testid="message"] .MuiAvatar-root {
  width: 40px !important;    /* tweak: 36–48 */
  height: 40px !important;
}
