@font-face {
    font-family: 'Barlow';
    src: url('file/Barlow.zip/Barlow-Regular.ttf') format('truetype');
}

body {
    /* Force dark theme regardless of OS settings */
    color-scheme: dark !important;
    background-color: #0D1223 !important; /* Dark blue fallback */
    background-image: url('""" + str(SCRIPT_DIR / "file/Gradient-Background.png") + """') !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important; /* Keeps background fixed while scrolling */
    font-family: 'Barlow', sans-serif !important;
    color: white !important;
    /* Prevent any OS/browser light mode overrides */
    forced-color-adjust: none !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Force all text inputs and areas to use dark theme */
input, textarea, select {
    color-scheme: dark !important;
    background-color: rgba(13, 18, 35, 0.95) !important;
    color: white !important;
}

/* Ensure scrollbar also matches dark theme */
::-webkit-scrollbar {
    background-color: #0D1223 !important;
    width: 10px !important;
}

::-webkit-scrollbar-thumb {
    background-color: #2A2F3C !important;
    border-radius: 5px !important;
}

.header-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background-color: transparent !important;
    width: 100% !important;
    position: relative !important;
    height: 130px !important;
    min-height: 130px !important;
    overflow: visible !important;
}

/* Logo wrapper - position at top left */
.logo-wrapper {
    position: absolute !important;
    left: 20px !important;
    top: 20px !important; /* Changed from 50% to fixed top padding */
    transform: none !important; /* Removed Y-axis transform */
    z-index: 1000 !important;
}

.logo, .icon {
    pointer-events: none !important;  /* Disable click events */
}

.logo img {
    height: 90px !important; /* Fixed height instead of responsive */
    width: auto !important;
    object-fit: contain !important;
}

.icon img {
    height: 180px !important;
    width: 180px !important;
    object-fit: contain !important;
}

/* Center title container */
.title-container {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    flex-direction: row !important;
    overflow: visible !important;
    white-space: nowrap !important;
    z-index: 1000 !important;
}

/* Title text styling */
.title-text {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    max-width: none !important;
    flex-shrink: 0 !important;
}
/* Axelera text */
.axelera {
    color: #FBBE18;
    font-size: clamp(32px, 3vw, 42px) !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    display: block !important;
    font-family: 'Barlow', sans-serif !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* SLM Demo text */
.slm-demo {
    color: white;
    font-size: clamp(32px, 3vw, 42px) !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: bold !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    display: block !important;
    font-family: 'Barlow', sans-serif !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* Icon styling */
.icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}
.icon {
    height: 180px !important;
    width: 180px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
}

/* Override any Gradio default styles that might affect layout */
.title-container > div {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    max-width: none !important;
}
/* Additional override for any Gradio containers */
.title-container > div > div {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    max-width: none !important;
}

/* Chat section */
.chat-header {
    text-align: center !important;
    margin: 20px auto !important;
    padding: 0 20px !important;
    font-size: clamp(20px, 3vw, 29px) !important;
    line-height: 1.2 !important;
    width: fit-content !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
}

.chat-header b {
    display: inline-block !important;
    width: 100% !important;
}

/* Chatbox styling */
.chatbox {
    border: 2px solid #353535;
    border-radius: 25px;
    background-color: rgba(13, 18, 35, 0.95);
    padding: 10px;
    margin: 10px auto;
    max-width: 1200px;
}

/* Message input container */
.message-container {
    display: flex;
    align-items: center !important;
    max-width: 90%;
    margin: 20px auto;
}

/* Input styling */
.input-container {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
}

.message-input {
    border: none !important;
    border-radius: 10px;
    color: white;
    padding: 15px 20px;
    align-items: center !important;
}

/* Clear button styling */
.clear-btn {
    background-color: rgba(13, 18, 35, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px !important;
    color: white !important;
    padding: 8px 24px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    min-width: 80px !important;
    font-family: 'Barlow', sans-serif !important;
    height: 45px !important; /* Match height with textbox */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

.clear-btn:hover {
    background-color: rgba(20, 27, 50, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}


/* Settings button styling */
.settings-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 15px !important;
    margin-left: 100px !important;
    min-width: 40px !important;
}

.settings-btn {
    background: none !important;
    border: none !important;
    font-size: 24px !important;  /* Increased size */
    cursor: pointer !important;
    padding: 8px !important;  /* Increased padding */
    color: rgba(255, 255, 255, 0.8) !important;  /* Increased opacity */
    transition: all 0.3s ease !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 100px !important;
}

.settings-btn:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.05) !important;
}

/* Status container */
.status-container {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-top: 10px !important;
    padding: 0 40px !important;
    font-family: 'Barlow', sans-serif !important;
    overflow: hidden !important; /* Prevent scrollbar */
}

.status-text, .system-info-text {
    font-family: 'Barlow', sans-serif !important;
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 8px 15px !important;
    flex-grow: 1 !important;
    white-space: nowrap !important; /* Prevent text wrapping */
    overflow: hidden !important; /* Hide overflow */
    text-overflow: ellipsis !important; /* Show ellipsis for overflow text */
}

.system-info-text {
    text-align: right !important;
}

/* Modal styling */
.system-prompt-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: rgba(13, 18, 35, 0.98) !important;
    border-radius: 15px !important;
    padding: 25px !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
    z-index: 2000 !important;
    max-width: 600px !important;
    width: 90% !important;
}

/* Add this to ensure the Box doesn't affect layout when hidden */
.gradio-box {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1999 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.gradio-box[style*="display: none"] {
    pointer-events: none !important;
}

.cancel-btn {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    padding: 10px 25px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-top: 15px !important;
    transition: all 0.3s ease !important;
}

.cancel-btn:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.update-prompt-btn {
    background-color: #F4BE18 !important;
    border: none !important;
    border-radius: 8px !important;
    color: #0A0F1E !important;
    padding: 10px 25px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-top: 15px !important;
    transition: all 0.3s ease !important;
}

.update-prompt-btn:hover {
    background-color: #d6a616 !important;
    transform: translateY(-1px);
}

/* Additional fixes for Gradio container elements */
.status-container > div {
    overflow: hidden !important;
}

.status-container > div > div {
    overflow: hidden !important;
}

/* Ensure the markdown containers don't create scrollbars */
.status-text > div, .system-info-text > div {
    overflow: hidden !important;
}

/* Ensure all text uses Barlow font */
.system-prompt-modal,
.system-prompt-input,
.update-prompt-btn,
.cancel-btn,
.message-input,
.clear-btn,
.chat-header,
.status-container * {
    font-family: 'Barlow', sans-serif !important;
}

/* Add these rules after your existing .chatbox styling */
.chatbox .message {
    background-color: rgba(13, 18, 35, 0.95) !important;
    color: white !important;
}
