/* home app.css */
body {
    background-color: #ffb6c1;
    color: #d63384;
    text-align: center;
    font-family: 'Playfair Display', serif;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    z-index: -2;

    display: flex;
}

.bg-text {
    position: fixed;       
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 25px;
    color: rgba(255,255,255,0.5);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.container {
    margin-top: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;

    height: 500px;
    width: 500px;
    justify-content: center;
    align-content: center;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
}

.main-subtext {
    font-size: 1.5rem;
}

.btn-main {
    background-color: #ff4d6d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    display: inline-block;
    margin: 10px;
}

.btn-modern:hover {
    background-color: #e63950;
}

.button-group {
    margin-top: 20px;
}

.heart-bg {
    position: absolute;
    font-size: 2rem;
    color: white;
    opacity: 0.6;
    animation: float 5s infinite linear;
}

@keyframes float {
    from {
        transform: translateY(100vh);
    }
    to {
        transform: translateY(-10vh);
    }
}

/******************/
/* minimize state */
/******************/
/* .chat-box.minimized {
    height: auto;
    width: 200px;
}

.chat-box.minimized .chat-window,
.chat-box.minimized .chat-input,
.chat-box.minimized .username-input-container {
    display: none;
} */

.message-box {
    position: absolute;
    background: white;
    padding: 15px;
    border: 2px solid #d63384;
    border-radius: 10px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
    color: #d63384;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* weather */
#weather-animal {
    position: fixed;
    bottom: 3%;
    left: -10%;
    font-size: 2.2rem;
    opacity: 0.9;
    z-index: 0;
    animation: floatAnimal 20s linear infinite;
    pointer-events: none;
}

#weather-tint {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; 
  background: rgba(0, 0, 0, 0); 
  /* transition: background 5s ease; */
  /* animation: pulseTint 10s ease-in-out infinite; */
  pointer-events: none; 
}

@keyframes floatAnimal { 
    from { left: -10%; } 
    to { left: 110%; } 
}

@keyframes pulseWeather {
    0%   { background: var(--color1); }
    50%  { background: var(--color2); }
    100% { background: var(--color1); }
}


/* nav */
.taskbar {
    display:flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 24px;
    background: #c0c0c0;
    border-top: 2px solid white;
    border-bottom: 2px solid black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 5px;
    font-family: 'MS Sans Serif', sans-serif;
}

.taskbar-left {
    display: flex;
    align-items: center;
    gap: 2px;
}

.taskbar-message-button, .taskbar-music-button {
    background: #c0c0c0;
    border: 2px solid black;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'MS Sans Serif', sans-serif;
}

.taskbar-message-button.pressed, .taskbar-music-button.pressed {
    border-style: inset;
    background: #808080;
}

.taskbar-icon {
    width: 16px; 
    height: 16px;
    margin-right: 8px;
    vertical-align: middle; 
}

/* nav start button */
.start-button {
    background: silver;
    border: 2px outset gray;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.start-button:hover {
    border: 2px inset gray;
}

/* nav menu */
.start-menu {
    position: absolute;
    bottom: 26px;
    left: 5px;
    width: 160px;
    background: silver;
    border: 2px solid black;
    display: none;
    box-shadow: 4px 4px 0px black;
}

.start-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.start-menu li {
    padding: 5px 10px;
    font-size: 14px;
    border-bottom: 1px solid gray;
}

.start-menu li:hover {
    background: navy;
    color: white;
}

.start-menu a {
    text-decoration: none;
    color: black;
    display: block;
}

.start-menu li:hover a {
    color: white;
}

/* window buttons */
.taskbar-music-button, .taskbar-message-button {
    background: #c0c0c0;
    border: 2px solid black;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    display: inline-block;
    margin-right: 5px;
    font-family: 'MS Sans Serif', sans-serif;
}

/* nav clock */
.taskbar-clock {
    font-size: 11px;
    background: #c0c0c0;
    color: black;
    padding: 2px 8px;
    border: 2px inset #a0a0a0;
    margin-right: 6px;
    min-width: 50px;
    text-align: center;
}

.start-icon {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
}



/************/
/* MESSAGES */
/************/
.chat-box {
    width: 400px;
    margin: o;
    background: silver;
    border: 2px solid black;
    box-shadow: 4px 4px 0px black;
    font-family: 'MS Sans Serif', sans-serif;
    display: flex;
    flex-direction: column;

    position: fixed;
    top: 150px;
    left: 50%;
    z-index: 4000;
}

.chat-box .chat-title-bar {
    cursor: move;
}

.chat-window {
    background: white;
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    border-bottom: 2px solid black;
}

.chat-message {
    margin-bottom: 10px;
    font-size: 12px;
}

.message-text {
    color: black;
}


.timestamp {
    font-size: 10px;
    color: gray;
    margin-left: 5px;
}

.chat-input {
    display: flex;
    padding: 10px;
    background: #c0c0c0;
}

.chat-input input {
    flex: 1;
    padding: 5px;
    border: 2px inset gray;
    font-family: inherit;
    font-size: 12px;
}

.chat-input button {
    margin-left: 10px;
    background: silver;
    border: 2px outset gray;
    font-weight: bold;
    cursor: pointer;
}

.username-input-container {
    display: flex;
    padding: 10px;
    background: #c0c0c0;
    border-bottom: 2px solid black;
    margin-bottom: 10px;
}

.username-input-container input {
    flex: 1;
    padding: 5px;
    border: 2px inset gray;
    font-family: inherit;
    font-size: 12px;
}

.username-input-container button {
    margin-left: 10px;
    background: silver;
    border: 2px outset gray;
    font-weight: bold;
    cursor: pointer;
}

.chat-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: navy;
    color: white;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    border-bottom: 2px solid black;
}

.chat-title {
    font-family: 'MS Sans Serif', sans-serif;
}

.chat-controls {
    display: flex;
    gap: 2px;
}

.chat-button {
    background: silver;
    border: 1px solid black;
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    cursor: default;
}

.new-message {
  background-color: #fff8dc;
  transition: background 1.5s ease-out;
}

/****************/
/* music player */
/****************/
.music-box {
  width: 260px;
  position: fixed;
  z-index: 9999;
  border: 2px solid black;
  background: silver;
  box-shadow: 4px 4px 0 black;
  font-family: 'MS Sans Serif', sans-serif;
  z-index: 9999;
  margin:0;
}

#musicTitleBar {
  cursor: move;
  background: navy;
  color: white;
  font-weight: bold;
  padding: 2px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  border-bottom: 2px solid black;
}

.music-window {
  background: #c0c0c0;
  padding: 8px;
  border-top: 2px inset white;
  border-left: 2px inset white;
  border-right: 2px outset black;
  border-bottom: 2px outset black;
  text-align: center;
}

.track-display {
  background: white;
  border: 2px inset gray;
  font-size: 12px;
  padding: 4px;
  margin-bottom: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.track-display span {
    display: inline-block;
    padding-left: 100%; /* start on right*/
    will-change: transform;
}

@keyframes scrollTitle {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}

.progress-container {
  width: 100%;
  height: 8px;
  background: #c0c0c0;
  border: 2px inset white;
  margin-bottom: 6px;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: navy;
  border: 1px solid black;
  position: absolute;
  top: 0;
  left: 0;
  transition: width 0.2s linear;
}

.music-buttons button {
  background: silver;
  border: 2px outset gray;
  font-family: 'MS Sans Serif', sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  margin: 0 2px;
  cursor: pointer;
}

.music-buttons button:hover {
  background-color: #ddd;
}

.music-buttons button:active {
  border-style: inset;
}


/***********/
/* letters */
/***********/
.letter-popup {
    display: none;
    background: #fefbf2;
    background-image: 
        radial-gradient(circle, rgba(0,0,0,0.02) 1px, transparent 1px),
        radial-gradient(circle, rgba(0,0,0,0.015) 1px, transparent 1px),
        repeating-linear-gradient(
            135deg,
            rgba(0,0,0,0.01),
            rgba(0,0,0,0.01) 1px,
            transparent 1px,
            transparent 50px
        );
    background-size: 3px 3px, 6px 6px, 100% 100%;
    background-repeat: repeat, repeat, repeat;
    border: 2px solid black;
    width: 350px;
    min-height: 0;
    height: 300px;
    max-height: 300px;
    box-shadow: 4px 4px 0px black;
    font-family: 'MS Sans Serif', sans-serif;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    color: #b32d6e;
}

.letters-box {
    display: none;
    position: fixed;
    width: 350px;
    height: 400px;
    left: 60px;
    top: 120px;
    transform: none !important;
    margin: 0;
    padding: 0;
    z-index: 100;
    background: silver;
    border: 2px solid black;
    box-shadow: 4px 4px 0 black;
    font-family: 'MS Sans Serif', sans-serif;

    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.letters-box > .chat-title-bar {
    margin: 0;
    flex: 0 0 auto;
    border-bottom: 2px solid black;
}

.letters-box .letters-window {
    padding: 8px;
    background: #c0c0c0;
    flex: 1 1 0;
    overflow: auto;
    box-sizing: border-box;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.letters-box .chat-title {
  margin: 0;
}

.letters-box #lettersList {
    list-style: none;
    margin: 0 0 6px 0;
    padding: 4px;
    background: white;
    border: 2px inset gray;
    height: 160px;
    overflow-y: auto;
    font-size: 12px;
    text-align: left;
}

#lettersList li {
    padding: 4px;
    border-bottom: 1px solid #ccc;
    cursor: pointer;
}

#lettersList li:hover {
    background: #e0e0e0;
}

/* write new letter box */
.letters-box #newLetter {
    width: 100%;
    height: 90px;
    resize: none;
    padding: 6px;
    border: 2px inset gray;
    background: white;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 12px;
    box-sizing: border-box;
    margin-top: 6px;
}

.letters-box #addLetterBtn {
    margin-top: 6px;
    align-self: flex-end;
    background: silver;
    border: 2px outset gray;
    padding: 4px 10px;
    cursor: pointer;
}

#addLetterBtn:active {
    border-style: inset;
}

.popup-title-bar {
    background: navy;
    color: #fff;
    padding: 5px;
    cursor: move;
    flex: 0 0 auto;
    user-select: none;
}

.popup-content p {
    margin: 0;
}

.popup-content {
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
    max-height: 90%;
    min-height: 0;

    font-size: 14px;
    line-height: 1.25;
}

.popup-content::-webkit-scrollbar {
    width: 12px;
}

.popup-content::-webkit-scrollbar-track {
    background: silver;
    border: 1px solid black;
}

.popup-content::-webkit-scrollbar-thumb {
    background-color: navy;
    border: 2px solid black;
    border-radius: 4px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background-color: #000080;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    height: 60px;
    font-size: 12px;
    cursor: pointer;
}

.desktop-icon img {
    width: 40px;
    height: 40px;
}


 /* temp alert */
 .drag-alert {
    position: fixed;
    top: -50px; /* start off screen */
    left: 50%;
    transform: translateX(-50%);
    background: #ff4d6d;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    transition: top 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}
.drag-alert.show {
    top: 10px;
    opacity: 1;
}



/* make title bars taller and message box smaller on mobile */
@media (max-width: 768px) {
    .chat-title-bar, #musicTitleBar {
        padding: 10px;
        font-size: 16px;
        cursor: grab;
    }

    .music-buttons button, .chat-input button {
        padding: 8px;
        font-size: 14px;
    }

    .chat-box {
        width: 80%;
        top: 80px;
        left: 5%;
        font-size: 14px;
    }

    .chat-window {
        height: 200px;
    }

    .chat-input input {
        font-size: 12px;
    }

    .chat-input button {
        font-size: 12px;
    }

    .popup-content {
        font-size: 12px;
        line-height: 1.4;
    }
}


/* letter override */
/* entire letter font */
.popup-content {
    font-family: 'Special Elite', monospace;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
}

.popup-content p.signature {
    margin-top: 1em; /* space below the main text */
}


/* signature animation */
.signature {
    display: inline-block;
    margin-top: 1em;
    font-family: 'Special Elite', monospace;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #d63384;
    width: 0;
    animation: typing 2s steps(20, end) forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 11ch; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

