/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #0b0b0b;
    color: #fff;
    overflow: hidden;
}


/* =========================================================
   LAYOUT
   ========================================================= */

#main {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
}


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

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: 390px;
    min-width: 390px;
    max-width: 390px;

    background: #111;
    border-right: 1px solid #181818;

    z-index: 1000;
    overflow: hidden;

    transition:
        width 0.25s ease,
        min-width 0.25s ease,
        max-width 0.25s ease;
}


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

.sidebar-header {
    width: 308px;
    height: 86px;

    margin: 23px 0 0 23px;
    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #111;
    border: 1px solid #292929;
    border-radius: 10px;

    gap: 12px;
}


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

.sidebar-logo {
    flex: 1;

    background: transparent;
    border: none;

    color: #fff;

    font-size: 22px;
    font-weight: 500;
    letter-spacing: 8px;

    text-align: left;
    white-space: nowrap;

    cursor: pointer;
}


/* =========================================================
   HOME BUTTON
   ========================================================= */

.home-btn {
    flex-shrink: 0;

    width: 40px;
    height: 40px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;

    color: #fff;
    font-size: 27px;
    line-height: 1;

    cursor: pointer;

    transition:
        opacity 0.2s ease,
        background 0.15s ease;
}

.home-btn:hover {
    opacity: 0.7;
}


/* =========================================================
   SIDEBAR CLOSE / TOGGLE BUTTON
   ========================================================= */

.sidebar-close-btn {
    flex-shrink: 0;

    width: 40px;
    height: 40px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    border-radius: 8px;

    color: #b5b5b5;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-close-btn svg {
    width: 19px;
    height: 19px;

    display: block;
}


/* =========================================================
   HOME BUTTON — HIDE ON HOME PAGE
   ========================================================= */

body.home-page .home-btn {
    display: none !important;
}


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

#sidebar.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;

    border-right: none;
}


/* =========================================================
   COLLAPSED SIDEBAR HEADER
   ========================================================= */

#sidebar.collapsed .sidebar-header {
    position: fixed;

    top: 23px;
    left: 23px;

    width: 308px;
    height: 86px;

    margin: 0;

    padding: 0 18px;

    display: flex;

    background: #111;
    border: 1px solid #292929;
    border-radius: 10px;

    transform: translateX(0);
}


/* =========================================================
   KEEP AXION VISIBLE WHEN SIDEBAR IS COLLAPSED
   ========================================================= */

#sidebar.collapsed .sidebar-logo {
    display: flex;

    align-items: center;

    color: #fff;

    font-size: 22px;
    font-weight: 500;
    letter-spacing: 8px;

    white-space: nowrap;
}


/* =========================================================
   HIDE HOME BUTTON WHEN COLLAPSED
   ========================================================= */

#sidebar.collapsed .home-btn {
    display: none;
}


/* =========================================================
   SIDEBAR TOGGLE WHEN COLLAPSED
   ========================================================= */

#sidebar.collapsed .sidebar-close-btn {
    display: flex;
}

/* =========================================================
   NEW DEBATE
   ========================================================= */

.new-debate-btn {
    width: calc(100% - 50px);

    margin: 12px 25px;

    padding: 18px;

    background: #181818;

    border: 1px solid #292929;
    border-radius: 10px;

    color: #fff;

    font-size: 16px;
    text-align: left;

    cursor: pointer;
}

.new-debate-btn:hover {
    background: #202020;
}


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

/*
   IMPORTANT:
   The sidebar itself stays 390px wide.
   Only its contents are hidden.

   This makes the collapsed home sidebar behave
   exactly like the collapsed debate sidebar.
*/

#sidebar.collapsed .new-debate-btn,
#sidebar.collapsed .history-section {
    display: none;
}


/* =========================================================
   HOME PAGE SIDEBAR
   ========================================================= */

body.home-page #sidebar {
    width: 390px;
    min-width: 390px;
    max-width: 390px;

    height: 100vh;

    background: #111;
    border-right: 1px solid #181818;
}


/* =========================================================
   HOME PAGE HEADER
   ========================================================= */

body.home-page .sidebar-header {
    width: 308px;
    height: 86px;

    margin: 23px 0 0 23px;
}


/* =========================================================
   HOME PAGE MAIN
   ========================================================= */

body.home-page .main-content {
    margin-left: 0;

    min-height: 100vh;

    box-sizing: border-box;
}
/* =========================================================
   HISTORY
   ========================================================= */

.history-section {
    padding: 28px 25px;
}


.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;

    color: #888;

    font-size: 13px;
    letter-spacing: 3px;
}


.delete-history-btn {
    background: transparent;
    border: none;

    color: red;

    font-size: 17px;

    cursor: pointer;
}


#historyList {
    display: flex;
    flex-direction: column;

    gap: 4px;
}


.history-item {
    width: 100%;

    padding: 12px 6px;

    background: transparent;
    border: none;

    color: #ddd;

    text-align: left;

    font-size: 15px;

    cursor: pointer;

    border-radius: 6px;
}


.history-item:hover {
    background: #1b1b1b;
}


.empty-history {
    color: #555;

    font-size: 14px;
}


/* =========================================================
   HOME
   ========================================================= */

.home {
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    padding: 40px;
}


.logo {
    font-size: 72px;
    letter-spacing: 12px;

    margin-bottom: 10px;
}


.tagline {
    color: #999;

    font-size: 18px;

    margin-bottom: 50px;
}


.topic-box {
    width: min(700px, 90%);
}


#topicInput {
    width: 100%;

    padding: 18px 20px;

    background: #151515;

    color: #fff;

    border: 1px solid #333;
    border-radius: 10px;

    font-size: 17px;

    outline: none;
}


#topicInput:focus {
    border-color: #777;
}


.modes {
    display: flex;

    gap: 15px;

    margin-top: 25px;
}


.modes button {
    padding: 15px 30px;

    background: #fff;

    color: #000;

    border: none;
    border-radius: 8px;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;

    transition: 0.2s;
}


.modes button:hover {
    transform: translateY(-2px);

    opacity: 0.85;
}


#status {
    margin-top: 25px;

    color: #888;
}


/* =========================================================
   HOME SETTINGS BUTTON
   ========================================================= */

.home-settings-btn {
    position: absolute;

    top: 28px;
    right: 30px;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #181818;

    border: 1px solid #333;
    border-radius: 9px;

    color: #ddd;

    font-size: 21px;

    cursor: pointer;

    z-index: 50;
}


.home-settings-btn:hover {
    background: #222;
}


/* =========================================================
   SETTINGS OVERLAY
   ========================================================= */

.settings-overlay {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    z-index: 2000;

    display: none;
}


.settings-overlay.open {
    display: block;
}


.settings-panel {
    position: absolute;

    top: 0;
    right: 0;
    bottom: 0;

    width: 430px;

    padding: 28px 24px;

    background: #111;

    border-left: 1px solid #292929;

    overflow-y: auto;
}


.settings-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 25px;
}


.settings-header h2 {
    font-size: 22px;
}


.settings-header button {
    width: 38px;
    height: 38px;

    background: transparent;

    border: none;

    color: #aaa;

    font-size: 28px;

    cursor: pointer;
}


/* =========================================================
   SETTINGS DROPDOWNS
   ========================================================= */

.settings-dropdown {
    width: 100%;

    margin-bottom: 10px;
}


.settings-dropdown-btn {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;

    padding: 0 14px;

    background: #181818;

    border: 1px solid #292929;
    border-radius: 10px;

    color: #ddd;

    font-size: 14px;

    text-align: left;

    cursor: pointer;
}


.settings-dropdown-btn:hover {
    background: #222;

    color: #fff;
}


.settings-dropdown-content {
    display: none;

    margin-top: 6px;

    padding: 4px;

    background: #151515;

    border: 1px solid #292929;
    border-radius: 10px;
}


.settings-dropdown-content.open {
    display: block;
}


.setting-option {
    width: 100%;

    min-height: 40px;

    padding: 0 10px;

    background: transparent;

    border: none;
    border-radius: 7px;

    color: #ccc;

    font-size: 14px;

    text-align: left;

    cursor: pointer;
}


.setting-option:hover {
    background: #222;

    color: #fff;
}


/* =========================================================
   SETTINGS ACTION BUTTONS
   ========================================================= */

.settings-action-btn {
    width: 100%;

    min-height: 46px;

    margin-top: 10px;

    padding: 0 14px;

    background: #181818;

    border: 1px solid #292929;
    border-radius: 10px;

    color: #ddd;

    font-size: 14px;

    text-align: left;

    cursor: pointer;
}


.settings-action-btn:hover {
    background: #222;

    color: #fff;
}

/* =========================================================
   COLLAPSED SIDEBAR — HOME PAGE
   Same appearance as the debate page
   ========================================================= */

/* Sidebar becomes the same width as the debate layout */
body.home-page #sidebar.collapsed {
    width: 390px;
    min-width: 390px;
    max-width: 390px;
}

/* Keep the main content starting after the sidebar */
body.home-page #main {
    left: 390px;
}

/* Hide everything except the top AXION bar */
body.home-page #sidebar.collapsed .new-debate-btn,
body.home-page #sidebar.collapsed .history-section {
    display: none !important;
}

/* Keep the top bar looking like the debate page */
body.home-page #sidebar.collapsed .sidebar-header {
    width: 308px;
    height: 86px;

    margin: 23px 0 0 23px;
    padding: 0 18px;

    background: #111;
    border: 1px solid #292929;
    border-radius: 10px;

    box-sizing: border-box;
}

/* AXION */
body.home-page #sidebar.collapsed .sidebar-logo {
    font-size: 22px;
    letter-spacing: 8px;
}

/* No home button on the home page */
body.home-page #sidebar.collapsed .home-btn {
    display: none !important;
}

/* Hamburger */
body.home-page #sidebar.collapsed .collapse-btn,
body.home-page #sidebar.collapsed .sidebar-toggle {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;
}

/* =========================================================
   COLLAPSED SIDEBAR — HOME PAGE
   ========================================================= */

#sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;

    background: transparent !important;
    border: none !important;

    overflow: visible !important;
}


/* Main page uses the entire screen */

#sidebar.collapsed ~ #main {
    left: 0 !important;
}


/* =========================================================
   COLLAPSED AXION BOX
   ========================================================= */

#sidebar.collapsed .sidebar-header {
    position: fixed;
    top: 12px;
    left: 12px;

    width: 36px;
    height: 36px;

    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: 0;
    border-radius: 8px;

    z-index: 9999;
}


/* AXION */

#sidebar.collapsed .sidebar-logo {
    display: none;
}


/* Hide home button */

#sidebar.collapsed .home-btn {
    display: none !important;
}


/* MENU */

#sidebar.collapsed .sidebar-close-btn {
    display: inline-flex;
}


/* Hide everything else */

#sidebar.collapsed .new-debate-btn,
#sidebar.collapsed .history-section {
    display: none !important;
}

/* =========================================================
   SIDEBAR SPLIT-PANEL TOGGLE
   ========================================================= */

.sidebar-close-btn {
    flex-shrink: 0;

    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 8px;

    color: #a7a7a7;
    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        transform 0.12s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-close-btn:active {
    transform: scale(0.96);
}

.sidebar-close-btn svg {
    width: 19px;
    height: 19px;
    display: block;
}

#sidebar.collapsed .sidebar-close-btn {
    display: inline-flex;
}

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

#sidebar.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;

    border-right: none;

    /*
       IMPORTANT:
       Keep overflow visible so the floating
       AXION header can still be seen.
    */
    overflow: visible;
}


/* =========================================================
   FLOATING HEADER WHEN SIDEBAR IS CLOSED
   ========================================================= */

#sidebar.collapsed .sidebar-header {
    position: fixed;

    top: 1px;
    left: 0px;

    width: 308px;
    height: 86px;

    margin: 0;
    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #111;
    border: 1px solid #292929;
    border-radius: 10px;

    box-sizing: border-box;

    z-index: 9999;

    transform: none;
}


/* =========================================================
   AXION MUST STAY VISIBLE
   ========================================================= */

#sidebar.collapsed .sidebar-logo {
    display: flex !important;

    flex: 1;

    align-items: center;

    background: transparent;
    border: none;

    color: #fff;

    font-size: 22px;
    font-weight: 500;

    letter-spacing: 8px;

    text-align: left;
    white-space: nowrap;

    visibility: visible;
    opacity: 1;
}


/* =========================================================
   HOME BUTTON
   ========================================================= */

#sidebar.collapsed .home-btn {
    display: none !important;
}


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

#sidebar.collapsed .sidebar-close-btn {
    display: flex !important;

    flex-shrink: 0;

    width: 40px;
    height: 40px;
}


/* =========================================================
   CLEAN SETTINGS / THEME / ABOUT SYSTEM
========================================================= */
:root{--axion-bg:#0b0b0b;--axion-surface:#111;--axion-surface2:#181818;--axion-border:#292929;--axion-text:#fff;--axion-muted:#888;--axion-input:#151515;--axion-hover:#222;--axion-overlay:rgba(0,0,0,.48);--axion-custom-bg:#1a1a1a;--axion-custom-text:#fff}
body[data-resolved-theme="dark"]{--axion-bg:#0b0b0b;--axion-surface:#111;--axion-surface2:#181818;--axion-border:#292929;--axion-text:#fff;--axion-muted:#888;--axion-input:#151515;--axion-hover:#222;--axion-overlay:rgba(0,0,0,.48)}
body[data-resolved-theme="light"]{--axion-bg:#f5f5f5;--axion-surface:#fff;--axion-surface2:#f0f0f0;--axion-border:#d8d8d8;--axion-text:#111;--axion-muted:#666;--axion-input:#fff;--axion-hover:#e8e8e8;--axion-overlay:rgba(0,0,0,.22)}
body[data-resolved-theme="custom"]{--axion-bg:var(--axion-custom-bg);--axion-surface:color-mix(in srgb,var(--axion-custom-bg),#fff 6%);--axion-surface2:color-mix(in srgb,var(--axion-custom-bg),#fff 10%);--axion-border:color-mix(in srgb,var(--axion-custom-text),transparent 75%);--axion-text:var(--axion-custom-text);--axion-muted:color-mix(in srgb,var(--axion-custom-text),transparent 35%);--axion-input:color-mix(in srgb,var(--axion-custom-bg),#fff 5%);--axion-hover:color-mix(in srgb,var(--axion-custom-bg),#fff 12%)}
body{background:var(--axion-bg)!important;color:var(--axion-text)!important}
#main{background:var(--axion-bg)!important;color:var(--axion-text)!important}
#sidebar{background:var(--axion-surface)!important;border-color:var(--axion-border)!important;color:var(--axion-text)!important}
.sidebar-header{background:var(--axion-surface)!important;border-color:var(--axion-border)!important}
.sidebar-logo,.home-btn,.sidebar-close-btn{color:var(--axion-text)!important}
.new-debate-btn{background:var(--axion-surface2)!important;border-color:var(--axion-border)!important;color:var(--axion-text)!important}
.new-debate-btn:hover{background:var(--axion-hover)!important}
.history-header{color:var(--axion-muted)!important}.history-item{color:var(--axion-text)!important}.empty-history{color:var(--axion-muted)!important}
.home-settings-btn{background:var(--axion-surface2)!important;border-color:var(--axion-border)!important;color:var(--axion-text)!important}
.home-settings-btn:hover{background:var(--axion-hover)!important}
.logo{color:var(--axion-text)!important}.tagline,#status{color:var(--axion-muted)!important}
#topicInput{background:var(--axion-input)!important;color:var(--axion-text)!important;border-color:var(--axion-border)!important}
#topicInput::placeholder{color:var(--axion-muted)!important}
.settings-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:var(--axion-overlay);opacity:0;visibility:hidden;pointer-events:none;z-index:5000;transition:.2s}
.settings-overlay.open{opacity:1;visibility:visible;pointer-events:auto}
.settings-panel{width:520px;max-width:calc(100vw - 40px);max-height:calc(100vh - 40px);overflow-y:auto;padding:22px;background:var(--axion-surface)!important;border:1px solid var(--axion-border)!important;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.4);color:var(--axion-text)!important}
.settings-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.settings-header h2{color:var(--axion-text)!important}.settings-header button{color:var(--axion-muted)!important;background:transparent;border:0;font-size:28px;cursor:pointer}
.settings-dropdown{width:100%;margin-bottom:10px}.settings-dropdown-btn{width:100%;min-height:46px;display:flex;align-items:center;padding:0 14px;background:var(--axion-surface2)!important;border:1px solid var(--axion-border)!important;border-radius:10px;color:var(--axion-text)!important;font-size:14px;text-align:left;cursor:pointer}.settings-dropdown-btn:hover{background:var(--axion-hover)!important}
.settings-dropdown-content{display:none;margin-top:6px;padding:4px;background:var(--axion-input)!important;border:1px solid var(--axion-border)!important;border-radius:10px}.settings-dropdown-content.open{display:block!important}.setting-option{width:100%;min-height:40px;padding:0 10px;background:transparent!important;border:0;border-radius:7px;color:var(--axion-text)!important;text-align:left;cursor:pointer}.setting-option:hover{background:var(--axion-hover)!important}.theme-option.selected,.axion-language-option.selected{font-weight:700;background:var(--axion-hover)!important}
.language-list{max-height:320px;overflow-y:auto}.custom-theme-controls{padding:12px 8px;border-top:1px solid var(--axion-border);margin-top:4px;color:var(--axion-muted)}.custom-theme-controls label{display:block;font-size:12px;margin-bottom:8px}.custom-theme-controls input{width:100%;height:38px;border:1px solid var(--axion-border);background:var(--axion-input);border-radius:8px}.custom-theme-controls button{margin-top:8px;width:100%;height:38px;border:1px solid var(--axion-border);border-radius:8px;background:var(--axion-surface2);color:var(--axion-text);cursor:pointer}.settings-action-btn{width:100%;min-height:46px;margin-top:10px;background:var(--axion-surface2)!important;border:1px solid var(--axion-border)!important;border-radius:10px;color:var(--axion-text)!important;text-align:left;padding:0 14px;cursor:pointer}.settings-action-btn:hover{background:var(--axion-hover)!important}
.about-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.55);backdrop-filter:blur(8px);opacity:0;visibility:hidden;pointer-events:none;z-index:6000;transition:.2s}.about-overlay.open{opacity:1;visibility:visible;pointer-events:auto}.about-modal{position:relative;width:520px;max-width:100%;max-height:80vh;overflow:auto;padding:34px;background:var(--axion-surface)!important;color:var(--axion-text)!important;border:1px solid var(--axion-border)!important;border-radius:18px;box-shadow:0 25px 80px rgba(0,0,0,.45)}.about-modal h2{margin-bottom:8px}.about-modal p{color:var(--axion-muted);line-height:1.65;margin-top:12px}.about-modal .about-subtitle{margin-top:0}.about-close{position:absolute;top:12px;right:12px;width:36px;height:36px;background:transparent;border:0;border-radius:8px;color:var(--axion-muted);font-size:28px;cursor:pointer}.about-close:hover{background:var(--axion-hover);color:var(--axion-text)}
.modes button{background:var(--axion-surface2)!important;color:var(--axion-text)!important;border-color:var(--axion-border)!important}
body[data-resolved-theme="light"] .modes button{background:#111!important;color:#fff!important}


/* =========================================================
   EXPORT DEBATE MENU
========================================================= */
.export-section{position:relative;width:100%;margin-top:10px}
.export-menu{margin-top:6px;padding:5px;background:var(--axion-input);border:1px solid var(--axion-border);border-radius:12px;overflow:hidden}
.export-menu[hidden]{display:none!important}
.export-option{width:100%;display:flex;flex-direction:column;gap:3px;padding:11px 12px;background:transparent;border:0;border-radius:8px;color:var(--axion-text);text-align:left;cursor:pointer;font:inherit}
.export-option:hover{background:var(--axion-hover)}
.export-option span{font-size:11px;color:var(--axion-muted)}
@media print{
  body>*:not(#axionPrintDocument){display:none!important}
  #axionPrintDocument{display:block!important;color:#111!important;background:#fff!important}
}
#axionPrintDocument{display:none}
