/* ============================================
   UPLEVEL SYSTEMS - COMPLETE FINAL CSS
   All issues resolved including rounded search dropdown
   ============================================ */

/* ROOT VARIABLES */
:root {
    --uplevel-purple: #6B46C1 !important;
    --uplevel-purple-dark: #553C9A !important;
    --uplevel-purple-light: #9F7AEA !important;
}

/* ============================================
   FORCE FULL WIDTH
   ============================================ */

body, html {
    width: 100% !important;
    max-width: 100% !important;
}

.Header__header,
.Header__headerContainer,
.Header__headerRow {
    max-width: 100% !important;
    width: 100% !important;
}

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

.Header__header {
    background: #6B46C1 !important;
    box-shadow: 0 10px 25px rgba(107, 70, 193, 0.15) !important;
}

.Header__headerImg {
    display: none !important;
    height: 0 !important;
}

.Header__headerContainer {
    background: #6B46C1 !important;
    padding: 0 3rem !important;
}

.Header__headerRow {
    display: flex !important;
    align-items: center !important;
    padding: 1.25rem 0 !important;
    gap: 2rem !important;
}

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

.Header__brandLogo img {
    max-height: 45px !important;
}

.Header__brandName {
    color: #FFFFFF !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.Header__headerSearch {
    display: flex !important;
    flex: 1 !important;
    max-width: 600px !important;
    min-width: 300px !important;
    position: relative !important;
    overflow: visible !important;
    background: transparent !important;
}

#searchContainer,
.Header__headerSearchInner {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: relative !important;
    overflow: visible !important;
    background: transparent !important;
}

#searchContainer > div,
#searchContainer > div > div,
#searchContainer > div > div > div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    background: transparent !important;
}

.Search__searchPanel,
.Search__searchPanelInner {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    overflow: visible !important;
    background: transparent !important;
}

.Search__searchPanelControls {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    background: transparent !important;
}

/* Hide the left search icon - it's a duplicate */
.Search__searchPanelIcon:first-child,
div[class*="searchPanelIcon"]:first-child,
.Search__searchPanel > div:first-child > svg,
button[class*="searchIcon"],
.searchPanelSearchIcon,
div[class*="searchIcon"]:not(.Search__searchPanelIcon) {
    display: none !important;
}

/* Keep only the icon inside the input field (on the right) */
.searchPanelSearchBox .Search__searchPanelIcon,
#autoSearchContainer .Search__searchPanelIcon {
    display: block !important;
}

.Input__searchPanelInput,
input[data-id="searchInput"],
div[class*="searchPanel"] input[type="text"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 45px !important;
    padding: 0.875rem 3rem 0.875rem 1.25rem !important;
    border-radius: 24px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    color: #1A202C !important;
    font-size: 1rem !important;
}

.Input__searchPanelInput:focus,
input[data-id="searchInput"]:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2) !important;
}

.Search__searchPanelIcon {
    display: block !important;
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

.Search__searchPanelIcon svg {
    fill: #6B46C1 !important;
    width: 20px !important;
    height: 20px !important;
}

.Search__searchPanelClose,
.Search__searchIcon {
    display: none !important;
}

/* ============================================
   SEARCH RESULTS - COMPLETE FIX WITH ROUNDED CORNERS
   ============================================ */

/* Hide dropdown by default */
.searchPanelSections,
div[class*="searchPanelSections"],
.Search__searchResults,
div[class*="searchResults"] {
    display: none !important;
}

/* Show ONLY when it has content */
.searchPanelSections:not(:empty),
div[class*="searchPanelSections"]:not(:empty) {
    display: block !important;
    position: absolute !important;
    top: calc(100% + 0.5rem) !important;
    left: 0px !important;
    right: 0px !important;
    background: #FFFFFF !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #E2E8F0 !important;
    max-height: 400px !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    z-index: 10000 !important;
    min-height: 50px !important;
    padding: 0 !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    will-change: transform !important;
}

/* Force ALL text to be visible and dark */
.searchPanelSections:not(:empty) *,
div[class*="searchPanelSections"]:not(:empty) * {
    color: #1A202C !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Force all divs and spans to display */
.searchPanelSections:not(:empty) div,
.searchPanelSections:not(:empty) span,
.searchPanelSections:not(:empty) p {
    display: block !important;
    color: #1A202C !important;
}

/* Force links to be purple and visible */
.searchPanelSections:not(:empty) a,
.searchPanelSections:not(:empty) a *,
div[class*="searchPanelSections"]:not(:empty) a,
div[class*="searchPanelSections"]:not(:empty) a * {
    color: #6B46C1 !important;
    text-decoration: none !important;
    display: inline !important;
}

.searchPanelSections:not(:empty) a:hover {
    color: #553C9A !important;
    text-decoration: underline !important;
}

/* Individual result items */
.searchPanelSections:not(:empty) > div,
div[class*="searchPanelSections"]:not(:empty) > div {
    padding: 0.75rem 1.5rem !important;
    border-bottom: 1px solid #E2E8F0 !important;
    cursor: pointer !important;
    background: #FFFFFF !important;
    display: block !important;
    margin: 0 !important;
}

/* CLEAN SHARP CORNERS */
/* First result item */
.searchPanelSections:not(:empty) > div:first-child,
.searchPanelSections:not(:empty) > *:first-child,
.searchPanelSections:not(:empty) > * > :first-child,
div[class*="searchPanelSections"]:not(:empty) > div:first-child {
    padding-top: 1rem !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
}

/* Hover state */
.searchPanelSections:not(:empty) > div:hover {
    background: #F7FAFC !important;
}

/* Last result item */
.searchPanelSections:not(:empty) > div:last-child,
.searchPanelSections:not(:empty) > *:last-child,
.searchPanelSections:not(:empty) > * > :last-child,
div[class*="searchPanelSections"]:not(:empty) > div:last-child {
    border-bottom: none !important;
    padding-bottom: 1rem !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
}

/* Ensure no child breaks the sharp corners */
.searchPanelSections:not(:empty) *:not(a):not(span) {
    overflow: hidden !important;
}

/* Target Zoho's specific wrapper divs */
div[class*="searchPanel"] div[class*="Section"],
div[class*="searchPanel"] div[class*="section"],
div[class*="searchPanel"] > div > div {
    border-radius: 0 !important;
}

/* Titles */
.searchPanelSections:not(:empty) h1,
.searchPanelSections:not(:empty) h2,
.searchPanelSections:not(:empty) h3,
.searchPanelSections:not(:empty) h4,
.searchPanelSections:not(:empty) strong {
    color: #1A202C !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    display: block !important;
}

/* Descriptions */
.searchPanelSections:not(:empty) span:not(a span),
.searchPanelSections:not(:empty) p {
    color: #4A5568 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Section headers */
.searchPanelSections:not(:empty) h5 {
    color: #718096 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.75rem 1.5rem 0.5rem !important;
    font-weight: 600 !important;
    background: #F7FAFC !important;
}

/* Target Zoho result classes directly */
div[class*="Result"],
div[class*="result"],
div[class*="Suggestion"],
div[class*="suggestion"] {
    display: block !important;
    padding: 0.75rem 1.5rem !important;
    background: #FFFFFF !important;
    cursor: pointer !important;
}

div[class*="Result"] *,
div[class*="result"] *,
div[class*="Suggestion"] *,
div[class*="suggestion"] * {
    color: #1A202C !important;
    visibility: visible !important;
}

div[class*="Result"] a,
div[class*="result"] a,
div[class*="Suggestion"] a,
div[class*="suggestion"] a {
    color: #6B46C1 !important;
}

/* ============================================
   SIGN IN / SIGN UP
   ============================================ */

.Header__headerRow > a,
.Header__headerRow > button,
.Header__headerRow > div > a,
.Header__headerRow > div > button {
    color: #FFFFFF !important;
    padding: 0.625rem 1.5rem !important;
    border-radius: 24px !important;
    font-weight: 500 !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    background: transparent !important;
}

.Header__headerRow > a:hover,
.Header__headerRow > button:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */

.Header__headerNav {
    background: #553C9A !important;
    width: 100% !important;
}

.Header__tabsList {
    display: flex !important;
    padding: 0 3rem !important;
}

.Header__tabsTab a {
    padding: 1rem 2rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500 !important;
    border-bottom: 3px solid transparent !important;
}

.Header__tabsTab a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #FFFFFF !important;
}

.Header__tabsTab.active a,
.Header__tabsTab a.active {
    background: #FFFFFF !important;
    color: #6B46C1 !important;
    font-weight: 600 !important;
    border-bottom-color: #6B46C1 !important;
}

/* ============================================
   BODY & LAYOUT
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: #1A202C !important;
    background: #F7FAFC !important;
}

.kb-content-wrapper,
.main-content {
    width: 100% !important;
    padding: 0 3rem !important;
    display: flex !important;
    gap: 2rem !important;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: 280px !important;
}

.sidebar-widget,
.kb-sections {
    background: #FFFFFF !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid #E2E8F0 !important;
}

.sidebar-widget h3,
.kb-sections h3 {
    color: #553C9A !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #E2E8F0 !important;
    padding-bottom: 0.75rem !important;
}

/* ============================================
   ARTICLE CARDS
   ============================================ */

.article-card,
.kb-article {
    background: #FFFFFF !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid #E2E8F0 !important;
    transition: all 0.3s ease !important;
}

.article-card:hover,
.kb-article:hover {
    box-shadow: 0 10px 25px rgba(107, 70, 193, 0.15) !important;
    transform: translateY(-4px) !important;
}

.article-card img[src*="briefcase"],
.kb-article img[src*="briefcase"] {
    display: none !important;
}

.article-card h2,
.article-card h3,
.kb-article h2,
.kb-article h3 {
    color: #6B46C1 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

.article-card h2 a,
.article-card h3 a {
    color: #6B46C1 !important;
    text-decoration: none !important;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn,
button:not(.Header__headerRow button):not([class*="searchPanel"]),
.follow-button,
[class*="follow"] button {
    background: #6B46C1 !important;
    color: #FFFFFF !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    border: none !important;
    font-weight: 500 !important;
}

.btn:hover,
button:hover {
    background: #553C9A !important;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .Header__headerRow {
        flex-wrap: wrap !important;
    }
    
    .Header__headerSearch {
        order: 3 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 1rem !important;
    }
    
    .kb-content-wrapper {
        flex-direction: column !important;
        padding: 0 1.5rem !important;
    }
    
    .sidebar {
        width: 100% !important;
    }
    
    .Header__tabsList {
        padding: 0 1.5rem !important;
    }
}

/* ============================================
   CLEAN SHARP CORNERS ENFORCEMENT
   Applied last to override everything
   ============================================ */

.searchPanelSections {
    border-radius: 0 !important;
}

.searchPanelSections > div:first-child,
.searchPanelSections > *:first-child {
    border-radius: 0 !important;
}

.searchPanelSections > div:last-child,
.searchPanelSections > *:last-child {
    border-radius: 0 !important;
}
