* {
    box-sizing: border-box;
}

h1 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
}

/* Profile Banner Stuff */
.profile-banner {
    display: flex;
    flex-direction: column;
    background-color: var(--color1); /* Dark background */
    padding: 10px;
    width: 100%;
    margin-top: 37px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align content to the left */
}

.profile-header {
    display: flex;
    align-items: center; /* Align items horizontally */
    width: 100%;
}

.profile-image {
    width: 30%; /* Set the width relative to its container */
    max-width: 250px; /* Set a maximum width */
    height: auto;
    margin-right: 10px;
    image-rendering: pixelated;
}

.username-section {
    display: flex;
    align-items: flex-end; /* Align items to the bottom */
    width: 100%;
}

.crown-username {
    display: flex;
    align-items: baseline;
}

#usernameField {
    color: #ffffff;
    font-weight: bold;
    font-size: clamp(18px, 4vw, 70px); /* Set font size relative to viewport width */
    max-width: 80%; /* Set a maximum width */
    line-height: 1; /* Eliminate extra line height */
    vertical-align: bottom; /* Align the bottom of the text with the crown */
}

#user-title {
    margin-bottom: 45px; /* Increased to accommodate bubbles */
    margin-left: 20px;
    color: #ffffff;
    font-weight: bold;
    font-size: calc(clamp(11px, 2vw, 35px));
    max-width: 100%;
    word-wrap: break-word;
    background-color: var(--color3);
    padding: 10px 15px;
    border-radius: 30px; /* More rounded for bubble effect */
    position: relative;
    display: inline-block;
    box-shadow: 0 0 0 2px var(--color1); /* Optional outline */
    transition: all 0.3s ease;
}

#user-title::before,
#user-title::after {
    content: "";
    position: absolute;
    background-color: var(--accent);
    border-radius: 50%;
}
#user-title::before {
    width: 25px;
    height: 25px;
    bottom: -25px;
    left: -15px;
}

#user-title-link {
    text-decoration: none;
    display: inline-block; /* Needed for hover effect */
}

.crown-image {
    width: calc(clamp(40px, 4vw, 100px)); /* Make the width scale with the username field */
    height: auto; /* Maintain aspect ratio */
    image-rendering: pixelated;
    line-height: 1; /* Eliminate extra line height */
    vertical-align: bottom; /* Align the bottom of the text with the crown */
    margin-right: 10px;
}

#bio {
    color: #ffffff;
    font-weight: bold;
    word-wrap: break-word; /* Allow long bios to wrap */
    text-align: left;
}

.star-container {
    display: flex;
    flex-wrap: wrap; /* Allow stars to wrap to the next line */
    align-items: flex-start; /* Align stars to the left */
    width: 100%;
}

.star-container img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

#orange-star-image img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

#orange-star-image {
    margin-right: 10px;
}

#orange-star-image:hover {
    scale: 1.05;
}

.number {
    font-size: min(3vw, 16px); /* Set font size relative to viewport width */
    font-weight: bold;
    text-align: center;
    color: white;
}

.follow-star-container {
    display: flex;
    align-items: flex-end; /* Align items vertically */
    width: 100%;
}

.follow-button {
    align-self: flex-end;
    background-color: var(--color2);
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    font-family: "OCRAStd", monospace;
}

/* Additional styles for hover effect on the button */
.follow-button:hover {
  background-color: var(--color3);
}

.star-container .star {
    opacity: 1; /* Set opacity for yellow stars */
    position: relative;
    display: none;
}

#orange-star-image {
    display: none;
}

.star-container .star:hover {
    scale: 1.05;
}


/* Profile Banner Stuff END */


/* Email styles */
#email {
  font-size: 18px; /* Adjust size as needed */
  color: #666; /* Grey text color */
  margin-bottom: 20px; /* Space between email and edit button */
}


/* Additional details */
.additional-details {
    padding: 20px;
    text-align: center;
}

.additional-details h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.additional-details p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Sorting Options */

.sorting-container {
    display: flex;
    margin-top: 20px;
}

.sorting-dropdown {
    margin-right: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

select {
    padding: 8px;
    box-sizing: border-box;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
}

/* Style for the dropdown arrow */
select::-ms-expand {
    display: none;
}

select:hover,
select:focus {
    border-color: #de71a8;
}

/* Style for the options */
option {
    font-size: 14px;
}

/* Optional: Style for the selected option */
select option:checked {
    background-color: var(--color2);
    color: #fff;
}

.selected {
    background-color: var(--color3);/* Light pink background for selected button */
    color: #FFF; /* Change text color for selected button */
}

.selected:hover {
    background-color: var(--color4);/* Light pink background for selected button */
}


/* Style for the modal container */
#filtersModal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 4;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4); /* Overlay background */
}

.collection-section {
    margin-bottom: 20px;
    text-align: left;
}

.collection-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #FFF;
}

#search-input {
    margin-bottom: 10px;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--color2);
    color: #FFF;
    border: 1px solid #000;
    border-radius: 5px;
}

.collection-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.collection-item {
    background-color: var(--color2);
    color: #FFF;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.collection-item:hover {
    transform: scale(1.05); /* Slightly increase the size */
}
.collection-item.selected {
    background-color: var(--color3);
}

.selected-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px; /* Add space above the selected words if needed */
    width: 100%;
}

:root {
    --bg: var(--color1);
    --item-bg: var(--color2);
    --accent: var(--color3);
    --reply-bg: var(--color4);
    --input-bg: var(--color5);
    --radius: 10px;
}

/* Tabs */
.profile-tabs {
    display: flex;
    width: 100%;            /* Full width of the container */
    gap: 0;                 /* Remove spacing between the two tabs */
    margin: 0;   
}
.tab-btn {
    background-color: var(--color2);
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: "OCRAStd", monospace;
    flex: 1 1 50%;          /* Each tab occupies 50% of the available width */
    width: 50%;             /* Explicit 50% width for robustness */
    padding: 10px 0;        /* Slightly taller for better touch targets */
}
.tab-btn.active,
.tab-btn:hover {
    background-color: var(--color3);
}
.tab-content {
    display: none;
}

/* Journal styles (renamed from chat styles) */
.journal-container {
    width: 100%;
    max-width: 1400px;
    margin: auto;
    padding: 0 15px;
    box-sizing: border-box;
}
.journal-list {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.journal-item,
.journal-reply {
    background-color: var(--item-bg);
    padding: 10px 15px;
    border-radius: var(--radius);
    color: #fff;
    text-align: left;
    position: relative;
}
.journal-reply {
    /* Reduced, responsive indentation */
    margin-left: clamp(4px, 2vw, 16px);
    margin-top: 12px;
    background-color: var(--reply-bg);
    /* Use pseudo-element only for thread line */
    padding-left: 12px;
}
.creation-date {
    /* Keep timestamp in normal flow to avoid overlap */
    position: static;
    display: block;
    text-align: right;
    font-size: 0.7rem;
    color: #ccc;
    margin-top: 6px;
}
.journal-title {
    position: relative;
    display: inline-block;
    background-color: var(--accent);
    margin-left: 10px;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: clamp(16px, 3vw, 20px);
    margin-bottom: 26px;
    margin-top: 12px;
    text-align: left;
}
.journal-title::before,
.journal-title::after {
    content: "";
    position: absolute;
    background-color: var(--accent);
    border-radius: 50%;
}
.journal-title::before {
    width: 12px;
    height: 12px;
    bottom: -14px;
    left: -5px;
}
.journal-username {
    font-weight: bold;
    margin-bottom: 4px;
    text-align: left;
}
.journal-message {
    white-space: pre-wrap;
    text-align: left;
    /* Ensure very long words/URLs wrap inside the container */
    word-break: break-word;        /* legacy */
    overflow-wrap: anywhere;       /* modern */
}
.reply-btn {
    background-color: var(--accent);
    border: none;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 5px;
    font-family: "OCRAStd", monospace;
}
.reply-btn:hover {
    background-color: var(--item-bg);
}
.reply-form {
    margin-top: 8px;
}
.reply-form input {
    width: calc(100% - 60px);
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    background-color: var(--input-bg);
    color: #fff;
    text-align: left;
    font-family: "OCRAStd", monospace;
}
.reply-form button {
    padding: 6px 12px;
    border: none;
    background-color: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "OCRAStd", monospace;
    margin-top: 10px;
}
.reply-form button:hover {
    background-color: var(--item-bg);
}
.journal-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#journalTitleInput,
#journalInput {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: var(--radius);
    background-color: var(--input-bg);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    text-align: left;
    resize: vertical;
}
#postJournalBtn {
    align-self: flex-end;
    margin-top: 10px;
    background-color: var(--accent);
    border: none;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: "OCRAStd", monospace;
}
#postJournalBtn:hover {
    background-color: var(--item-bg);
}
@media (max-width: 600px) {
    .journal-reply {
        margin-left: 4px;
    }
    .journal-title {
        font-size: 16px;
    }
}
.journal-options {
    position: relative;
    display: inline-block;
    float: right;
    margin-top: -28px;
    margin-right: 5px;
}
.options-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
}
.options-menu {
    position: absolute;
    right: 0;
    top: 26px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 6px;
    min-width: 100px;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.options-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
}
.options-item:hover {
    background-color: #333;
}

/* New: vertical line indicator for nested replies */
.journal-reply::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    background: var(--accent);
    opacity: 0.6;
}

/* Folder bar layout: flex two-per-row */
.tab-folder-btn {
    background-color: var(--color4);
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: "OCRAStd", monospace;
    flex: 1 1 50%;          /* Each tab occupies 50% of the available width */
    width: 50%;             /* Explicit 50% width for robustness */
    padding: 10px 0;        /* Slightly taller for better touch targets */
    border: 1px solid var(--color2);
}
.tab-folder-btn.active,
.tab-folder-btn:hover {
    background-color: var(--color5);
}

#folderBar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
}

#folderBar .tab-btn {
    flex: 0 0 50%;
    max-width: 50%;
}

/* If odd number of buttons, make last one full width */
#folderBar .tab-btn:last-child:nth-child(even) {
    flex: 0 0 100%;
    max-width: 100%;
}

#folderButtons {
    display: none !important; /* hide wrapper completely to avoid extra flex item */
}

/* tweak to your system */
#folderListInModal .folder-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 8px; border-radius: 8px;
  color: #fff;
}
#folderListInModal .folder-row:hover { background: rgba(255,255,255,.04); }
#folderListInModal .folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delete-folder-btn {
  border: none; cursor: pointer; padding: 6px 10px; border-radius: 8px;
  color: #fff;
  background-color: var(--color2);
  font-family: "OCRAStd", monospace;
}
.delete-folder-btn:hover {
  background-color: var(--color3);
}

.hint {
  color: #fff;
}

.modal-subtitle {
  color: #fff;
}