@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --color1: #0f172a; /* Slate 900 */
    --color2: #1e293b; /* Slate 800 */
    --color3: #334155; /* Slate 700 */
    --color4: #475569; /* Slate 600 */
    --color5: #f1f5f9; /* Slate 100 */
    --color6: #ffffff;
    --select-color1: #3b82f6; /* Modern Blue */
    --select-color2: #ffffff;
}

* {
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

/* Dark Mode Variable Overrides */
body.dark-mode {
    --color1: #f1f5f9; /* Slate 100 */
    --color2: #334155; /* Slate 700 */
    --color3: #94a3b8; /* Slate 400 */
    --color4: #cbd5e1; /* Slate 300 */
    --color5: #1e293b; /* Slate 800 */
    /* --color6 is intentionally left unchanged here: it's used as the
       text color on top of the blue accent (--select-color1), which stays
       the same blue in both themes, so the text needs to stay white too. */
    background-color: #090d16 !important;
}

body.dark-mode .mcContainerStyle {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .mcTextboxStyle,
body.dark-mode .mcTextviewStyle {
    background-color: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

body.dark-mode .mcCheckboxStyle {
    background-color: #0f172a;
    border-color: #334155;
}

body.dark-mode .alertOverlay {
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
}

.dev-hidden {
    display: none !important;
}

.flexContainer {
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
}
.flexRowContainer {
    display: flex;
    flex-flow: row;
    justify-content: center;
    align-items: center;
}
.flexSpacer {
    flex-grow: 1;
}
.flexDivider {
    height: 10px;
    width: 10px;
}
.fullWidth {
    width: 100%;
}
.textAlignLeft {
    text-align: left;
}

.mcTextStyle1 {
    color: var(--color3);
}
.mcTextStyle2 {
    color: var(--color6);
}

/* Modern Button Style */
.mcButtonStyle {
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    height: 42px;
    background: var(--select-color1);
    border: none;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
    min-width: max-content;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.mcButtonStyle:hover {
    background: #2563eb;
}
.mcButtonStyle:active {
    transform: scale(0.98);
}
.mcButtonStyle .mcButtonStyleInner {
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    height: 100%;
    padding: 0 16px;
    color: var(--color6);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modern Icon Button Style */
.mcIconButtonStyle {
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    height: fit-content;
    background: var(--color2);
    border: 1px solid var(--color3);
    border-radius: 8px;
    transition: background 0.2s ease;
    min-width: max-content;
}
.mcIconButtonStyle:hover {
    background: var(--color3);
}
.mcIconButtonStyle .mcIconButtonStyleInner {
    cursor: pointer;
    border: none;
    background: none;
    width: fit-content;
    height: 100%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mcIconButtonStyle .mcIconButtonStyleInner img {
    width: 20px;
    height: 20px;
}

/* Modern Textbox Style */
.mcTextboxStyle {
    cursor: text;
    overflow: hidden;
    white-space: nowrap;
    user-select: auto;
    height: 42px;
    color: var(--color1);
    background: var(--color6);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mcTextboxStyle:hover {
    border-color: var(--select-color1);
}
.mcTextboxStyle:focus {
    outline: none;
    border-color: var(--select-color1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Modern Textview Style */
.mcTextviewStyle {
    cursor: text;
    user-select: auto;
    height: 150px;
    width: calc(100% - 20px);
    color: var(--color1);
    background: var(--color6);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    overflow-x: scroll;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
}

/* Modern Checkbox Style */
.mcCheckboxStyle {
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
    height: 24px;
    width: 24px;
    background: var(--color6);
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.mcCheckboxStyle input:checked + .mcCheckboxStyleInner {
    background-color: var(--select-color1);
    opacity: 1;
}
.mcCheckboxStyle:hover {
    border-color: var(--select-color1);
}
.mcCheckboxStyle .mcCheckboxStyleInner {
    height: 12px;
    width: 12px;
    border-radius: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}
.mcCheckboxStyle input {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    cursor: pointer;
}

/* Clean Container Style (Replaces Minecraft cutout borders) */
.mcContainerStyle {
    background-color: var(--color6);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.mcDirtBackground {
    background-color: #f8fafc !important;
    background-image: none !important;
}

body.dark-mode .mcDirtBackground {
    background-color: #090d16 !important;
}

footer {
    padding: 16px;
}
footer, .footerLink {
    gap: 12px;
}
.footerLink {
    color: var(--color4);
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.2s ease;
}
.footerLink:hover {
    color: var(--select-color1);
}
.footerLinkImg, .footerLinkSvg {
    width: 20px;
}

/* Styling for the Dark mode button in the footer */
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

main {
    height: 100%;
    flex: 1 1 auto;
}
.mainContainer {
    width: min(700px, calc(95vw - 10px));
}

.micActivityIndicator.active {
    filter: brightness(1);
    background-color: #22c55e;
}
.micActivityIndicator {
    width: 24px;
    height: 24px;
    padding: 8px;
    border-radius: 50%;
    cursor: default;
    background-color: var(--color4);
    transition: background-color 0.2s ease;
}

.whiteFilter {
    filter: brightness(0) saturate(100%) invert(100%);
}

body.dark-mode .footerLinkImg:not(.whiteFilter) {
    filter: brightness(0) saturate(100%) invert(100%);
}

.statusLabel.disconnected {
    color: #ef4444;
}
.statusLabel.connected {
    color: #22c55e;
}

.joinSec {
    text-align: center;
    padding: 16px;
}
.joinForm {
    color: var(--color1);
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    margin: 10px;
    gap: 12px;
}
.joinFormLabel {
    text-align: left;
    padding: 5px;
    display: flex;
    align-items: center;
    font-weight: 500;
}
.usernameInput, .passwordInput {
    width: 230px;
}
.micSelect, .speakerSelect {
    width: 270px;
}

.connectedSec {
    padding: 0 16px 16px 16px;
}
.pttBindBtnContainer {
    width: 100%;
}

body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    background-color: #f8fafc;
    color: var(--color1);
}
body.connected .hiddenWhenConnected, body:not(.connected) .connectedSec, body:not(.connected) .statusLabel {
    display: none;
}
body.connected .joinBtnContainer {
    width: fit-content;
}
body.connected .joinSec {
    padding: 16px 16px 0 16px;
}

.floatingWidgetsOverlay {
    position: fixed;
    bottom: 24px;
    width: calc(100% - 20px);
    /* This bar spans nearly the full page width, but only the icon button
       and language selector inside it should actually be clickable -- the
       empty space between/around them should let clicks fall through to
       whatever is underneath (e.g. the footer), instead of swallowing them. */
    pointer-events: none;
}
.floatingWidgetsOverlay .mcIconButtonStyle,
.floatingWidgetsOverlay .languageSelectorContainer {
    pointer-events: auto;
}

.alertOverlay {
    position: fixed;
    top: 0;
    z-index: 67;
    background-color: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
}
.alertOverlayInner {
    margin: 0 20px;
}

@media (max-width: 600px) {
    body {
        display: block;
        height: auto;
        width: auto;
        margin-top: 15px;
    }

    .flexSpacerWhenMobile {
        flex-grow: 1;
    }
    .fullWidthWhenMobile {
        width: 100%;
    }
    .flexColumnWhenMobile {
        flex-flow: column;
    }

    .usernameInput, .passwordInput {
        width: calc(100% - 22px);
    }
    .micSelect, .speakerSelect, .pttClearBtnContainer {
        width: 100%;
    }

    .micContainer {
        width: 100%;
    }

    .footerLinkText {
        display: none;
    }

    .floatingWidgetsOverlay {
        position: initial;
        bottom: auto;
    }
}

/* ptt Overlay */
body.fullscreen-ptt-active {
    overflow: hidden;
}

.pttFullscreenSec {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}

.pttFullscreenSec.visible {
    display: flex;
}

.pttFullscreenBtn {
    width: min(82vw, 540px) !important;
    height: min(58vh, 540px) !important;
    border-radius: 24px !important;
}
.pttFullscreenBtn .mcButtonStyleInner {
    font-size: clamp(24px, 5vw, 42px) !important;
}
