.boardz {
    display: flex;
    justify-content: space-between;
    flex: auto;
}
.boardz ul {
    list-style-type: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0px 4px 0px;
    flex: 1;
}
.boardz ul li {
    margin: 8px 4px 8px 4px;
    padding: 12px;
    flex: auto;
    border-radius: 4px;
    border: 1px solid #e4e3e0;
    background-color: white !important;
}
.boardz ul h1 {
    margin: 0 0 10px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid gray;
}

@media screen and (max-width: 800px) {
    .boardz {
        flex-direction: column;
    }
    .boardz ul li:last-child {
        margin-bottom: 0;
    }
    .boardz ul {
        margin: 0;
        padding: 0;
    }
}
.fitted ul {
    display: flex;
}
.fitted ul li {
    margin: 4px 4px 4px 4px !important;
}
.boardz img {
    max-width: 100%;
    height: auto;
}

body {
    background-color: #f4f3f0;
    padding-top: 70px; /* Space for fixed header */
}

body.home-page {
    padding-top: 0; /* No padding when header is hidden on home page */
}

body, div, p, span {
    font-family: "Open Sans";
}

a, a:visited {
    color: #e84458;
    text-decoration: none;
}

a.black {
    color: black;
}

/*p {*/
/*    letter-spacing: .01em;*/
/*    font-size: 1.5em;*/
/*    font-weight: 400;*/
/*}*/
.available-classes ul {
    letter-spacing: .01em;
    font-size: 1.5em;
    font-weight: 400;
}
h2 {
    /* font-size: 5vh; */
    font-weight: 400;
}
.page-header {
    display: flex;
    flex-direction: column;
    font-size: 4vh;
}
.subheader {
    font-size: 4vh;
    color: gray;
}
.text-center {
    text-align: center;
}
.separator {
    margin-top: 5vh;
    margin-bottom: 5vh;
}
.centered-block {
    margin: auto;
}
.fifty-percent {
    width: 50%;
}
.seventyfive-percent {
    width: 75%;
}
.footer {
    font-size: 0.8em;
}

div.what {
    float: left;
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.tile-pin-icon {
    color: #e84458;
    margin-right: 0.25rem;
    font-size: 0.7rem;
    vertical-align: middle;
}

.note-read-more {
    margin-top: -0.5rem;
    text-align: right;
    font-size: 0.8rem;
}

.note-read-more a {
    color: #e84458;
    text-decoration: none;
    font-weight: 500;
}

.note-read-more a:hover {
    text-decoration: underline;
}

div.year {
    float: right;
    display: block;
    font-size: 0.8rem;
}

div.lihead {
    display: block;
    margin: 0px 0px 10px 0px;
    padding: 3px 6px;
    color: #aaa;
}

div.lititle {
    display: block;
    margin: 10px 0px 4px 0px;
    text-align: center;
    color: #666;
}

/* Larger heading styles when title/subtitle act as headings */
.lititle-heading {
    font-size: 1.2rem;
    font-style: normal;
    color: #333;
}

.liinfo-subheading {
    font-size: 1.2rem;
    font-style: normal;
    color: #888;
}

div.liinfo {
    display: block;
    margin: 2px 0px 0px 0px;
    text-align: center;
    color: #999;
    font-size: 84%;
}

div.header {
    text-align: center;
    margin-top: 0;
}

div.mypic img {
    width: 45px;
    margin: 8px;
    border-radius: 20px;
}

div.name {
    font-size: 130%;
    margin: 2rem 0 1rem;
}

@media screen and (max-width: 768px) {
    /* Ensure body and html take full width on mobile */
    body, html {
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    div.name {
        margin-top: 5rem;
    }
    
    /* Fix centering for mobile pages */
    .page-container {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
    }
    
    .page-container-centered {
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .home-hero {
        padding: 2rem 1rem;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .card {
        width: calc(100% - 2rem);
        max-width: calc(100% - 2rem);
        margin: 0 auto;
        box-sizing: border-box;
    }
}

div.socials {
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

div.socials a {
    display: inline-block;
}

div.socials i {
    display: inline-block;
}

.f200pc {
    /* font-size: 1.2.rem; */
}

div.socials .f200pc {
    margin: 0;
}

/* User Menu */
/* Fixed header bar */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(244, 243, 240, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: none;
    padding: 0;
    transition: border-bottom 0.2s ease;
}

/* On desktop, hide app-header when navbar-desktop is present */
@media screen and (min-width: 769px) {
    .app-header {
        display: none;
    }
}

.app-header-scrolled {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.app-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    max-width: 100%;
    margin: 0 auto;
}

.user-menu-container {
    display: flex;
    align-items: center;
}

.user-menu-with-create {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Auth Icons (when not logged in) */
.auth-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Auth icon (used for both login/register and create tile button) */
.auth-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    color: #e84458;
    text-decoration: none;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    margin-right: 1rem;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.auth-icon:last-child {
    margin-right: 0;
}

.auth-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: #333;
}

.create-tile-icon {
    color: #e84458;
}

.create-tile-icon:hover {
    color: #333;
}

.user-menu {
    position: relative;
}

.user-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.user-menu-button:hover {
    transform: scale(1.05);
}

/* .user-menu-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
} */

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.user-avatar-fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.user-menu-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.25rem;
}

.user-menu-email {
    font-size: 0.875rem;
    color: #666;
}

.user-menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.25rem 0;
}

.user-menu-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    line-height: 1.4;
    padding: 0.75rem 1rem;
}

.user-menu-item:hover {
    background-color: #f8f9fa;
}

.user-menu-item-button {
    color: #dc3545;
    font-size: inherit;
    font-family: inherit;
    font-size: 1rem !important;
}

.user-menu-item-button:hover {
    background-color: #fff5f5;
    color: #c82333;
}

div.links {
    /*border-radius: 4px;*/
    /*border: 1px #eee solid;*/
    /*padding: 12px;*/
}

div.links a {
    padding: 2px 6px;
    display: block;
}

.mr6 {
    margin-right: 6px !important;
}

.f84pc {
    font-size: 84%;
}

.mb4 {
    margin-bottom: 4px;
}

.mt4 {
    margin-top: 4px;
}

.mt8 {
    margin-top: 8px;
}

.mt12 {
    margin-top: 12px;
}

.centered {
    text-align: center;
}

div.linkEmail {
    padding: 12px 0 6px;
}

div.extra {
    /* border-top: 1px #eee solid; */
    /*padding: 16px;*/
    /* margin-top: 24px; */
    font-size: 80%;
    color: #666;
    /* padding: 16px 8px 8px; */
}

div.extra p {
    font-size: 100%;
}

img.soundCover {
    width: 100%;
    height: auto;
    margin-bottom: 8px;
    display: block;
    max-width: 100%;
}

/* Common UI Classes */
.page-container {
    min-height: 100vh;
    background: #f4f3f0;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

/* Create Tile page overrides: allow full-width layout */
.page-container.create-tile-page {
    align-items: stretch;
}

.page-container-centered {
    /* justify-content: center; */
}

/* Home page specific styles */
.home-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.home-logo-container {
    margin-bottom: 2rem;
}

.logo-main {
    height: 80px;
    width: auto;
}

.home-headline {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
}

.home-tagline {
    font-size: 1.3rem;
    margin: 0 0 4rem 0;
    color: #555;
    line-height: 1.6;
    max-width: 700px;
}

.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 0 0 4rem 0;
    width: 100%;
    max-width: 800px;
}

.home-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.home-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.home-feature-text {
    text-align: center;
    line-height: 1.5;
}

.home-feature-text strong {
    display: block;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.home-feature-text span {
    font-size: 0.95rem;
    color: #666;
}

.home-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4rem;
}

.home-invitation-section {
    background: linear-gradient(135deg, #fff5f7 0%, #ffffff 100%);
    border: 2px solid #e84458;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 700px;
    margin-top: 2rem;
}

.home-invitation-badge {
    display: inline-flex;
    align-items: center;
    background: #e84458;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.home-invitation-text {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 2rem 0;
}

.home-invitation-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.home-invitation-actions .btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.home-invitation-actions .btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
    color: white;
}

/* Force white text for links even when visited */
a.white,
a.white:visited,
a.white:hover,
a.white:active {
    color: white !important;
}

.home-footer-text {
    margin-top: 1rem;
    color: #999;
    font-size: 0.9rem;
}

.btn-explore {
    background: #e84458;
    color: white !important;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(232, 68, 88, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-explore:hover {
    background: #d63a4e;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 68, 88, 0.4);
}

a.btn-explore {
    color: white !important;
}

a.btn-explore:hover {
    color: white !important;
}

.btn-primary {
    background: #e84458;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(232, 68, 88, 0.3);
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    background: #d63a4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 68, 88, 0.4);
}

.btn-secondary {
    background: white;
    color: #e84458;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    border: 2px solid #e84458;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-secondary:hover {
    background: #fff5f7;
    transform: translateY(-2px);
}

@media screen and (max-width: 768px) {
    .home-headline {
        font-size: 2rem;
    }
    
    .home-tagline {
        font-size: 1.1rem;
    }
    
    .home-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .home-invitation-section {
        padding: 1.5rem;
    }
    
    .home-invitation-actions {
        flex-direction: column;
    }
    
    .home-invitation-actions .btn-primary,
    .home-invitation-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

.btn-outline {
    background: white;
    color: #333;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #e9ecef;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    width: auto;
}

.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.footer {
    padding: 2rem;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.card-large {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.dashboard-info-card {
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.dashboard-forms-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.dashboard-form-card {
    flex: 1 1 calc(50% - 1rem);
    min-width: 300px;
    max-width: 450px;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media screen and (max-width: 768px) {
    .dashboard-form-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Form label flex layout */
.form-label-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Field hint text (smaller, lighter) */
.field-hint {
    margin-left: 0.25rem;
    font-size: 0.85em;
    font-weight: normal;
    color: #666;
}

/* Character counter (base class, dynamic color must remain inline) */
.char-counter {
    margin-left: 0.5rem;
    font-size: 0.9em;
}

/* Small form text (for Tag/What and Date fields) */
.form-text-small {
    font-size: 0.8rem;
}

/* Disabled form input */
.form-input-disabled {
    background: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
}

/* Add link button */
.add-link-button {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    margin-left: auto;
    background: #e84458;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.2s ease;
}

.add-link-button:hover {
    background: #d6384b;
}

/* Essential field hint */
.essential-field-hint {
    margin-left: 0.5rem;
    color: #666;
    font-size: 0.9em;
}

/* List reset */
.list-reset {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Alert margin */
.alert-margin {
    margin-bottom: 1rem;
}

/* 404 page styles */
.error-page-container {
    text-align: center;
    max-width: 600px;
}

.error-page-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #e84458;
}

.error-page-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.error-page-text {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: #666;
}

/* Clearfix */
.clearfix {
    clear: both;
}

/* Picture/Vimeo/YouTube clickable */
.tile-clickable {
    cursor: pointer;
}

/* Video container aspect ratio */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
}

/* Instagram overlay for click-to-enlarge */
.instagram-embed-wrapper {
    position: relative;
}

.instagram-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
    background: transparent;
}

/* Spotify border radius */
.spotify-embed {
    border-radius: 12px;
    width: 100%;
}

/* Wrapper for Spotify playlist embeds to control height */
.spotify-embed-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

/* Modal dialog styles */
.modal-text-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%; /* Constrained by parent */
    overflow: hidden;
    min-height: 0; /* Allow flex item to shrink */
}

.modal-title {
    margin-bottom: 1rem;
    color: white;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.modal-text {
    margin-bottom: 0.5rem;
    color: white;
}

.modal-message {
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.5;
    flex-shrink: 0; /* Prevent message from shrinking */
}

.modal-form-group {
    margin-bottom: 1.5rem;
}

.modal-label-white {
    color: white;
}

.modal-children-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Allow flex item to shrink below content size */
    max-height: calc(90vh - 200px); /* Reserve space for title, message, buttons, and padding */
    padding-right: 0.5rem; /* Space for scrollbar */
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.modal-children-container::-webkit-scrollbar {
    width: 8px;
}

.modal-children-container::-webkit-scrollbar-track {
    background: transparent;
}

.modal-children-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.modal-children-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.modal-buttons-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-shrink: 0; /* Prevent buttons from shrinking */
    margin-top: auto; /* Push buttons to bottom */
}

.modal-button-min-width {
    min-width: 100px;
}

/* Video lightbox content */
.video-lightbox-content {
    width: min(1200px, 95vw);
}

/* Instagram lightbox content */
.instagram-lightbox-content {
    width: min(540px, 95vw);
    display: flex;
    justify-content: center;
    align-items: center;
}

.instagram-lightbox-embed {
    width: 100%;
    max-width: 540px;
}

/* Modal container padding */
.modal-container-padding {
    padding: 2rem;
}

/* Tile preview in modal */
.modal-tile-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

/* Mobile-specific constraints for modal tile container */
@media screen and (max-width: 768px) {
    .modal-tile-container {
        max-width: calc(100vw - 3.5rem) !important; /* Account for overlay padding (1rem) + modal padding (0.75rem) + buffer */
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure masonry items inside modal don't inherit width from page layout */
    .modal-tile-container .masonry-item,
    .modal-tile-container .masonry-item li {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

.dashboard-page {
    margin: 22px 0 50px;
}

/* Dashboard styles */
.dashboard-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.dashboard-section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: normal;
}

.dashboard-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-settings-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    background: white;
}

.dashboard-settings-card:hover {
    border-color: #e84458;
    box-shadow: 0 4px 12px rgba(232, 68, 88, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.dashboard-settings-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #e84458;
    font-size: 1.5rem;
}

.dashboard-settings-card:hover .dashboard-settings-icon {
    background: #e84458;
    color: white;
}

.dashboard-settings-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.dashboard-settings-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

@media screen and (max-width: 768px) {
    .dashboard-settings-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-field {
    margin-bottom: 0.5rem;
}

.dashboard-admin-role {
    color: #dc3545;
}

.dashboard-divider {
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

/* Form help text */
.form-help-text {
    color: #666;
    font-size: 0.875rem;
    display: block;
    margin-top: 0.25rem;
}

.form-error-text {
    color: #721c24;
    font-size: 0.875rem;
    display: block;
    margin-top: 0.25rem;
}

.form-input-error {
    border-color: #dc3545 !important;
}

.form-input-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

/* Admin page styles */
.admin-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-grid-item-centered {
    max-width: 500px;
    margin: 0 auto;
}

.admin-empty-state {
    color: #6c757d;
    font-style: italic;
}

.admin-invitations-list {
    max-height: 400px;
    overflow-y: auto;
}

.admin-invitation-card {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.admin-invitation-card-used {
    background: #f8f9fa;
}

.admin-invitation-card-active {
    background: white;
}

.admin-invitation-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.admin-status-used {
    color: #28a745;
}

.admin-status-pending {
    color: #ffc107;
}

.admin-meta-text {
    font-size: 0.9rem;
    color: #6c757d;
}

.admin-users-list {
    max-height: 600px;
    overflow-y: auto;
}

.admin-user-card {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: white;
}

.admin-user-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.admin-user-info {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.admin-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.admin-user-email {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.admin-user-name {
    font-size: 0.9rem;
    color: #495057;
    margin-top: 0.25rem;
}

.admin-user-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    background-color: #dc3545;
    color: white;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #333;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #555;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-small {
    width: auto;
    padding: 0.5rem 1rem;
}

.alert {
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
    border: 1px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-inline {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.text-center {
    text-align: center;
}

.link {
    color: #e84458;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.link-username {
    color: #28a745;
    font-weight: bold;
}

.link-username:hover {
    text-decoration: underline;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-item {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

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

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    border-radius: 50%;
}

.logo-link {
    color: #333;
    text-decoration: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
}

.logo-link img {
    height: 40px;
    width: auto;
    display: block;
}

.logo-link:hover {
    opacity: 0.7;
}

.logo-nav {
    height: 30px;
    width: auto;
}

.logo-main {
    max-width: 300px;
    height: auto;
}

/* Desktop Navbar Styles */
.navbar-desktop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #f4f3f0aa;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding-top: 4px;
}

.navbar-desktop-container {
    height: 100%;
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Ensure logo and links don't overlap title */
.navbar-desktop-logo {
    flex-shrink: 0;
    z-index: 2;
}

.navbar-desktop-links {
    flex-shrink: 0;
    z-index: 2;
}

.navbar-desktop-logo img {
    height: 40px;
    width: auto;
}

.navbar-desktop-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
    width: auto;
    max-width: calc(100% - 400px); /* Ensure it doesn't overlap logo or links */
    overflow: hidden;
    text-overflow: ellipsis;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.navbar-desktop-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* User menu in navbar desktop */
.navbar-desktop-links .user-menu-with-create {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-desktop-links a,
.navbar-desktop-links button {
    text-decoration: none;
    font-size: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: #e84458;
}

.navbar-desktop-links button {
    font-size: 1.5rem;
}

.navbar-desktop-links a:hover,
.navbar-desktop-links button:hover {
    /* opacity: 0.7; */
    color:#333;
}

.navbar-desktop-filter-btn {
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.navbar-desktop-filter-btn:hover {
    opacity: 0.7;
}

/* Navbar Desktop Menu Button */
.navbar-desktop-menu {
    position: relative;
}

.navbar-desktop-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.navbar-desktop-menu-button:hover {
    color: #e84458;
}

.navbar-desktop-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    overflow: hidden;
    z-index: 1003;
    animation: dropdownFadeIn 0.2s ease;
    padding: 0.5rem 0
}

.navbar-desktop-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.navbar-desktop-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    flex-shrink: 0;
}

.navbar-desktop-menu-item span {
    flex: 1;
}

.navbar-desktop-menu-item:hover {
    background: #f8f9fa;
}

.navbar-desktop-menu-item:hover i {
    color: #333;
}

.navbar-desktop-menu-item-button {
    color: #dc3545;
}

.navbar-desktop-menu-item-button:hover {
    background: #f8f9fa;
    color: #c82333;
}

.navbar-desktop-menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

.btn-logout {
    color: #dc3545;
}

.btn-logout:hover {
    color: #c82333;
}

/* Mobile Navbar Styles */
.navbar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 60px;
    background: white;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar-mobile-container {
    height: 100%;
    padding: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
}

.navbar-mobile-links {
    display: flex;
    gap: 0;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
}

.navbar-mobile-links a,
.navbar-mobile-links button {
    font-size: 0.75rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    text-align: center;
    max-width: 80px;
    color: #666;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.navbar-mobile-links a:hover,
.navbar-mobile-links button:hover {
    color: #e84458;
    opacity: 1;
}

.navbar-mobile-back-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.1rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    text-align: center;
    max-width: 80px;
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: 600;
}

.navbar-mobile-back-btn i {
    font-size: 1.3rem;
}

.navbar-mobile-back-btn:hover {
    color: #e84458;
    opacity: 1;
}

.navbar-mobile-filter-btn {
    background: #e84458;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.navbar-mobile-filter-btn:hover {
    background: #d6354a;
}

/* Pinterest-style Masonry Layout - Grid-based */
.masonry-container-grid {
    display: grid;
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
}

.masonry-column {
    display: flex;
    flex-direction: column;
}

.masonry-container-grid .masonry-item {
    margin-bottom: 16px;
    width: 100%;
}

/* Keep old CSS columns approach as fallback */
.masonry-container {
    /* column-count is set dynamically via inline style */
    column-gap: 16px;
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
}

.masonry-container .masonry-item {
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 1rem;
}

/* Base tile card styling - can be reused in modals */
.masonry-item li,
.tile-card,
.tile-preview li {
    margin: 0 !important;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #eae9e6;
    background-color: white !important;
    box-sizing: border-box;
    display: block;
    width: 100%;
    position: relative;
}

.masonry-item li,
.tile-card {
    border-color: #dad9d6;
}


/* Tile ownership indicators - Curated content styling */
/* Curated tiles (content shared but not owned by the user) have a subtle gray background */
.masonry-item li.tile-curated,
.tile-card.tile-curated,
.tile-preview li.tile-curated {
    background-color: #eeede9 !important;
    border-color: #d0c8c0 !important;
}

.masonry-container-grid .masonry-item li,
.masonry-container .masonry-item li {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Tile menu for owner */
.tile-owner {
    position: relative;
}

.tile-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.tile-owner:hover .tile-menu {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile: show menu when explicitly opened */
@media (hover: none) and (pointer: coarse) {
    .tile-menu {
        opacity: 0;
        pointer-events: none;
    }
    
    .tile-menu-visible {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .lihead-clickable {
        cursor: pointer;
        user-select: none;
    }
}

.tile-menu-button {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

.tile-menu-button:hover {
    background: white;
    border-color: rgba(0, 0, 0, 0.25);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tile-menu-button:active {
    transform: scale(0.95);
}

.tile-menu-edit {
    color: #333;
}

.tile-menu-edit:hover {
    color: #e84458;
}

.tile-menu-pin {
    color: #666;
}

.tile-menu-pin:hover {
    color: #e84458;
}

.tile-menu-pin.pinned {
    color: #e84458;
}

.tile-menu-delete {
    color: #666;
}

.tile-menu-delete:hover {
    color: #dc3545;
    background: #fff5f5;
}

/* Make all content responsive within masonry tiles */
.masonry-container-grid .masonry-item li > *,
.masonry-container .masonry-item li > * {
    max-width: 100% !important;
    box-sizing: border-box;
}

.masonry-container-grid .masonry-item li img,
.masonry-container .masonry-item li img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    width: 100% !important;
}


.masonry-container-grid .masonry-item li iframe,
.masonry-container .masonry-item li iframe {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 450px !important;
}

/* Instagram embeds - allow dynamic height calculation (width + 54px) */
.masonry-container-grid .masonry-item li .instagram-embed-container iframe,
.masonry-container .masonry-item li .instagram-embed-container iframe,
.masonry-container-grid .masonry-item li .instagram-media iframe,
.masonry-container .masonry-item li .instagram-media iframe,
.tile-preview li .instagram-embed-container iframe,
.tile-preview li .instagram-media iframe {
    max-height: none !important;
    /* Height will be set dynamically via JavaScript to width + 54px */
}

/* Spotify playlist embeds - allow dynamic height calculation */
.masonry-container-grid .masonry-item li .spotify-embed-wrapper iframe,
.masonry-container .masonry-item li .spotify-embed-wrapper iframe,
.masonry-container-grid .masonry-item li .spotify-embed-wrapper .spotify-playlist,
.masonry-container .masonry-item li .spotify-embed-wrapper .spotify-playlist,
.tile-preview li .spotify-embed-wrapper iframe,
.tile-preview li .spotify-embed-wrapper .spotify-playlist,
.spotify-embed-wrapper iframe.spotify-playlist,
.spotify-embed-wrapper .spotify-playlist {
    max-height: none !important;
    height: auto !important;
    /* Height will be set dynamically via JavaScript */
}

/* Only apply block display to links containing images */
.masonry-container-grid .masonry-item li a:has(img),
.masonry-container .masonry-item li a:has(img) {
    display: block;
    max-width: 100%;
}

.masonry-container-grid .masonry-item li a img,
.masonry-container .masonry-item li a img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
}

/* Exception: GitHub repo avatar should maintain its small size */
.masonry-container-grid .masonry-item li a .github-repo-avatar,
.masonry-container .masonry-item li a .github-repo-avatar {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
}

/* Ensure text links remain inline */
.masonry-container-grid .masonry-item li a,
.masonry-container .masonry-item li a {
    max-width: 100%;
}

.masonry-container-grid .masonry-item li > div,
.masonry-container .masonry-item li > div {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Ensure all direct children respect container width */
.masonry-container-grid .masonry-item li *,
.masonry-container .masonry-item li * {
    box-sizing: border-box;
    max-width: 100%;
}

/* Specifically ensure bio card content respects column width */
.masonry-container-grid .masonry-item.bio-card,
.masonry-container .masonry-item.bio-card {
    min-width: 0; /* Allow flex/grid items to shrink below content size */
    width: 100% !important;
    max-width: 100% !important;
}

.masonry-container-grid .masonry-item.bio-card li,
.masonry-container .masonry-item.bio-card li {
    min-width: 0; /* Allow flex/grid items to shrink below content size */
    width: 100% !important;
    max-width: 100% !important;
}

.masonry-container-grid .masonry-item.bio-card li *,
.masonry-container .masonry-item.bio-card li * {
    max-width: 100% !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}


.masonry-container-grid .masonry-item li:hover,
.masonry-container .masonry-item li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Exclude bio card from hover transform effect */
.bio-card li:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Blog Post embed containers */
.blog-post-embed-container {
    width: 100%;
    margin: 1rem 0;
    overflow: visible !important;
}

.blog-post-preview-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eae9e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: white !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post-preview-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-post-preview-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 300px;
}

.blog-post-preview-content {
    padding: 1rem;
    background-color: #f8f8f6 !important;
}

.blog-post-preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.4;
}

.blog-post-preview-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Instagram embed styles */
.instagram-embed-container {
    width: 100%;
    max-width: 540px; /* Instagram's max embed width */
    margin: 1rem auto;
    position: relative;
}

/* Wrapper to clip Instagram embed to show only header + square image */
.instagram-embed-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    /* border-radius: 8px; */
}

/* Instagram overlay for click-to-enlarge */
.instagram-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
    background: transparent;
}

/* Ensure masonry item doesn't clip Instagram embeds */
.masonry-item li:has(.instagram-embed-container),
.masonry-item li:has(.instagram-media) {
    overflow: visible !important;
}

.masonry-item li .instagram-embed-container,
.masonry-item li .instagram-media {
    position: relative;
    z-index: 1;
}

.instagram-embed {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.instagram-embed iframe,
.instagram-media iframe {
    width: 100% !important;
    max-width: 100% !important;
    border: none;
    border-radius: 8px;
    display: block;
    /* Height will be set dynamically via JavaScript to width + 54px */
}

.instagram-preview-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eae9e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.instagram-preview-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instagram-preview-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.instagram-preview-content {
    padding: 1rem;
}

.instagram-preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.instagram-preview-author {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.instagram-loading,
.instagram-error {
    padding: 2rem;
    text-align: center;
    color: #666;
}

.instagram-placeholder {
    padding: 2rem;
    text-align: center;
    color: #999;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

.blog-post-link {
    display: inline-block;
    color: #e84458;
    text-decoration: none;
    font-weight: 500;
}

.blog-post-link:hover {
    text-decoration: underline;
}

.blog-post-loading,
.blog-post-placeholder {
    padding: 2rem;
    text-align: center;
    color: #999;
    background: #f5f5f5;
    border-radius: 4px;
}

/* GitHub Repository embed containers */
.github-repo-container {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible !important;
    box-sizing: border-box;
}

/* GitHub repo preview link inside tiles */
.masonry-item li .github-repo-preview-link {
    width: 100% !important;
    margin: 0 !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.github-repo-preview-link {
    display: block;
    width: 100%;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eae9e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    background-color: #f8f8f6 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.github-repo-header img,
.github-repo-avatar,
.tile-preview li a .github-repo-avatar,
.masonry-item li .github-repo-avatar {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.github-repo-preview-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* GitHub repo name ellipsis handling */
.github-repo-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.masonry-item li .github-repo-name {
    max-width: calc(100% - 2rem) !important; /* Account for GitHub icon space */
}

.github-repo-loading,
.github-repo-placeholder {
    padding: 2rem;
    text-align: center;
    color: #999;
    background: #f5f5f5;
    border-radius: 4px;
}

.github-repo-link {
    display: inline-block;
    color: #e84458;
    text-decoration: none;
    font-weight: 500;
}

.github-repo-link:hover {
    text-decoration: underline;
}

/* Ensure masonry item doesn't clip GitHub repo embeds */
.masonry-item li:has(.github-repo-container) {
    overflow: visible !important;
}

.masonry-item li .github-repo-container {
    position: relative;
    z-index: 1;
}

/* Override boardz styles that might interfere */
.masonry-container-grid ul,
.masonry-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Column count is now dynamically calculated, but we keep responsive padding */
@media screen and (max-width: 768px) {
    .masonry-container {
        padding: 16px;
    }
}

@media screen and (max-width: 480px) {
    .masonry-container {
        padding: 12px;
    }
}

/* User tiles page styles */
.user-tiles-page {
    position: relative;
}

.masonry-container-grid {
    gap: 16px;
}

/* Left Side Filter Menu */
.category-filter-menu {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.filter-menu-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: #e84458;
    color: white;
    padding: 1rem 0.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    user-select: none;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.filter-menu-content {
    background: white;
    border: 1px solid #e4e3e0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
    box-sizing: border-box; /* Include padding in width calculation */
}

.filter-menu-search-container {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e4e3e0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.filter-menu-search-container .tiles-search-input {
    width: 100%;
    padding: 0.5rem;
    padding-right: 2rem;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.filter-menu-search-container .search-button {
    width: 100%;
    padding: 0.5rem;
    background: #e84458;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-sizing: border-box;
}

.filter-menu-search-container .search-button:hover {
    background: #d63347;
}

.filter-menu-search-container .search-button:active {
    background: #c5293c;
}

.filter-menu-search-container .search-clear-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.5rem;
    padding: 0.25rem;
    font-size: 0.8rem;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10;
}

.filter-menu-search-container .search-clear-btn:hover {
    color: #e84458;
}

.category-filter-menu:hover .filter-menu-content,
.category-filter-menu:focus-within .filter-menu-content {
    width: 140px;
    opacity: 1;
    min-width: 140px;
}

.category-filter-menu:hover .filter-menu-label,
.category-filter-menu:focus-within .filter-menu-label {
    border-radius: 0;
}

.category-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.category-filter-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e4e3e0;
    background: #faf9f9;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
    white-space: nowrap;
    box-sizing: border-box; /* Include padding and border in width */
}

.category-filter-btn:hover {
    border-color: #e84458;
    color: #e84458;
    transform: translateX(2px);
}

.category-filter-btn.active {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.category-filter-btn.active:hover {
    background: #5a6268;
    border-color: #5a6268;
    color: white;
}

/* Header with centered title */
.user-tiles-page .header {
    display: flex;
    justify-content: center;
    align-items: center;
    /* padding: 1rem 20px; */
    text-align: center;
}

.user-tiles-page .header .name {
    margin: 0;
}

/* On desktop, show UserTilesPage header and make it scroll-aware */
@media screen and (min-width: 769px) {
    .user-tiles-page .header {
        display: flex;
        position: relative;
    }
    
    /* Fix the title at top all the time on desktop */
    .user-tiles-page .header .name {
        position: fixed;
        top: 10px;
        z-index: 1002;
        padding: 0.5rem 0 0;
    }    
    
    
    /* Ensure navbar-desktop is visible and on top */
    .navbar-desktop {
        z-index: 1001;
    }
}

.tiles-search-input {
    flex: 1;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid #e4e3e0;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.tiles-search-input:focus {
    outline: none;
    border-color: #e84458;
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.search-clear-btn:hover {
    color: #e84458;
}

/* Mobile filter toggle button */
.mobile-filter-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1002;
    background: #e84458;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

.mobile-filter-toggle:hover {
    background: #d6354a;
    transform: scale(1.05);
}

.mobile-filter-toggle:active {
    transform: scale(0.95);
}

/* Mobile menu overlay */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile styles for filter menu */
@media screen and (max-width: 768px) {
    /* Make app-header logo and buttons smaller on mobile */
    .app-header-content .logo-link img {
        height: 33px;
    }
    
    .auth-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    /* Make app-header smaller on mobile */
    .app-header {
        height: auto;
        min-height: 50px;
    }
    
    .app-header-content {
        padding: 0.5rem 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Hide user menu buttons on mobile - they'll be in bottom nav */
    .app-header-content .user-menu-container {
        display: none;
    }
    
    /* Position UserTilesPage title in app-header on the right */
    .user-tiles-page .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 0;
        margin-top: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        z-index: 1001; /* Above app-header */
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 50px; /* Match app-header height */
        box-sizing: border-box;
        pointer-events: none; /* Allow clicks to pass through to app-header */
    }
    
    .user-tiles-page .header .name {
        font-size: 1rem;
        text-align: right;
        padding-right: 1rem;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 0 1 auto;
        max-width: calc(100% - 80px); /* Leave space for logo on left */
        pointer-events: auto; /* Re-enable clicks on title */
    }
    
    /* Hide mobile filter toggle button from top bar - it's now in bottom nav */
    .user-tiles-page .header .mobile-filter-toggle {
        display: none;
    }
    
    /* Add margin-top to masonry container to prevent tiles going under header */
    .user-tiles-page .masonry-container-grid,
    .user-tiles-page .masonry-container {
        margin-top: 60px; /* Space for app-header */
        margin-bottom: 80px; /* Space for bottom navigation */
    }
    
    /* Bottom navigation bar on mobile */
    .navbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: 60px;
        background: white;
        border-top: 1px solid #e9ecef;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .navbar-container {
        height: 100%;
        padding: 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
        max-width: 100%;
    }
    
    .navbar-logo {
        display: none; /* Hide logo in bottom nav */
    }
    
    .navbar-links {
        display: flex;
        gap: 0;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        padding: 0 0.5rem;
    }
    
    .navbar-links a,
    .navbar-links button {
        font-size: 0.75rem;
        padding: 0.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        flex: 1;
        text-align: center;
        max-width: 80px;
    }
    
    /* Hide text labels on bottom nav, show only icons if we add them */
    .navbar-links a {
        color: #666;
    }
    
    .navbar-links a:hover,
    .navbar-links button:hover {
        color: #e84458;
        opacity: 1;
    }
    
    .navbar-filter-btn {
        background: #e84458;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s ease;
        white-space: nowrap;
    }
    
    .navbar-filter-btn:hover {
        background: #d6354a;
    }
    
    .btn-logout {
        color: #dc3545;
        font-size: 0.75rem;
    }

    .category-filter-menu {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        transform: none;
        width: 280px;
        max-width: 80vw;
        z-index: 1002;
        background: white;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
        transition: left 0.3s ease;
        margin: 0;
        padding: 0;
        flex-direction: column;
        overflow-y: auto;
    }

    .category-filter-menu.mobile-menu-open {
        left: 0;
    }

    .filter-menu-label {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
        padding: 1rem;
        border-radius: 0;
        width: 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #e4e3e0;
    }

    .mobile-menu-close {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s ease;
    }

    .mobile-menu-close:hover {
        transform: scale(1.1);
    }

    .filter-menu-content {
        border: none;
        border-radius: 0;
        width: 100% !important;
        opacity: 1 !important;
        min-width: 100% !important;
        max-height: none;
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
    }
}

/* No tiles message */
.no-tiles-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
    font-style: italic;
}

.no-tiles-message p {
    margin: 0;
    font-size: 1rem;
}

/* Welcome empty state for new users */
.welcome-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-empty-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
    font-style: normal;
}

.welcome-empty-text {
    font-size: 2rem !important;
    color: #666;
    margin: 0 0 3rem 0;
    line-height: 1.6;
    font-style: normal;
    padding: 2rem 0;
}

.welcome-empty-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-style: normal;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: auto;
}

.welcome-empty-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Bio card styles */
.bio-card-collapsed li,
.bio-card-expanded li {
    background-color: transparent !important;
    border: none !important;
    padding: 8px !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Override masonry image rules for bio avatar - must be more specific */
.masonry-container-grid .masonry-item.bio-card-collapsed li .bio-avatar-container .bio-avatar,
.masonry-container .masonry-item.bio-card-collapsed li .bio-avatar-container .bio-avatar,
.bio-card-collapsed .bio-avatar,
.bio-card-collapsed .bio-avatar-collapsed,
.bio-card-collapsed .bio-avatar-expanded {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
}

.bio-card-collapsed .bio-avatar-fallback {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
}

/* Removed duplicate - now handled above */

.bio-card-expanded .bio-avatar-fallback {
    width: 120px !important;
    height: 120px !important;
    font-size: 2.5rem !important;
}

.bio-expand-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #e84458;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.bio-expand-btn:hover {
    transform: scale(1.1);
    color: #d6354a;
    background: rgba(232, 68, 88, 0.1);
}

.bio-expand-btn:focus {
    outline: 2px solid #e84458;
    outline-offset: 2px;
}

.bio-avatar-container {
    float: left;
    margin: 1rem 1rem 0.5rem 0;
    width: auto;
    height: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.bio-avatar {
    border-radius: 50%;
    object-fit: cover;
    display: block;
    transition: width 0.3s ease, height 0.3s ease;
    /* Size is controlled by .bio-avatar-collapsed and .bio-avatar-expanded classes */
}

.bio-avatar-collapsed {
    width: 80px !important;
    height: 80px !important;
}

.bio-avatar-expanded {
    width: 120px !important;
    height: 120px !important;
}


.bio-avatar-fallback {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease;
}

.bio-body {
    font-size: 90%;
    padding: 1rem 0 1rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.bio-card-collapsed li {
    overflow: hidden; /* Clear float for avatar container */
}

.bio-card-expanded li {
    overflow: visible; /* Allow content to flow when expanded */
}

.bio-card-expanded .bio-body {
    overflow: visible; /* Don't hide content when expanded */
}

.bio-paragraph {
    margin-bottom: 1em;
    font-style: italic;
}

.bio-link-container {
    margin-top: 0.5em;
}

.bio-link {
    color: #e84458;
    text-decoration: underline;
    cursor: pointer;
    font-style: normal;
}

.bio-link-inline {
    font-size: 0.8em;
    font-style: normal;
    margin-top: 0.5em;
}

.bio-link-inline-text {
    color: #e84458;
    text-decoration: underline;
    cursor: pointer;
    font-style: normal;
    text-align: right;
}

.bio-socials-container {
    /* margin-top: 1.5rem; */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent horizontal overflow */
}

.bio-socials-container:empty {
    margin-top: 0;
}

/* Ensure social links inside bio card respect width */
.masonry-item.bio-card .bio-socials-container,
.masonry-item.bio-card .bio-socials-container * {
    max-width: 100% !important;
    box-sizing: border-box;
}

.loading-more {
    text-align: center;
    padding: 2rem;
}

/* Create Tile Page */
.create-tile-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    /* margin: 4rem auto 2rem auto; */
    padding: 0 2rem;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.create-tile-form-section {
    flex: 0 1 600px;
    max-width: 600px;
    min-width: 0;
}

.create-tile-preview-section {
    flex: 0 1 400px;
    max-width: 400px;
    min-width: 0;
    position: sticky;
    top: 80px; /* Account for header height */
    align-self: flex-start;
    max-height: calc(100vh - 100px); /* Prevent it from exceeding viewport */
    overflow-y: auto; /* Allow scrolling if preview content is very tall */
}

.tile-form {
    margin-top: 2rem;
}

.create-tile-form-section .page-title {
    text-align: left;
}

.tile-preview {
    margin-top: 2rem;
    padding: 2rem;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 400px;
}

/* Ensure previewed images scale even when wrapped in anchors */
.tile-preview li > a {
    display: block;
    max-width: 100%;
}

.tile-preview li a img {
    width: 100% !important;
    height: auto !important;
    display: block;
}

@media screen and (max-width: 968px) {
    .create-tile-container {
        flex-direction: column;
        margin: 2rem auto;
        padding: 0 0.5rem;
    }
    
    .create-tile-form-section,
    .create-tile-preview-section {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }
    
    .create-tile-preview-section {
        position: sticky;
        top: 60px; /* Account for mobile header height */
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .tile-preview {
        margin: 0 auto;
        padding: 1rem 0.5rem;
    }
}

/* Explore Page */
.explore-tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.explore-user-tile-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.explore-user-tile-link:hover .explore-user-tile {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: #e84458;
}

.explore-user-tile-placeholder {
    cursor: default;
    opacity: 0.7;
}

.explore-user-tile {
    background: white;
    border: 1px solid #e4e3e0;
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.explore-user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.explore-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.explore-user-avatar-fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 2rem;
}

.explore-user-info {
    width: 100%;
}

.explore-user-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.explore-user-handle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.explore-user-tile-count {
    font-size: 0.875rem;
    color: #28a745;
    font-weight: 500;
}

@media screen and (max-width: 768px) {
    .explore-tiles-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        padding: 0 1rem;
    }
}

/* Image Lightbox */
.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* When used as modal container, ensure proper flex layout */
.image-lightbox-container.modal-container-padding {
    flex-direction: column;
    overflow: hidden;
    height: auto; /* Allow height to be determined by content, but constrained by max-height */
}

.image-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    z-index: 10001;
}

.image-lightbox-close:hover {
    opacity: 0.7;
}

.image-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 1rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10001;
}

.image-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.image-lightbox-prev {
    left: -80px;
}

.image-lightbox-next {
    right: -80px;
}

.image-lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-lightbox-image {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    object-fit: contain;
    border-radius: 4px;
}

.image-lightbox-caption {
    margin-top: 1rem;
    color: white;
    text-align: center;
    max-width: 80vw;
}

.image-lightbox-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.image-lightbox-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.image-lightbox-what {
    font-size: 1rem;
    opacity: 0.9;
}

.image-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

.picture-tile-clickable {
    display: block;
    width: 100%;
}

.picture-tile-clickable img {
    width: 100%;
    height: auto;
    display: block;
}

/* Placeholder for picture tiles without a valid image */
.picture-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e9e7e3;
    border: 1px solid #e0dedb;
    border-radius: 6px;
}

/* Avatar URL input styles */
.avatar-url-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e4e3e0;
    flex-shrink: 0;
    background: #f5f5f5;
    position: relative;
}

.avatar-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 3rem;
    position: absolute;
    top: 0;
    left: 0;
}

@media screen and (max-width: 768px) {
    .image-lightbox-overlay {
        padding: 1rem;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important; /* Explicit viewport width to avoid bio card interference */
        max-width: 100vw !important; /* Ensure it doesn't exceed viewport */
        box-sizing: border-box; /* Include padding in width */
        overflow: hidden; /* Prevent any overflow from affecting layout */
    }

    .image-lightbox-close {
        top: -40px;
        font-size: 1.5rem;
    }

    /* Mobile modal fixes - ensure buttons are always visible */
    .image-lightbox-container.modal-container-padding {
        max-height: 85vh; /* Fallback for older browsers */
        max-height: 85dvh; /* Dynamic viewport height - handles iOS Safari UI changes */
        height: 85vh; /* Fallback for older browsers */
        height: 85dvh; /* Dynamic viewport height - handles iOS Safari UI changes */
        padding: 0.75rem; /* Reduced padding on mobile */
        width: calc(100vw - 2rem) !important; /* Force viewport-based width - accounts for overlay padding */
        max-width: calc(100vw - 2rem) !important; /* Force max-width to prevent overflow */
        min-width: calc(100vw - 2rem) !important; /* Force min-width to prevent shrinking */
        box-sizing: border-box !important; /* Include padding in height calculation */
        position: relative; /* Ensure it's positioned correctly */
        margin: 0 auto; /* Center if needed */
    }

    .modal-text-center {
        max-height: 100%; /* Full height of container */
        height: 100%;
        box-sizing: border-box; /* Include margins in calculation */
    }

    .modal-title {
        margin-bottom: 0.75rem; /* Reduced margin on mobile */
        font-size: 1.1rem; /* Slightly smaller */
    }

    .modal-message {
        margin-bottom: 1rem; /* Reduced margin on mobile */
        font-size: 0.9rem; /* Slightly smaller */
    }

    .modal-children-container {
        max-height: none; /* Let flexbox handle it */
        margin-bottom: 0.75rem; /* Reduced margin */
        flex: 1 1 auto; /* Take available space but allow shrinking */
        min-height: 0; /* Critical for flexbox scrolling */
    }

    .modal-buttons-container {
        margin-top: 0.5rem; /* Reduced margin */
        flex-shrink: 0; /* Never shrink */
        padding-top: 0.5rem; /* Extra spacing */
    }

    .modal-container-padding {
        padding: 0.75rem; /* Reduced padding on mobile */
    }

    /* iPhone 13 specific fixes - more conservative height */
    @media screen and (max-width: 430px) and (max-height: 950px) and (-webkit-min-device-pixel-ratio: 2) {
        .image-lightbox-container.modal-container-padding {
            max-height: 80vh; /* Fallback */
            max-height: 80dvh; /* More conservative for iPhone 13 */
            height: 80vh; /* Fallback */
            height: 80dvh; /* More conservative for iPhone 13 */
        }
    }

    .image-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        padding: 0.75rem;
    }

    .image-lightbox-prev {
        left: -60px;
    }

    .image-lightbox-next {
        right: -60px;
    }

    .image-lightbox-image {
        max-height: calc(90vh - 80px);
    }

    .image-lightbox-title {
        font-size: 1.1rem;
    }

    .image-lightbox-subtitle,
    .image-lightbox-what {
        font-size: 0.9rem;
    }
}

