/* ============================================
   IPS COMMUNITY FRAMEWORK - COMPLETE REBUILD
   ============================================
   ✅ Full-width sticky header (no gaps)
   ✅ Sidebar always visible (all devices)
   ✅ Header starts AFTER sidebar (no overlay)
   ✅ Fully responsive design
   ✅ Optimized and clean code
   ============================================ */

/* ============================================
   TABLE OF CONTENTS
   ============================================
   1. CSS Variables & Theme Configuration
   2. Reset & Base Styles
   3. Typography
   4. Layout & Grid System (WITH SIDEBAR)
   5. Navigation Components
   6. Buttons & Form Elements
   7. Content Components
   8. User Interface Elements
   9. Utility Classes
   10. Responsive Design
   ============================================ */


/* ============================================
   1. CSS VARIABLES & THEME CONFIGURATION
   ============================================ */

:root {
    /* Spacing System */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 32px;
    --sp-8: 40px;
    --sp-9: 48px;
    --sp-10: 64px;

    /* Border Radius */
    --radius-1: 4px;
    --radius-2: 8px;

    /* Borders */
    --border-1px: 1px solid rgba(var(--theme-text_light), 0.15);

    /* Color Palette - Semantic */
    --positive-dark: #2C8C69;
    --positive-light: #f0faf6;
    --negative-dark: #C53030;
    --negative-light: #FFF5F5;
    --intermediate-dark: #DD6B20;
    --intermediate-light: #FFFAF0;
    --informational-dark: #2981bf;
    --informational-light: #e9f0f5;
    --general-dark: #7f858d;
    --general-light: #f0f4f8;

    /* Box Styling */
    --box--boxShadow: 0px 2px 4px -1px rgba(var(--theme-area_background_dark), 0.1);
    --box--color: rgb(var(--theme-area_background_dark));
    --box--backgroundColor: rgb(var(--theme-area_background_reset));
    --box--radius: var(--radius-1);

    /* Component-Specific */
    --popup--radius: var(--radius-1);
    --popup--border: 1px solid rgba(var(--theme-area_background_dark), 0.1);
    --popup--boxShadow: 0 8px 50px rgba(0, 0, 0, 0.1), 0px 4px 15px rgba(0, 0, 0, 0.05);
    --dialog--boxShadow: 0px 5px 55px rgba(var(--theme-area_background_dark), 0.4), 
                         0px 7px 24px -12px rgba(var(--theme-area_background_dark), 0.7);

    /* Layout Dimensions */
    --header--height: 80px;
    --responsive-header--height: 55px;
    --logo--height: 100%;
    --primary-navigation--height: 52px;
    --secondary-navigation--height: 50px;
    
    /* Sidebar Dimensions */
    --sidebar--width-desktop: 60px;
    --sidebar--width-mobile: 50px;
    --sidebar--width-small: 45px;

    /* Form Elements */
    --form-field--radius: var(--radius-1);
    --form-field--borderColor: rgba(var(--theme-text_light), 0.4);
    --form-field--borderHoverColor: rgba(var(--theme-text_light), 0.8);
    --form-field--focusShadow: rgba(var(--theme-active_input_border), 0.3) 0px 0px 0px 4px;

    /* Button Styling */
    --button--radius: var(--radius-1);

    /* Trophy Colors */
    --trophy-first--background: #fac746;
    --trophy-first--color: #704926;
    --trophy-second--background: #c0c0c0;
    --trophy-third--background: #cd7f32;

    /* Container Widths */
    --container--width: var(--ae-container-width);
    --minimal_container--width: var(--ae-container-width-minimal);

    /* Theme Colors (RGB values) */
    --theme-active_input_border: 251, 196, 40;
    --theme-alternate_button: 22, 22, 29;
    --theme-area_background: 26, 26, 33;
    --theme-area_background_dark: 26, 26, 33;
    --theme-area_background_light: 26, 26, 33;
    --theme-area_background_reset: 22, 22, 29;
    --theme-brand_primary: 251, 196, 40;
    --theme-page_background: 17, 17, 23;
    --theme-text_color: 188, 188, 188;
    --theme-text_dark: 188, 188, 188;
    --theme-text_light: 153, 153, 153;
    --theme-text_very_light: 255, 255, 255;
}


/* ============================================
   2. RESET & BASE STYLES
   ============================================ */

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    position: relative;
    line-height: 1.15;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", 
                 "Segoe UI Symbol";
    font-size: 13.0px;
    line-height: 1.5;
    color: rgb(var(--theme-text_color));
    height: 100%;
    background-color: rgb(var(--theme-page_background));
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
}

/* Remove scrolling when needed */
body.ipsNoScroll {
    overflow: hidden;
}

/* Link Styles */
a {
    color: rgb(var(--theme-link));
    text-decoration: none;
    -webkit-text-decoration-skip: objects;
}

a:hover {
    color: rgb(var(--theme-link_hover));
}

a:active,
a:focus,
a:hover {
    outline: 0 !important;
}

/* Image Defaults */
img {
    vertical-align: middle;
    border-style: none;
}

/* Emoji Support */
span.ipsEmoji,
div.ipsEmoji {
    font-weight: normal;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", 
                 "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";
}

img.ipsEmoji {
    height: 1.25em;
    width: 1.25em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}


/* ============================================
   3. TYPOGRAPHY
   ============================================ */

/* Heading Styles */
.ipsType_pageTitle,
.ipsType_sectionTitle,
.ipsType_secondaryTitle,
.ipsType_sectionHead,
.ipsType_minorHeading {
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.ipsType_pageTitle {
    font-size: 24.0px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0;
    color: rgb(var(--theme-text_dark));
}

.ipsType_pageTitle > .fa {
    font-size: 18.0px;
}

.ipsType_pageTitle a:not(.ipsBadge):not(.ipsButton) {
    color: inherit;
}

.ipsType_sectionTitle {
    font-size: 16.0px;
    line-height: 1;
    font-weight: bold;
    background: var(--ae-title-color);
    padding: var(--ae-ten-px);
    margin: 0;
    color: rgb(var(--theme-section_title_font));
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.ipsType_sectionHead {
    font-size: 18.0px;
    color: rgb(var(--theme-text_dark));
    line-height: 24.0px;
    font-weight: bold;
    display: inline-block;
    margin: 0;
}

.ipsType_minorHeading {
    color: rgb(var(--theme-text_light));
    text-transform: uppercase;
    font-size: 12.0px;
    margin: 0;
}

/* Font Size Variations */
.ipsType_small {
    font-size: 12.0px;
}

.ipsType_small:not(.ipsType_richText) {
    line-height: 1.45;
}

.ipsType_medium {
    font-size: 13.0px;
}

.ipsType_medium:not(.ipsType_richText) {
    line-height: 1.53;
}

.ipsType_normal {
    font-size: 14.0px;
}

.ipsType_normal:not(.ipsType_richText) {
    line-height: 1.5;
}

.ipsType_large {
    font-size: 16.0px;
}

.ipsType_large:not(.ipsType_richText) {
    line-height: 1.25;
}

.ipsType_veryLarge {
    font-size: 36.0px;
    line-height: 1.18;
    font-weight: bold;
    letter-spacing: -0.9px;
    color: rgb(var(--theme-text_dark));
}

.ipsType_huge {
    font-size: 64.0px;
    line-height: 1.11;
    font-weight: 300;
    color: rgb(var(--theme-text_dark));
}

/* Text Alignment */
.ipsType_center {
    text-align: center;
}

.ipsType_left {
    text-align: left;
}

html[dir="rtl"] .ipsType_left {
    text-align: right;
}

.ipsType_right {
    text-align: right;
}

html[dir="rtl"] .ipsType_right {
    text-align: left;
}

.ipsType_justify {
    text-align: justify;
}

/* Text Styling */
.ipsType_bold {
    font-weight: bold;
}

.ipsType_unbold {
    font-weight: normal;
}

.ipsType_monospace {
    font-family: monospace;
}

.ipsType_uppercase {
    text-transform: uppercase;
}

/* Text Colors */
.ipsType_light {
    color: rgb(var(--theme-text_light));
}

.ipsType_dark {
    color: rgb(var(--theme-text_dark));
}

.ipsType_warning,
.ipsType_negative {
    color: var(--negative-dark);
}

.ipsType_success,
.ipsType_positive {
    color: var(--positive-dark);
}

.ipsType_neutral {
    color: rgb(var(--theme-text_light));
}

/* Rich Text Styling */
.ipsType_richText {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.ipsType_richText a {
    text-decoration: underline;
}

.ipsType_richText > p:first-child {
    margin-top: 0;
}

.ipsType_richText > p:last-child {
    margin-bottom: 0;
}

.ipsType_richText img {
    max-width: 100%;
}

/* Text Highlighting */
mark {
    background: rgba(var(--theme-featured), 0.1);
    padding: 0 5px;
    color: rgb(var(--theme-featured)) !important;
    font-weight: inherit;
    display: inline-block;
    border-radius: var(--radius-1);
}


/* ============================================
   4. LAYOUT & GRID SYSTEM (WITH SIDEBAR)
   ============================================ */

/* ===========================================
   SIDEBAR - ALWAYS VISIBLE (ALL DEVICES)
   =========================================== */

#ipsLayout_sidebar {
    display: block !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: var(--sidebar--width-desktop) !important;
    min-width: var(--sidebar--width-desktop) !important;
    max-width: var(--sidebar--width-desktop) !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #0d0d10 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateZ(0) !important;
}

/* Sidebar scrollbar styling */
#ipsLayout_sidebar::-webkit-scrollbar {
    width: 3px;
}

#ipsLayout_sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#ipsLayout_sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Sidebar icons - ensure visibility */
#ipsLayout_sidebar a,
#ipsLayout_sidebar button,
#ipsLayout_sidebar .sidebar-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 12px 0 !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#ipsLayout_sidebar a:hover,
#ipsLayout_sidebar button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Prevent sidebar from hiding */
body.ipsLayout_minimal #ipsLayout_sidebar,
body.ipsResponsive #ipsLayout_sidebar,
body[data-mobile="true"] #ipsLayout_sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===========================================
   MAIN LAYOUT - ADJUSTED FOR SIDEBAR
   =========================================== */

#ipsLayout_body {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.ipsWrapper,
#ipsLayout_wrap {
    margin: 0 !important;
    padding: 0 !important;
}

#ipsLayout_mainArea,
#ipsLayout_contentArea {
    margin-left: var(--sidebar--width-desktop) !important;
    width: calc(100% - var(--sidebar--width-desktop)) !important;
    display: block !important;
    min-height: 350px;
    padding: 0px;
}

/* ===========================================
   HEADER - STARTS AFTER SIDEBAR (NO OVERLAY)
   =========================================== */

#ipsLayout_header {
    position: sticky !important;
    top: 0 !important;
    left: var(--sidebar--width-desktop) !important; /* START AFTER SIDEBAR */
    width: calc(100vw - var(--sidebar--width-desktop)) !important; /* WIDTH MINUS SIDEBAR */
    max-width: none !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    z-index: 10000 !important;
    background-color: rgb(var(--theme-page_background)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
    border-radius: 0 !important;
    transform: translateZ(0) !important;
}

#ipsLayout_header header {
    background-color: var(--ae-title-color) !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Enhanced shadow when scrolled */
#ipsLayout_header.is-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Ensure content doesn't hide under sticky header */
#ipsLayout_mainArea:first-child {
    scroll-margin-top: calc(var(--header--height) + 20px);
}

/* ===========================================
   CONTAINER - FULL WIDTH OVERRIDE
   =========================================== */

.ipsLayout_container {
    max-width: var(--container--width);
    padding: 0 15px;
    margin: 0 auto;
    position: relative;
}

#ipsLayout_header .ipsLayout_container,
#ipsLayout_header header > .ipsLayout_container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* ===========================================
   GRID SYSTEM
   =========================================== */

ul.ipsGrid,
ol.ipsGrid {
    padding: 0;
    margin: 0;
}

.ipsGrid:before,
.ipsGrid:after {
    display: table;
    content: "";
    line-height: 0;
}

.ipsGrid:after {
    clear: both;
}

.ipsGrid > [class*="ipsGrid_span"] {
    display: block;
    width: 100%;
    min-height: 30px;
    box-sizing: border-box;
}

html[dir="ltr"] .ipsGrid > [class*="ipsGrid_span"] {
    float: left;
    margin-left: 2.127659574468085%;
}

html[dir="rtl"] .ipsGrid > [class*="ipsGrid_span"] {
    float: right;
    margin-right: 2.127659574468085%;
}

/* Grid Span Classes */
.ipsApp .ipsGrid > .ipsGrid_span12 { width: 100%; }
.ipsApp .ipsGrid > .ipsGrid_span11 { width: 91.48936170212765%; }
.ipsApp .ipsGrid > .ipsGrid_span10 { width: 82.97872340425532%; }
.ipsApp .ipsGrid > .ipsGrid_span9 { width: 74.46808510638297%; }
.ipsApp .ipsGrid > .ipsGrid_span8 { width: 65.95744680851064%; }
.ipsApp .ipsGrid > .ipsGrid_span7 { width: 57.44680851063829%; }
.ipsApp .ipsGrid > .ipsGrid_span6 { width: 48.93617021276595%; }
.ipsApp .ipsGrid > .ipsGrid_span5 { width: 40.42553191489362%; }
.ipsApp .ipsGrid > .ipsGrid_span4 { width: 31.914893617021278%; }
.ipsApp .ipsGrid > .ipsGrid_span3 { width: 23.404255319148934%; }
.ipsApp .ipsGrid > .ipsGrid_span2 { width: 14.893617021276595%; }
.ipsApp .ipsGrid > .ipsGrid_span1 { width: 6.382978723404255%; }

/* Flexbox Utilities */
.ipsFlex {
    display: flex;
}

.ipsFlex > * {
    flex: 0 1 auto;
    min-width: 0;
}

/* Flex Alignment */
.ipsFlex-ai\:start { align-items: flex-start; }
.ipsFlex-ai\:center { align-items: center; }
.ipsFlex-ai\:end { align-items: flex-end; }
.ipsFlex-ai\:stretch { align-items: stretch; }

.ipsFlex-jc\:start { justify-content: flex-start; }
.ipsFlex-jc\:center { justify-content: center; }
.ipsFlex-jc\:end { justify-content: flex-end; }
.ipsFlex-jc\:around { justify-content: space-around; }
.ipsFlex-jc\:between { justify-content: space-between; }

/* Flex Direction */
.ipsFlex-fd\:column { flex-direction: column; }
.ipsFlex-fd\:row { flex-direction: row; }

/* Flex Wrap */
.ipsFlex-fw\:wrap { flex-wrap: wrap; }
.ipsFlex-fw\:nowrap { flex-wrap: nowrap; }


/* ============================================
   5. NAVIGATION COMPONENTS
   ============================================ */

/* Header Navigation */
#ipsLayout_header nav {
    position: relative;
}

.ipsNavBar_primary > ul,
.ipsNavBar_secondary {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ipsNavBar_primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ipsLayout_header .ipsNavBar_primary {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

#ipsLayout_header .ipsNavBar_primary > ul {
    margin: 0 !important;
    padding: 0 !important;
}

.ipsNavBar_primary > ul > li,
.ipsNavBar_secondary > li {
    display: inline-block;
}

html[dir="ltr"] .ipsNavBar_primary > ul > li,
html[dir="ltr"] .ipsNavBar_secondary > li {
    float: left;
}

html[dir="rtl"] .ipsNavBar_primary > ul > li,
html[dir="rtl"] .ipsNavBar_secondary > li {
    float: right;
}

.ipsNavBar_primary > ul > li > a {
    font-size: 14px;
    color: inherit;
    padding: 0px 18px;
    height: 55px;
    line-height: 55px;
    font-weight: 600;
    transition: ease-in-out 0.5s;
    z-index: 999;
}

.ipsNavBar_primary > ul > li > a:hover {
    color: var(--ae-second-color);
    transition: ease-in 0.4s;
}

.ipsNavBar_primary > ul > li.ipsNavBar_active > a {
    color: var(--ae-second-color) !important;
}

/* Logo and Site Title */
#ipsLayout_header #elLogo {
    margin: 0 !important;
    padding: 0 15px 0 0 !important;
    border: 0 !important;
}

#ipsLayout_header #elLogo img {
    border: 0 !important;
    border-right: 0 !important;
    padding-right: 15px;
}

#ipsLayout_header #elSiteTitle {
    margin: 0 !important;
    padding: 0 15px 0 0 !important;
}

/* User Navigation */
#ipsLayout_header #elUserNav {
    margin: 0 !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

/* Breadcrumb Navigation */
.ipsBreadcrumb {
    position: relative;
    font-size: 13px;
    font-weight: 400;
    padding: 15px var(--ae-ten-px);
    color: inherit;
    margin: var(--ae-five-px) var(--ae-zero-px);
    border-radius: var(--ae-five-px);
    background: var(--ae-box-color);
}

#ipsLayout_header .ipsBreadcrumb {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
}

.ipsBreadcrumb > ul {
    margin: 0;
    padding: 0;
}

.ipsBreadcrumb li {
    display: inline-block;
    line-height: 30px;
    max-width: 100%;
    height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.ipsBreadcrumb a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}

.ipsBreadcrumb a:hover {
    color: var(--ae-main-color);
}


/* ============================================
   6. BUTTONS & FORM ELEMENTS
   ============================================ */

/* Button Base Styles */
.ipsApp .ipsButton {
    font-size: 14.0px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    padding: 10px 20px;
    border-radius: var(--button--radius);
    transition: 0.1s all linear;
    cursor: pointer;
    border: 0px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.ipsApp .ipsButton:hover:not(:active) {
    background-image: var(--ae-gradient-color);
    color: var(--ae-text-color);
    transition: 0.5s all linear;
}

/* Button Variants */
.ipsApp .ipsButton_normal {
    background: rgb(var(--theme-normal_button));
    color: rgb(var(--theme-normal_button_font));
}

.ipsApp .ipsButton_primary {
    font-weight: 500;
    background: rgb(var(--theme-primary_button));
    color: rgb(var(--theme-primary_button_font));
}

.ipsApp .ipsButton_positive {
    background: var(--positive-dark);
    color: var(--positive-light);
}

.ipsApp .ipsButton_negative {
    background: var(--negative-dark);
    color: var(--negative-light);
}

/* Button Sizes */
.ipsApp .ipsButton_small {
    font-size: 13.0px;
    line-height: 2.83;
    padding: 0 18px;
}

.ipsApp .ipsButton_large {
    font-size: 14.0px;
    line-height: 3;
    padding: 0 20px;
}

.ipsApp .ipsButton_verySmall {
    font-size: 13.0px;
    line-height: 2.33;
    padding: 0 15px;
}

/* Form Input Styles */
.ipsApp input[type="text"],
.ipsApp input[type="password"],
.ipsApp input[type="email"],
.ipsApp textarea,
.ipsApp select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: rgb(var(--theme-area_background_reset));
    border: 1px solid var(--form-field--borderColor);
    border-radius: var(--form-field--radius);
    width: 100%;
    max-width: 350px;
    padding: var(--sp-2);
    color: inherit;
}

.ipsApp input:hover {
    border-color: var(--form-field--borderHoverColor);
}

.ipsApp input:focus {
    box-shadow: var(--form-field--focusShadow);
    border-color: rgb(var(--theme-active_input_border));
    outline: 0;
}

/* Toggle Switch */
.ipsToggle {
    width: 42px;
    background: rgb(var(--theme-area_background_light));
    display: inline-block;
    height: 22px;
    line-height: 22px;
    border-radius: 11px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
    overflow: hidden;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.3s linear;
}

.ipsToggle.ipsToggle_on {
    background: rgb(var(--theme-active_input_border));
}

.ipsToggle span {
    background: #fff;
    border-radius: 9px;
    height: 16px;
    width: 16px;
    top: 2px;
    display: block;
    position: absolute;
    transition: all 0.2s linear;
}


/* ============================================
   7. CONTENT COMPONENTS
   ============================================ */

/* Box Container */
.ipsBox {
    box-shadow: var(--box--boxShadow);
    border-radius: var(--box--radius);
    background-color: var(--box--color);
}

/* Comment/Post Structure */
.ipsComment {
    position: relative;
    margin-bottom: var(--sp-5);
    padding: 0;
    background: rgb(var(--theme-area_background_reset));
}

.ipsComment_header {
    padding: var(--sp-4) var(--sp-5) 0;
    position: relative;
}

.ipsComment_content {
    position: relative;
}

/* Quote Blocks */
.ipsQuote,
.ipsSpoiler {
    margin: 0;
    padding: var(--sp-4);
    position: relative;
    background: rgb(var(--theme-area_background_light));
    border-radius: var(--radius-1);
    clear: both;
    border: 4px solid rgba(var(--theme-area_background_dark), .15);
}

[dir='ltr'] .ipsQuote,
[dir='ltr'] .ipsSpoiler {
    border-width: 0 0 0 4px;
}

.ipsQuote_citation {
    background: rgb(var(--theme-area_background));
    margin: calc(var(--sp-4) * -1);
    margin-bottom: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    color: rgb(var(--theme-text_color));
    font-weight: bold;
    font-size: 13.0px;
    display: block;
    cursor: pointer;
}

/* Code Blocks */
.ipsCode {
    background: rgb(var(--theme-area_background_light));
    padding: 15px !important;
    clear: both;
    direction: ltr;
    word-wrap: normal;
    border: 0px solid rgba(var(--theme-area_background_dark), .15) !important;
    margin: 0;
    border-radius: var(--radius-1);
}

/* Badges */
.ipsBadge {
    padding: 0 1em;
    line-height: 2;
    border-radius: 100px;
    font-weight: 500;
    display: inline-block;
    vertical-align: middle;
    text-shadow: none;
    letter-spacing: 0;
    background: var(--badge--background, currentColor);
}

.ipsBadge_positive {
    --badge--background: var(--positive-light);
    --badge--color: var(--positive-dark);
}

.ipsBadge_negative {
    --badge--color: var(--negative-dark);
}


/* ============================================
   8. USER INTERFACE ELEMENTS
   ============================================ */

/* User Photo/Avatar */
.ipsUserPhoto {
    background: rgb(var(--theme-area_background_reset));
    vertical-align: middle;
    display: inline-block;
    line-height: 1px;
    position: relative;
    margin: 2px;
    border-radius: 500px;
}

.ipsUserPhoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ipsUserPhoto_tiny { width: 34px; height: 34px; }
.ipsUserPhoto_small { width: 54px; height: 54px; }
.ipsUserPhoto_medium { width: 75px; height: 75px; }
.ipsUserPhoto_large { width: 90px; height: 90px; }

/* Modals/Dialogs */
.ipsModal {
    background: rgba(var(--theme-area_background_dark), 0.7);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15000;
}

.ipsDialog {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 20000;
    padding-bottom: 15px;
}

.ipsDialog > div {
    display: block;
    width: 90%;
    max-width: 1200px;
    background: rgb(var(--theme-area_background_reset));
    margin: 3% auto 0 auto;
    box-shadow: var(--dialog--boxShadow);
    position: relative;
    border-radius: var(--radius-2);
}

/* Tooltips */
.ipsTooltip {
    background: #2a2a2a;
    border-color: #2a2a2a;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    font-size: 12.0px;
    color: #fff;
    position: absolute;
    padding: 0 8px;
    pointer-events: none;
    border-radius: var(--popup--radius);
    user-select: none;
}

/* Loading Spinner */
.ipsLoading {
    position: relative;
}

.ipsLoading:before {
    content: '';
    border-radius: 50%;
    width: 1em;
    height: 1em;
    border: calc(2px + .03em) solid rgba(var(--theme-text_color), 0.1);
    border-top-color: rgb(var(--theme-text_color));
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -.5em;
    margin-left: -.5em;
    font-size: 50px;
    animation: spinner 0.65s infinite linear;
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}


/* ============================================
   9. UTILITY CLASSES
   ============================================ */

/* Spacing - Margin */
.ipsMargin { margin: var(--sp-5) !important; }
.ipsMargin_top { margin-top: var(--sp-5) !important; }
.ipsMargin_bottom { margin-bottom: var(--sp-5) !important; }
.ipsMargin_left { margin-left: var(--sp-5) !important; }
.ipsMargin_right { margin-right: var(--sp-5) !important; }

.ipsMargin\:half { margin: var(--sp-3) !important; }
.ipsMargin\:double { margin: var(--sp-8) !important; }
.ipsMargin\:none { margin: 0 !important; }

/* Spacing - Padding */
.ipsPad,
.ipsApp ul.ipsPad,
.ipsApp ol.ipsPad {
    padding: var(--sp-5);
}

.ipsPadding { padding: var(--sp-5) !important; }
.ipsPadding_top { padding-top: var(--sp-5) !important; }
.ipsPadding_bottom { padding-bottom: var(--sp-5) !important; }
.ipsPadding_left { padding-left: var(--sp-5) !important; }
.ipsPadding_right { padding-right: var(--sp-5) !important; }

.ipsPadding\:half { padding: var(--sp-3) !important; }
.ipsPadding\:double { padding: var(--sp-8) !important; }
.ipsPadding\:none { padding: 0 !important; }

/* Display */
.ipsHide { display: none; }
.ipsResponsive_block { display: block !important; }
.ipsResponsive_inline { display: inline !important; }
.ipsResponsive_inlineBlock { display: inline-block !important; }

/* Positioning */
.ipsPos_left { float: left; }
.ipsPos_right { float: right; }
.ipsPos_none { float: none; }
.ipsPos_center { margin: 0 auto; }
.ipsPos_middle { vertical-align: middle; }
.ipsPos_top { vertical-align: top; }

.ipsClear { clear: both; }
.ipsClearfix:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
}

/* Borders */
.ipsBorder { border: var(--border-1px) !important; }
.ipsBorder_top { border-top: var(--border-1px) !important; }
.ipsBorder_bottom { border-bottom: var(--border-1px) !important; }
.ipsBorder_left { border-left: var(--border-1px) !important; }
.ipsBorder_right { border-right: var(--border-1px) !important; }
.ipsBorder\:none { border: 0 !important; }

/* Visual Effects */
.ipsFaded { opacity: 0.4; }
.ipsFaded.ipsFaded_more { opacity: 0.25; }
.ipsFaded_withHover { transition: 0.2s all linear; }
.ipsFaded_withHover:hover { opacity: 1; }

/* Cursor Styles */
.ipsCursor_pointer { cursor: pointer !important; }
.ipsCursor_default { cursor: default; }
.ipsCursor_help { cursor: help !important; }
.ipsCursor_drag { cursor: move !important; }


/* ============================================
   10. RESPONSIVE DESIGN
   ============================================ */

/* Tablet (max-width: 979px) */
@media (max-width: 979px) {
    /* Responsive utilities */
    .md\:ipsHide { display: none; }
    .md\:ipsFlex { display: flex; }
    .md\:ipsPos_none { float: none; }
    .md\:ipsClear { clear: both; }
    
    /* Sidebar stays at 60px */
    #ipsLayout_sidebar {
        width: var(--sidebar--width-desktop) !important;
        min-width: var(--sidebar--width-desktop) !important;
        max-width: var(--sidebar--width-desktop) !important;
    }
    
    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: var(--sidebar--width-desktop) !important;
        width: calc(100% - var(--sidebar--width-desktop)) !important;
    }
    
    #ipsLayout_header {
        left: var(--sidebar--width-desktop) !important;
        width: calc(100vw - var(--sidebar--width-desktop)) !important;
    }
    
    #ipsLayout_header .ipsLayout_container,
    #ipsLayout_header header > .ipsLayout_container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    /* Responsive utilities */
    .sm\:ipsHide { display: none; }
    .sm\:ipsFlex { display: flex; }
    .sm\:ipsPos_none { float: none; }
    .sm\:ipsClear { clear: both; }
    
    /* Sidebar smaller on mobile */
    #ipsLayout_sidebar {
        display: block !important;
        width: var(--sidebar--width-mobile) !important;
        min-width: var(--sidebar--width-mobile) !important;
        max-width: var(--sidebar--width-mobile) !important;
        -webkit-overflow-scrolling: touch !important;
        transform: translate3d(0, 0, 0) !important;
        height: 100vh !important;
        height: 100dvh !important;
    }
    
    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: var(--sidebar--width-mobile) !important;
        width: calc(100% - var(--sidebar--width-mobile)) !important;
    }
    
    #ipsLayout_header {
        left: var(--sidebar--width-mobile) !important;
        width: calc(100vw - var(--sidebar--width-mobile)) !important;
        position: -webkit-sticky !important;
        position: sticky !important;
    }
    
    #ipsLayout_header .ipsLayout_container,
    #ipsLayout_header header > .ipsLayout_container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    #ipsLayout_header #elLogo img {
        padding-right: 10px !important;
    }
    
    /* Adjust spacing */
    .ipsLayout_container {
        padding: 0 10px;
    }
    
    /* Touch targets for sidebar */
    #ipsLayout_sidebar a,
    #ipsLayout_sidebar button {
        min-height: 44px !important;
        padding: 12px 0 !important;
    }
    
    #ipsLayout_sidebar a:active,
    #ipsLayout_sidebar button:active {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    /* iOS fixes */
    html {
        height: -webkit-fill-available !important;
    }
    
    body {
        min-height: 100vh !important;
        min-height: -webkit-fill-available !important;
    }
}

/* Very Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    #ipsLayout_sidebar {
        width: var(--sidebar--width-small) !important;
        min-width: var(--sidebar--width-small) !important;
        max-width: var(--sidebar--width-small) !important;
    }
    
    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: var(--sidebar--width-small) !important;
        width: calc(100% - var(--sidebar--width-small)) !important;
    }
    
    #ipsLayout_header {
        left: var(--sidebar--width-small) !important;
        width: calc(100vw - var(--sidebar--width-small)) !important;
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    #ipsLayout_sidebar {
        width: var(--sidebar--width-small) !important;
        min-width: var(--sidebar--width-small) !important;
        max-width: var(--sidebar--width-small) !important;
    }
    
    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: var(--sidebar--width-small) !important;
        width: calc(100% - var(--sidebar--width-small)) !important;
    }
    
    #ipsLayout_header {
        left: var(--sidebar--width-small) !important;
        width: calc(100vw - var(--sidebar--width-small)) !important;
    }
}

/* Print Styles */
@media print {
    .ipsPrint {
        margin-left: 50px;
        margin-right: 50px;
        -webkit-print-color-adjust: exact;
    }
    
    #ipsLayout_sidebar {
        display: none !important;
    }
    
    #ipsLayout_mainArea,
    #ipsLayout_contentArea {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    #ipsLayout_header {
        left: 0 !important;
        width: 100% !important;
        position: relative !important;
    }
}


/* ============================================
   END OF STYLESHEET
   
   OPTIONAL JAVASCRIPT FOR SCROLL EFFECT:
   
   window.addEventListener('scroll', function() {
       const header = document.getElementById('ipsLayout_header');
       if (header) {
           if (window.scrollY > 50) {
               header.classList.add('is-scrolled');
           } else {
               header.classList.remove('is-scrolled');
           }
       }
   });
   
   ============================================ */

/* ============================================
   SIDEBAR OVERLAY FIX
   ============================================
   This fixes the sidebar overlaying body content
   by adding proper left margins
   ============================================ */

/* ============================================
   FIX #1: PUSH BODY CONTENT OVER
   ============================================ */

/* Main body container - push right for sidebar */
#ipsLayout_body {
    margin-left: 60px !important;
    width: calc(100% - 60px) !important;
    padding-left: 20px !important;
}

/* ipsLayout_container inside body */
#ipsLayout_body.ipsLayout_container {
    margin-left: 60px !important;
    width: calc(100% - 60px) !important;
    max-width: none !important;
}

/* All containers need to respect sidebar */
.ipsLayout_container {
    margin-left: 0 !important;
    width: 100% !important;
}

