@font-face {
    font-family: "MSDOS";
    src: url("/assets/ModernDOS8x16.ttf") format("truetype");
}

@font-face {
    font-family: "MS95";
    src: url("/assets/W95font.otf") format("truetype");
}

@font-face {
    font-family: "MS95B";
    src: url("/assets/W95font-Bold.otf") format("truetype");
}

*,*::before,*::after {
    position: relative;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    width: 20px;
}

.title-bar-icon {
    display: flex;
    align-items: center;
}

html, body {
    font-family: 'MSDOS', monospace;
    background: #1b9181;
    color: white;
    height: 100vh;
    overflow-x: hidden;
}

/* CMD WINDOW */
.cmd-window {
    background: #000000;
    border: 3px solid #cecece;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: fixed;
    z-index: 100;
    top: 0;
    cursor: default;
    resize: both;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.title-bar {
    background: #0a0092;
    color: white;
    padding: 4px 8px;
    border-bottom: 3px solid #cecece;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.title-bar-controls {
    display: flex;
    gap: 6px;
}

/* BUTTON */
.control-btn {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.control-btn {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px outset;
    border-color: #dfdfdf #6b6b6b #6b6b6b #dfdfdf;
    background: #c0c0c0;
    color: black;
    font-weight: bold;
    font-family: "MSDOS";
}

.control-btn:active {
    border: 2px inset;
}

.control-btn:hover {
    background: #d4d4d4;
}

.start-btn,
#send,
#admin-send {
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px outset;
    border-color: #dfdfdf #b1b1b1 #b1b1b1 #dfdfdf;
    background: #c0c0c0;
    color: black;
    font-weight: 700;
    font-family: "MSDOS";
    gap: 3px;
}

#cleanup-btn {
    display: none;
}

#guest-login,
#overlay-set-username,
#admin-login-btn {
    width: 200px;
    display: flex;
    justify-content: center;
    cursor: pointer;
    border: 3px outset;
    border-color: #dfdfdf #b1b1b1 #b1b1b1 #dfdfdf;
    font-family: "MS95B";
    padding: 7px;
}

.start-btn:active {
    border: 2px inset;
    border-color: #dfdfdf #b1b1b1 #b1b1b1 #dfdfdf;
}

.start-btn:hover {
    background: #d4d4d4;
}

.taskbar-item {
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px inset;
    border-color: #b1b1b1 #e9e9e9 #e9e9e9 #b1b1b1;
    background: #d8d8d8;
    color: black;
    font-weight: bold;
    font-family: "MSDOS";
    gap: 3px;
    padding-right: 100px;
    padding-bottom: 2px;
    padding-top: 2px;
    margin-left: 2px;
}


.cmd-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: calc(100% - 30px);
    overflow: auto;
    padding: 15px;
}

.cmd-line {
    display: flex;
    align-items: center;
}

.input-line {
    display: flex;
    align-items: center;
}

.hidden {
    display: none;
}

#usernameInput {
    font-family: 'MSDOS';
    font-size: medium;
    text-decoration: none;
    color: white;
    background: transparent;
    border: none;
    width: 300px;
    outline: none;
    caret-color: #ffffff;
}

#passwordInput {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'MSDOS', monospace;
    color: #000000;
    caret-color: transparent;
}

pre {
    font-family: 'MSDOS', monospace;
    color: #ffffff;
    overflow: auto;
}

.bottomBar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 3px solid #f1f1f1;
    background-color: #c0c0c0;
    height: 35px;
    padding: 3px;
    z-index: 5;
}

#taskbarButtons {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-wrap: nowrap;
}

.start-icon {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.time {
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px inset;
    border-color: #f3f3f3 #eeeeee #e9e9e9 #e4e4e4;
    background: #c0c0c0;
    color: black;
    font-weight: 200;
    font-family: "MSDOS";
    gap: 2px;
    padding: 2px 10px;
    margin-left: 2px;
    flex-shrink: 0;
}

/* DESKTOP ICON */
.desktop {
    display: flex;
    flex-direction: column;
    position: fixed;
    padding: 20px;
    pointer-events: none;
    z-index: 1;
}

.desktop-icon {
    text-align: center;
    cursor: pointer;
    pointer-events: auto;
    border: 1px dotted transparent;
    user-select: none;
    margin-bottom: 15px;
}

.desktop-icon span {
    font-family: "MS95";
    font-weight: 100 !important;
    font-size: 15px;
}

.desktop-icon.selected {
    background: rgba(0, 0, 255, 0.5);
    border: 1px dotted blue;
}

.icon-image img {
    width: 50px;
}

/* NOTE PAD WINDOW STYLE */
.notepad-window,
.chat-window {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    height: 400px;
    background: #ffffff;
    border: 3px solid #c0c0c0;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    resize: both;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notepad-window:not(.hidden),
.chat-window:not(.hidden) {
    display: block;
}

.notepad-content,
.chat-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: calc(100% - 30px);
    overflow: hidden;
    position: relative;
}

.menu-bar {
    display: flex;
    background: #cecece;
    border-bottom: 1px solid #c0c0c0;
    padding: 2px 0;
    font-size: 15px;
    font-weight: 100;
    font-family: "MS95";
}

.menu-item {
    padding: 4px 12px;
    cursor: pointer;
    color: #000000;
}

.menu-item:hover {
    background: #000080;
    color: white;
}

.notepad-textarea {
    flex: 1;
    border: 2px inset;
    border-color: #4d4d4d #eeeeee #e9e9e9 #a3a3a3;
    outline: none;
    resize: none;
    padding: 8px;
    line-height: 1.4;
    background: #ffffff;
    color: #000000;
    overflow-x: hidden;
    overflow-y: auto;
}

.chat-box,
.admin-chat-box {
    flex: 1;
    border: 2px inset;
    border-color: #4d4d4d #eeeeee #e9e9e9 #a3a3a3;
    outline: none;
    resize: none;
    padding: 8px;
    line-height: 1.4;
    background: #ffffff;
    color: #000000;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 200px; /* Add minimum height */
    height: calc(100% - 20px); /* Calculate height minus input area */

    /* Background image from assets */
    background-image: url("./assets/meoow.png");
    background-repeat: no-repeat;
    background-size: 200px; /* Custom size */
    background-position: bottom right -20px; /* 10px from bottom and left */
}

#input-area,
#admin-input-area {
    display: flex;
    justify-content: space-between;
    height: 90px; /* Fixed height for input area */
    background-color: #a3a3a3;
    padding: 5px;
    gap: 5px;
    flex-shrink: 0; /* Prevent shrinking */
}

#message,
#admin-message {
    font-family: "MS95";
    width: 100%;
    padding: 5px;
    resize: none;
    height: 80px;
}

#send,
#admin-send {
    width: 100px;
    height: 80px;
    flex-shrink: 0;
}

#send:active,
#overlay-set-username:active,
#guest-login:active
#admin-send:active {
    border: 3px inset;
}

/* ===== CHAT OVERLAY ===== */

.admin-login {
    color: #000000;
    display: flex;
    height: fit-content;
    flex-direction: column;
    justify-content:space-around;
    text-align: center;
    align-items: center;
    padding: 20px;
    gap: 10px;
}

.guest {
    color: #000000;
    display: flex;
    height: 300px;
    flex-direction: column;
    justify-content:space-around;
    text-align: center;
    align-items: center;
    padding: 20px;
    gap: 10px;
}

.admin-message {
    color: #04003f;
}

.admin-sidebar {
    width: 100%;
    background: #d0d0d0;
    padding: 10px;
    text-align: center;
    overflow-y: auto;
    height: 100px;
}

.admin-sidebar h4 {
    color: #000000;
    font-family: "MS95";
}


.visitor-item {
    padding: 8px;
    margin: 5px 0;
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
    cursor: pointer;
    font-family: "MS95";
    color: #000000;
}

.visitor-item:hover {
    background: #d4d4d4;
}

.visitor-item.active {
    background: #000080;
    color: white;
    border: 2px inset #dfdfdf;
}

.admin-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.active-chat-header {
    background: #000080;
    color: white;
    padding: 8px;
    font-family: "MS95B";
    border-bottom: 3px solid #a3a3a3;
}

#chat-interface,
#admin-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#chat-interface.hidden,
#admin-interface.hidden {
    display: none !important;
}

#chat-interface:not(.hidden),
#admin-interface:not(.hidden) {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.overlay-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.input-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: space-between;
}

.input-row label {
    color: #000000;
    font-family: "MS95";
    min-width: 80px;
}

#overlay-username-input,
#overlay-password-input,
#admin-email,
#admin-password {
    padding: 5px;
    font-family: "MS95";
    width: 200px;
}


/* SCROLL BAR */
::-webkit-scrollbar {
    width: 20px;
    height: 20px;
}

/* Top (up) button */
::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg width='16' height='14' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'><polygon points='5,2 2,6 8,6' fill='black'/></svg>");
    border: 2px outset;
    border-color: #dfdfdf #b1b1b1 #363636 #dfdfdf;
    height: 20px;
    width: 20px;
    background-color: #cecece;
}

/* Bottom (down) button */
::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,<svg width='16' height='14' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'><polygon points='2,4 8,4 5,8' fill='black'/></svg>");
    display: block;
    border: 2px outset;
    border-color: #dfdfdf #b1b1b1 #363636 #dfdfdf;
    height: 20px;
    width: 20px;
    background-color: #cecece;
}

/* Left (scroll backward) button */
::-webkit-scrollbar-button:single-button:horizontal:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg width='16' height='14' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'><polygon points='6,2 2,5 6,8' fill='black'/></svg>");
    border: 2px outset;
    display: block;
    border-color: #dfdfdf #b1b1b1 #363636 #dfdfdf;
    height: 20px;
    width: 20px;
    background-color: #cecece;
}

/* Right (scroll forward) button */
::-webkit-scrollbar-button:single-button:horizontal:increment {
    background-image: url("data:image/svg+xml;utf8,<svg width='16' height='14' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'><polygon points='4,2 8,5 4,8' fill='black'/></svg>");
    border: 2px outset;
    display: block;
    border-color: #dfdfdf #b1b1b1 #363636 #dfdfdf;
    height: 20px;
    width: 20px;
    background-color: #cecece;
}

/* Hide horizontal scrollbar buttons */
::-webkit-scrollbar-button:single-button:horizontal {
    display: none;
}

::-webkit-scrollbar-corner {
    background-color: rgb(195, 199, 203);
}

::-webkit-scrollbar-thumb {
    height: 50%;
    box-sizing: border-box;
    background: rgb(195, 199, 203);
    box-shadow:
        inset -1px -1px 0 0 rgb(0, 0, 0),
        inset 1px 1px 0 0 rgb(210, 210, 210),
        inset -2px -2px 0 0 rgb(134, 138, 142),
        inset 2px 2px 0 0 rgb(255, 255, 255);
    border: none;
    display: inline-block;
}

::-webkit-scrollbar-track {
    background-color: rgb(255, 255, 255);
    background-image:
      linear-gradient(45deg, rgb(195, 199, 203) 25%, transparent 25%, transparent 75%, rgb(195, 199, 203) 75%),
      linear-gradient(45deg, rgb(195, 199, 203) 25%, transparent 25%, transparent 75%, rgb(195, 199, 203) 75%);
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;
}


/* Bring window to front when active */
.notepad-window.active {
    z-index: 1001;
}

/* Window States */
.cmd-window.maximized,
.notepad-window.maximized,
.chat-window.maximized {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 35px !important;
    width: auto !important;
    height: auto !important;
}

.cmd-window.minimized,
.notepad-window.minimized,
.chat-window.minimized {
    display: none !important;
}

.cmd-window.restored,
.notepad-window.restored,
.chat-window.restored {
    max-width: 90vw;
    max-height: 80vh;
}

/* Hidden state */
.cmd-window.hidden,
.notepad-window.hidden,
.chat-window.hidden {
    display: none !important;
}

/* Taskbar Button States */
.taskbar-button.active {
    font-family: "MS95B";
    border: 3px inset !important;
    border-color: #b1b1b1 #e9e9e9 #e9e9e9 #b1b1b1 !important;
    background: #d8d8d8 !important;
}

/* Taskbar button sizing */
.taskbar-button {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content:left;
    border: 3px outset;
    border-color: #dfdfdf #b1b1b1 #b1b1b1 #dfdfdf;
    background: #c0c0c0;
    color: black;
    font-family: "MS95";
    gap: 3px;
    padding-top: 2px;
    padding-bottom: 2px;
    margin-left: 2px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}


.taskbar-button:hover {
    background: #d4d4d4;
}

@media screen and (max-width: 768px) {

    .chat-window {
    width: 95vw !important;
    height: 70vh !important;
    left: 2.5vw !important;
    top: 5vh !important;
    right: auto !important;
  }

  .bottomBar {
    flex-wrap: wrap;
    padding: 4px;
    height: auto;
  }

  .start-btn {
    font-size: 12px;
    padding: 2px 6px;
    gap: 2px;
  }

  .taskbar-button {
    width: 140px;
    font-size: 11px;
    padding: 2px 6px;
  }

  .time {
    height: 30px;
    font-size: 11px;
    padding: 2px 6px;
  }

  .taskbar-item {
    padding-right: 20px;
  }

  #taskbarButtons {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
  }

  .start-icon {
    overflow-x: auto;
    max-width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .start-btn {
    font-size: 10px;
  }

  .taskbar-button {
    width: 120px;
    font-size: 10px;
  }

  .time {
    font-size: 10px;
    padding: 2px 4px;
  }
}
