@import 'colours.css';

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-body);
    color: var(--color-text-secondary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Mobile-friendly tap highlights and smooth scrolling */
html {
    -webkit-tap-highlight-color: var(--color-tap-highlight);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth momentum scrolling on iOS */
body {
    -webkit-overflow-scrolling: touch;
}

/* Remove default button/link highlights on mobile */
button, a {
    -webkit-tap-highlight-color: var(--color-tap-highlight);
    tap-highlight-color: var(--color-tap-highlight);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg-hover);
    color: white;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    padding-left: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.header-left .logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-left h1 {
    margin: 0;
    padding: 0;
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #C8102E !important;
}

.logo-title {
    color: inherit;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.logo-text-compact {
    display: none;
}

.logo-page-title {
    color: #999;
    font-size: 0.7em;
    font-weight: 300;
    white-space: nowrap;
    margin-left: 2px;
}

.header-center {
    flex: 1 1 auto;
    text-align: center;
    min-width: 0;
}

#search-bar {
    width: 90%;
    max-width: 800px;
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: nowrap;
}

.header-right > a,
.header-right > button,
.header-right .profile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.mobile-search-toggle {
    display: none !important;
    padding: 10px 12px;
    border: 2px solid white;
    border-radius: 4px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.mobile-search-toggle:hover {
    background-color: var(--overlay-white-light);
}

header.header-no-mobile-search .mobile-search-toggle {
    display: none !important;
}

.email-page .mobile-search-toggle {
    display: none !important;
}

.sign-in-button {
    padding: 10px 15px;
    border: 2px solid white; /* White border for the Sign In button */
    border-radius: 4px; /* Rounded corners */
    color: white; /* White text */
    background: transparent; /* Transparent background */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s; /* Transition effect */
}

.sign-in-button:hover {
    background-color: var(--overlay-white-light); /* Light background on hover */
}

.sign-up-button {
    padding: 10px 15px;
    border: none; /* No border */
    border-radius: 4px; /* Rounded corners */
    color: white; /* White text */
    background-color: var(--color-primary-light); /* Classy red background */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s; /* Transition effect */
}

.sign-up-button:hover {
    background-color: var(--color-primary-hover); /* Darker red on hover */
}

/* Logged-in user buttons */
.upload-button {
    padding: 10px 15px;
    border: 2px solid white;
    border-radius: 4px;
    color: white;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.upload-button:hover {
    background-color: var(--overlay-white-light);
}

.email-button {
    padding: 10px 15px;
    border: 2px solid white;
    border-radius: 4px;
    color: white;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    position: relative;
}

.email-button:hover {
    background-color: var(--overlay-white-light);
}

.email-unread-badge {
    display: none;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    line-height: 1;
    text-align: center;
    position: absolute;
    top: -6px;
    right: -6px;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--color-bg-hover);
}

.profile-button {
    padding: 10px 15px;
    border: 2px solid var(--color-primary-light);
    border-radius: 4px;
    color: white;
    background: var(--color-primary-light);
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 1;
}

.profile-button:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

/* User dropdown menu */
.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    background-color: var(--color-bg-hover);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    padding: 12px 16px;
    z-index: 1;
    border-radius: 4px;
}

/* Bridge the gap between button and dropdown */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
}

.user-dropdown a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
    margin: -12px -16px;
    padding: 12px 16px;
}

.user-dropdown a:hover {
    background-color: var(--color-bg-button-hover);
}

@media (hover: hover) and (pointer: fine) {
    .user-menu:hover .user-dropdown {
        display: block;
    }
}

.user-menu.dropdown-open .user-dropdown {
    display: block;
}

.share-icons a {
    margin-left: 15px;
    font-size: 18px;
    color: white;
    text-decoration: none;
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: grey; /* Placeholder color for the circle */
    margin-left: 15px;
}

.intro-text {
    text-align: center;
    margin: 5px 0 10px 0;
    font-size: 14px;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 0 auto 20px;
    max-width: fit-content;
    border: 2px solid var(--color-border-light);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--color-bg-primary);
}

.sort-btn {
    padding: 10px 20px;
    border: none;
    border-right: 1px solid var(--color-border-light);
    border-radius: 0;
    background-color: transparent;
    color: var(--color-text-secondary);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    -webkit-user-select: none;
}

.sort-btn:last-child {
    border-right: none;
}

.sort-btn:hover {
    background-color: var(--color-bg-card);
    color: var(--color-text-primary);
}

.sort-btn.active {
    background-color: var(--color-primary);
    color: white;
}

.sort-btn.active:hover {
    background-color: var(--color-primary-dark);
}

/* Loading and error messages */
.loading-message,
.error-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: var(--color-text-subtle-dark);
}

.error-message {
    color: var(--color-primary);
}

.container {
    width: 95%;
    margin: 0 auto;
    flex: 1;
}

/* Constrain width for single post/gallery views */
.image-view {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.gallery {
    width: 100%;
    margin: 0 auto;
}

.gallery.masonry-loading {
    opacity: 0;
}

.gallery.masonry-ready {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

/* Grid sizer for masonry columns */
.gallery-sizer {
    width: 25%; /* 4 columns */
}

@media (max-width: 1200px) {
    .gallery-sizer {
        width: 33.333%; /* 3 columns */
    }
}

@media (max-width: 768px) {
    .gallery-sizer {
        width: 50%; /* 2 columns */
    }
    
    .image-view {
        max-width: 100%;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .gallery-sizer {
        width: 100%; /* 1 column */
    }
    
    .image-view {
        max-width: 100%;
        padding: 0 5px;
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--overlay-darkest);
    color: white;
    text-align: center;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

footer {
    background-color: var(--color-bg-hover);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    position: static;
    bottom: auto;
    width: 100vw;
    max-width: 100%;
    border-top: 1px solid var(--color-border-lighter);
    box-sizing: border-box;
}

footer p {
    margin: 0;
    font-size: 14px;
}

.loader {
    text-align: center;
    padding: 10px;
}

.header-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.search-container {
    position: relative;
    width: 80%; /* Reduced the width */
    max-width: 800px; /* Set a max width to prevent the box from being too wide */
}

#search-bar {
    width: 100%;
    padding: 5px 35px 5px 10px; /* Adjust padding to accommodate the icon */
    border-radius: 4px;
    border: none;
    box-sizing: border-box; /* Ensure padding is included in the element's width */
}

#search-form {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
}

.logo-link {
    text-decoration: none; /* Removes underline */
    color: inherit; /* Inherits color from parent element */
}

.logo-link h1 {
    margin: 0; /* Remove default margins */
    color: inherit; /* Ensure the color remains unchanged */
}

/* Form Styling - Modern Upload Style */
.form-container {
    background: var(--gradient-card);
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--color-border-tertiary);
}

.form-container h2 {
    color: var(--color-text-primary);
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.form-container a {
    color: var(--color-accent-coral);
    text-decoration: none;
}

.form-container a:hover {
    color: var(--color-accent-coral);
    text-decoration: underline;
}

/* Form actions - side-by-side buttons */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    flex: 1;
    min-width: 0;
}

.form-actions .btn-secondary {
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.content-builder {
    width: 100%;
    margin: 20px auto;
    padding: 0 20px 40px;
    box-sizing: border-box;
}

.builder-shell {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.content-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border-primary);
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    margin-bottom: 20px;
}

.content-tab {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 600;
    background: var(--color-bg-primary);
    color: var(--color-text-subtle-dark);
    border: 1px solid var(--color-border-primary);
    border-bottom: none;
    transition: all 0.2s ease;
}

.content-tab + .content-tab {
    border-left: none;
}

.content-tab:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
}

.content-tab.is-active {
    background: var(--color-primary);
    color: var(--color-text-primary);
    border-color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary);
    margin-bottom: -2px;
}

.builder-header {
    text-align: center;
    margin-bottom: 20px;
}

.builder-header h2 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 28px;
    font-weight: 600;
}

.builder-header p {
    margin: 6px 0 0;
    color: var(--color-text-subtle-dark);
    font-size: 14px;
}

.content-callout {
    background: var(--gradient-primary);
    border: 1px solid var(--color-primary-transparent-40);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: var(--color-text-tertiary);
    text-align: left;
    position: relative;
}

.content-callout__primary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    padding-right: 80px;
}

.content-callout__label {
    margin: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-white-transparent-70);
}

.content-callout__value {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-white-transparent-85);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.content-callout__meta {
    margin: 8px 0 0;
    color: var(--color-text-white-transparent-75);
    font-size: 0.95rem;
}

.content-callout__icon {
    margin-right: 6px;
}

.content-callout__note {
    margin: 10px 0 0;
    color: var(--color-text-white-transparent-65);
    font-size: 0.85rem;
}

.hashtag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.hashtag-chip:hover {
    background: var(--color-bg-hover-intense);
    transform: translateY(-1px);
}

.hashtag-chip.is-primary {
    background: var(--color-primary);
    cursor: grab;
}

.hashtag-chip.is-primary:hover {
    background: var(--color-primary-hover);
}

.hashtag-chip.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-subtle);
    margin-top: 6px;
}

.hashtag-preview {
    margin-top: 12px;
    padding: 10px;
    background: var(--color-bg-primary);
    border-radius: 6px;
}

.hashtag-preview__label {
    color: var(--color-primary);
    font-weight: 600;
}

.hashtag-preview__list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--color-border-tertiary);
    border-radius: 8px;
    background-color: var(--color-bg-primary);
    color: var(--color-text-secondary);
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary-light);
    background-color: var(--color-bg-secondary);
    box-shadow: 0 0 0 3px var(--color-primary-light-transparent-10);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Input Styling - Drag and Drop Style */
.file-input-container {
    position: relative;
    margin-bottom: 15px;
}

.file-input-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 30px 20px;
    border: 2px dashed var(--color-border-tertiary);
    border-radius: 8px;
    background-color: var(--color-bg-primary);
    color: var(--color-text-subtle);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 120px;
    position: relative;
}

.file-input-trigger:hover {
    border-color: var(--color-primary-light);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
}

.file-input-trigger.drag-over {
    border-color: var(--color-primary-light);
    background-color: var(--color-primary-light-transparent-10);
    color: var(--color-primary-light);
}

#remove-image:hover {
    background: var(--color-primary-light-opaque) !important;
    transform: scale(1.1);
}

.form-group input[type="file"] {
    display: none;
}

.form-group small {
    display: block;
    color: var(--color-text-subtle-dark);
    font-size: 12px;
    margin-top: 10px;
}

/* Button Styling */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    background-color: var(--color-primary-light);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    box-sizing: border-box;
}

.btn:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--color-primary-light-transparent-30);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--color-bg-button-hover);
}

.btn-secondary:hover {
    background-color: var(--color-bg-disabled);
    box-shadow: 0 5px 15px rgba(85, 85, 85, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    width: auto;
    display: inline-block;
}

.btn-danger {
    background-color: var(--color-primary-light);
}

.btn-danger:hover {
    background-color: var(--color-primary-hover);
}

/* Message Styling */
.error-message {
    background-color: var(--color-primary-light-transparent-15);
    border: 1px solid var(--color-primary-light);
    border-radius: 8px;
    color: var(--color-error-pink);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background-color: var(--color-success-transparent-15);
    border: 1px solid var(--color-success);
    border-radius: 8px;
    color: var(--color-success-light);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Search Form Styling */
#search-form {
    width: 100%;
    display: flex;
    align-items: center;
}

#search-form #search-bar {
    flex: 1;
    width: 100%;
    padding: 8px 12px 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--color-border-lighter);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    font-size: 14px;
}

#search-form #search-bar:focus {
    outline: none;
    border-color: var(--color-primary-light);
    background-color: var(--color-bg-card);
}

#search-form .search-icon {
    background: none;
    border: none;
    color: var(--color-text-subtle);
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

#search-form .search-icon:hover {
    color: var(--color-primary-light);
}

/* Search Results Page */
.search-results-container {
    margin: 30px auto;
}

.search-header {
    text-align: center;
    margin-bottom: 30px;
}

.search-header h2 {
    color: var(--color-text-primary);
    font-size: 28px;
    margin: 0 0 10px 0;
}

.search-info {
    color: var(--color-text-subtle-dark);
    font-size: 14px;
    margin: 0;
}

.search-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.search-empty-state h2 {
    color: var(--color-text-primary);
    font-size: 28px;
}

.search-empty-state p {
    color: var(--color-text-subtle-dark);
    font-size: 14px;
}

.search-tip {
    color: var(--color-text-placeholder);
    font-size: 12px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--gradient-card);
    border-radius: 12px;
    border: 1px solid var(--color-border-tertiary);
}

.no-results p {
    color: var(--color-text-secondary);
    margin: 10px 0;
}

.search-section {
    margin-bottom: 40px;
}

.search-section h3 {
    color: var(--color-text-primary);
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: capitalize;
}

/* Users Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.user-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border-tertiary);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.user-card:hover {
    border-color: var(--color-primary-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--color-primary-light-transparent-10);
}

.user-avatar {
    margin-bottom: 15px;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border-tertiary);
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--color-bg-button-hover);
    margin: 0 auto;
}

.user-info h4 {
    margin: 0 0 10px 0;
    color: var(--color-text-primary);
}

.user-info h4 a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.user-info h4 a:hover {
    color: var(--color-primary-light);
}

.user-bio {
    color: var(--color-text-subtle-dark);
    font-size: 12px;
    margin: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.gallery-card:hover {
    transform: scale(1.05);
}

.gallery-card a {
    display: block;
    width: 100%;
}

.gallery-card a > .thumb-wrap {
    display: block;
    width: 100%;
    position: relative;
    background: var(--gradient-loading);
    overflow: hidden;
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.gallery-card img.lazy-img {
    background: var(--gradient-loading);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.gallery-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--color-bg-elevated-card);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-button-hover);
    color: var(--color-text-subtle);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gradient-overlay-dark);
    padding: 20px 15px 15px;
    color: white;
}

.gallery-overlay h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--color-text-primary);
}

.gallery-meta {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Gallery Item Containers (for gallery view page) */
.gallery-items-container {
    max-width: 100%;
    box-sizing: border-box;
}

.gallery-item-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.gallery-item-content {
    max-width: 100%;
    box-sizing: border-box;
}

/* Image Card */
.image-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    margin-bottom: 17px;
    width: 280px;
    break-inside: avoid; /* Prevent splitting across CSS columns */
}

.image-card:hover {
    transform: scale(1.02);
}

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

.image-card a {
    display: block;
    width: 100%;
}

.image-card a > .thumb-wrap {
    width: 100%;
    position: relative;
    background: var(--gradient-loading);
    overflow: hidden;
}

/* Lazy loading placeholder animation */
.image-card img.lazy-img {
    background: var(--gradient-loading);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    width: 100%;
    display: block;
}

/* Ensure badges remain compact and top-right regardless of generic rules */
.content-badge {
    width: auto;
    height: auto;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gradient-overlay-darker);
    padding: 15px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-info {
    opacity: 1;
}

.image-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.image-info p {
    margin: 5px 0;
    font-size: 12px;
}

.image-author {
    font-size: 11px;
    opacity: 0.8;
}

/* YouTube card specific styles */
.youtube-card {
    position: relative;
}

.youtube-card a {
    display: block;
    width: 100%;
}

.youtube-card a > .thumb-wrap {
    display: block;
    width: 100%;
    position: relative;
    background: var(--gradient-loading);
    overflow: hidden;
}

.youtube-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.youtube-card img.lazy-img {
    background: var(--gradient-loading);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

/* Unified content badge system - top right corner - SVG icons only */
.content-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    pointer-events: none; /* Allow clicks to pass through to the link below */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.content-badge .badge-icon {
    display: block;
    width: 22px;
    height: 22px;
}

/* Text post card thumbnail placeholder */
.text-card .text-thumb,
.text-thumb {
    width: 100%;
    height: 180px;
    min-height: 180px;
    background: var(--gradient-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-bottom: 1px solid var(--color-border-primary);
}

.text-thumb-title {
    color: var(--color-text-secondary);
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    padding: 0 8px;
}

/* Ensure link underline color for cards is white, not browser default blue/purple */
.image-card a {
    text-decoration: none;
    color: inherit;
}

.text-card a:hover .text-thumb-title {
    text-decoration: underline;
    text-decoration-color: var(--color-text-primary);
}

/* Legacy class name support */
.gallery-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-primary-transparent-95);
    color: var(--color-text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Legacy play icon - replaced with badge system */
.play-icon {
    display: none;
}

/* Image overlay - Hidden as info now shown in card-info-bar */
.image-overlay {
    display: none;
}

.image-overlay h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--color-text-primary);
}

.image-overlay a {
    color: var(--color-text-primary) !important;
    text-decoration: none;
    pointer-events: all;
}

.image-overlay a:visited {
    color: var(--color-text-primary) !important;
}

.image-overlay .username-link {
    color: var(--color-text-primary);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    z-index: 10;
}

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

.image-overlay a:hover {
    text-decoration: underline;
    text-decoration-color: var(--color-text-primary) !important;
}

.image-meta {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

.image-meta a {
    color: var(--color-text-primary) !important;
    text-decoration: none;
}

/* Card Info Bar - Elegant stats and user info at bottom of cards */
.card-info-bar {
    background: var(--color-bg-elevated);
    padding: 8px 12px;
    border-top: 1px solid var(--color-border-primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.card-info-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.card-stat-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    /* Prevent touch highlight on mobile */
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .card-stat-btn:not([disabled]):not(.active):hover {
        background: var(--color-bg-hover);
        color: var(--color-text-primary);
        transform: translateY(-1px);
    }
}

.card-stat-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.card-stat-btn .stat-icon {
    font-size: 14px;
    line-height: 1;
}

.card-stat-btn .stat-value {
    font-weight: 600;
    font-size: 11px;
}

/* Make emoji icons grayscale by default */
.card-stat-btn .stat-icon {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

/* Hover states - only on non-active buttons */
@media (hover: hover) {
    .card-stat-btn:not([disabled]):not(.active):hover .stat-icon {
        filter: grayscale(0%);
        opacity: 1;
    }
}

/* Active vote states */
.card-stat-btn.active {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.card-stat-btn.active .stat-icon {
    filter: grayscale(0%);
    opacity: 1;
}

.card-stat-btn[data-vote="lit"].active {
    color: var(--color-primary-light);
}

.card-stat-btn[data-vote="cringe"].active {
    color: var(--color-text-muted);
}

.card-info-user {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.card-info-user .clout-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    filter: grayscale(100%);
    opacity: 0.7;
    display: inline-block;
    vertical-align: middle;
    height: 16px;
    width: 16px;
    text-align: center;
}

.card-user-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.card-user-link:hover {
    color: var(--color-text-primary);
}

.card-user-link .username-text {
    font-size: 12px;
}

.card-description-preview {
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 400;
}

/* Share notification toast */
.share-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-bg-elevated-card);
    color: var(--color-text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border-light);
}

.share-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments for info bar */
@media (max-width: 768px) {
    .card-info-bar {
        padding: 6px 10px;
        gap: 5px;
    }
    
    .card-stat-btn {
        padding: 3px 5px;
        font-size: 10px;
        gap: 2px;
    }
    
    .card-stat-btn .stat-icon {
        font-size: 12px;
    }
    
    .card-stat-btn .stat-value {
        font-size: 10px;
    }
    
    .card-info-user {
        font-size: 11px;
        gap: 3px;
        display: flex;
        align-items: center;
        line-height: 1.3;
    }
    
    .card-info-user .clout-icon {
        font-size: 13px;
        line-height: 1;
        flex-shrink: 0;
        display: inline-block;
        vertical-align: middle;
        height: 16px;
        width: 16px;
        text-align: center;
    }
    
    .card-user-link {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0;
        line-height: 1.3;
    }
    
    .card-user-link .username-text {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .card-description-preview {
        font-size: 10px;
        line-height: 1.3;
        display: inline;
    }
}

@media (max-width: 480px) {
    .card-info-stats {
        gap: 2px;
    }
    
    .card-stat-btn {
        padding: 2px 4px;
    }
    
    .card-description-preview {
        display: inline; /* Keep description visible on small screens */
    }
}

.image-meta a:visited {
    color: var(--color-text-primary) !important;
}

.image-meta a:hover {
    text-decoration: underline;
    text-decoration-color: var(--color-text-primary) !important;
}

/* Voting System Styles */
.image-voting {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--color-bg-primary);
    border-radius: 8px;
    border: 1px solid var(--color-border-primary);
}

.vote-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.vote-btn:hover {
    background-color: var(--color-bg-input);
    border-color: var(--color-border-lighter);
}

.vote-btn.active {
    background-color: var(--color-accent-coral);
    border-color: var(--color-accent-coral);
    color: var(--color-text-primary);
}

.vote-icon {
    font-size: 18px;
}

.vote-count {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.vote-net-score {
    margin-left: auto;
    font-size: 14px;
    color: var(--color-text-muted-darker);
}

.net-score {
    font-weight: bold;
    font-size: 16px;
    color: var(--color-text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 30px 20px;
        margin: 20px 10px;
    }

    .form-container h2 {
        font-size: 24px;
    }
    
    /* Keep buttons side-by-side on mobile unless very small */
    .form-actions {
        gap: 10px;
    }

    .file-input-trigger {
        padding: 30px 15px;
        min-height: 120px;
    }

    .vote-container {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .image-voting {
        max-width: 100%;
        box-sizing: border-box;
    }

    .vote-net-score {
        margin-left: 0;
        order: 3;
        width: 100%;
        padding-top: 10px;
    }
}

/* Comments System Styles */
.comments-section {
    margin-top: 40px;
    margin-bottom: 60px; /* Add space before footer on desktop */
    padding-top: 20px;
    border-top: 1px solid var(--color-border-primary);
}

.comments-section h3 {
    margin-top: 0;
    color: var(--color-text-secondary);
    font-size: 20px;
}

.comment-form-container {
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--color-bg-primary);
    border-radius: 8px;
    border: 1px solid var(--color-border-primary);
}

.comment-error {
    padding: 12px 15px;
    background-color: var(--color-bg-error);
    border: 1px solid var(--color-error-muted);
    border-radius: 6px;
    color: var(--color-error-light);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-form textarea {
    padding: 10px;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text-secondary);
    font-family: Arial, sans-serif;
    font-size: 14px;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-accent-coral);
    background-color: var(--color-bg-hover);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-form-footer .btn {
    width: auto;
    padding: 8px 20px;
}

.reply-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.reply-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-bg-hover);
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--color-text-primary);
}

.remove-reply {
    background: none;
    border: none;
    color: var(--color-accent-red-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    margin: 0;
    font-weight: bold;
}

.remove-reply:hover {
    color: var(--color-primary);
}

.character-count {
    font-size: 12px;
    color: var(--color-text-muted-darker);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-card {
    padding: 15px;
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: 6px;
    border-left: 3px solid var(--color-accent-coral);
}

.comment-card.shadowbanned {
    opacity: 0.6;
    background-color: var(--color-bg-dark-red);
    border-left-color: var(--color-accent-red-muted);
}

.comment-card.shadowbanned::before {
    content: "[Shadowbanned]";
    display: block;
    color: var(--color-accent-red-muted);
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.comment-username {
    color: var(--color-accent-coral);
    font-size: 14px;
}

.comment-username-link {
    color: var(--color-accent-coral);
    text-decoration: underline;
    text-decoration-color: var(--color-accent-coral);
}

.comment-username-link:hover {
    color: var(--color-accent-coral);
    text-decoration-color: var(--color-accent-coral);
    opacity: 0.8;
}

/* Anonymous user admin info */
.anon-vpn-badge {
    font-size: 11px;
    padding: 2px 5px;
    margin-left: 5px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    border-radius: 3px;
    color: #e74c3c;
    font-weight: 600;
}

.anon-country-flag {
    margin-left: 4px;
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: var(--color-text-subtle-dark);
}

.comment-delete-btn {
    padding: 4px 8px;
    font-size: 12px;
    background-color: var(--color-accent-red-muted);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.comment-delete-btn:hover {
    background-color: var(--color-accent-red-alt);
}

.comment-content {
    color: var(--color-text-bright);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-quote {
    margin: 4px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--color-accent-coral);
    background-color: var(--color-bg-hover);
    color: var(--color-text-muted);
    font-style: italic;
}

/* Comment Voting and Reply Styles */
.comment-item {
    padding: 15px 0;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border-primary);
    border-left: 3px solid transparent;
    padding-left: 12px;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-item.new-comment {
    border-left-color: var(--color-accent-coral);
}

.comment-item.highlighted {
    background-color: rgba(255, 215, 100, 0.15);
    border: 2px solid var(--color-warning);
    border-left: 3px solid var(--color-warning);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.3);
}

.comment-item.shadowbanned {
    opacity: 0.6;
    background-color: var(--color-bg-dark-red);
    border-left-color: var(--color-accent-red-muted);
}

.comment-item.shadowbanned::before {
    content: "[Shadowbanned]";
    display: block;
    color: var(--color-accent-red-muted);
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
}

.comment-item.collapsed .comment-content-wrapper {
    display: none;
}

.comment-item.collapsed {
    padding: 4px 8px;
    min-height: auto;
}

.comment-item.collapsed .comment-header {
    margin-bottom: 0;
}

.comment-item.collapsed .comment-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.comment-item.collapsed .comment-date,
.comment-item.collapsed .reply-indicator {
    display: none;
}

.comment-item.collapsed .comment-header-right {
    display: none;
}

/* Show collapsed info only when collapsed */
.collapsed-info {
    display: none;
    font-size: 12px;
    color: var(--color-text-muted);
}

.comment-item.collapsed .collapsed-info {
    display: inline;
}

.collapsed-votes {
    font-weight: 600;
    color: var(--color-text-primary);
}

.collapsed-votes.negative {
    color: var(--color-text-muted-darker);
}

.comment-content-wrapper {
    display: flex;
    gap: 10px;
}

.comment-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 40px;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    text-align: center;
    transition: color 0.2s ease;
    font-weight: bold;
}

.collapse-btn:hover {
    color: var(--color-accent-coral);
}

.comment-main {
    flex: 1;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.comment-votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.comment-vote-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
    width: 100%;
    justify-content: center;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.comment-vote-btn .vote-arrow {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    min-width: 14px;
    text-align: center;
}

.comment-vote-btn.active .vote-arrow {
    font-size: 14px;
}

.comment-vote-btn:not(.active):hover {
    color: var(--color-text-primary);
}

.comment-vote-btn.active {
    color: var(--color-text-primary);
    font-weight: 600;
}

.comment-upvote.active {
    color: var(--color-success);
}

.comment-downvote.active {
    color: var(--color-primary-light);
}

.net-score {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 6px;
    color: var(--color-text-muted);
}

.net-score.positive {
    color: var(--color-success);
}

.net-score.negative {
    color: var(--color-primary-light);
}

.reply-btn {
    background: none;
    border: 1px solid var(--color-border-light);
    color: var(--color-text-subtle);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.reply-btn:hover {
    background-color: var(--color-bg-hover);
    border-color: var(--color-accent-coral);
    color: var(--color-accent-coral);
}

.reply-count {
    font-size: 12px;
    color: var(--color-text-muted-darker);
    margin-right: 6px;
}

.reply-user-link {
    font-size: 12px;
    color: var(--color-accent-coral);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.reply-user-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.reply-indicator {
    font-size: 12px;
    color: var(--color-accent-coral);
    font-weight: bold;
    background-color: var(--color-bg-hover);
    padding: 2px 6px;
    border-radius: 3px;
}

.reply-context {
    font-size: 12px;
    color: var(--color-text-muted-darker);
    margin-top: 8px;
}

.reply-context .reply-link {
    color: var(--color-accent-coral);
    text-decoration: none;
}

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

.cancel-reply-btn {
    padding: 8px 15px;
    font-size: 14px;
    background-color: var(--color-bg-hover);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    color: var(--color-text-subtle);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-reply-btn:hover {
    background-color: var(--color-bg-card);
    border-color: var(--color-accent-coral);
}

.no-comments {
    text-align: center;
    color: var(--color-text-subtle-dark);
    font-size: 14px;
    padding: 20px;
}

/* Responsive Comments */
@media (max-width: 768px) {
    .comment-header {
        flex-direction: row; /* Keep horizontal layout */
        align-items: center;
        flex-wrap: nowrap; /* Prevent wrapping */
        margin-bottom: 2px; /* Minimal spacing on mobile */
    }
    
    .comment-header-left {
        flex: 1; /* Allow left side to grow */
        min-width: 0; /* Allow text to wrap if needed */
    }
    
    .comment-header-right {
        flex-shrink: 0; /* Keep reply button at natural size */
    }
    
    .comment-delete-btn {
        margin-left: 0 !important;
    }
    
    /* Tighten spacing between up/down vote buttons on mobile */
    .comment-vote-btn {
        padding: 0px 10px;
    }
    
    .comment-form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comment-form-footer .btn {
        width: 100%;
    }
}

/* Post Type Selector */
.post-type-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.post-type-selector input[type="radio"] {
    display: none;
}

.post-type-selector .type-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border: 2px solid var(--color-border-tertiary);
    border-radius: 8px;
    background-color: var(--color-bg-primary);
    color: var(--color-text-subtle);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.post-type-selector .type-label:hover {
    border-color: var(--color-primary-light);
    color: var(--color-text-secondary);
    background-color: var(--color-bg-secondary);
}

.post-type-selector input[type="radio"]:checked + .type-label {
    border-color: var(--color-primary-light);
    background-color: var(--color-primary-light);
    color: white;
}

/* YouTube Container */
/* Image Container */
.image-container {
    width: 100%;
    max-width: 90%;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Don't stretch small images larger than their natural size */
    width: auto;
    max-height: 90vh;
}

.image-container img:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .image-container {
        max-width: 100%;
        margin: 0 auto; /* Remove top/bottom margin on mobile */
    }
}

.youtube-container {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.youtube-container iframe {
    border-radius: 8px;
    display: block;
}

/* Video Controls */
.video-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    margin-top: 8px;
}

.video-control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-bg-hover);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.video-control-btn:hover {
    background: var(--color-bg-light);
    border-color: var(--color-primary);
    color: var(--color-text-bright);
}

.video-control-btn.active {
    background: var(--color-primary-transparent-10);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.video-control-btn.active:hover {
    background: var(--color-primary-transparent-20);
}

.video-control-btn svg {
    transition: transform 0.3s ease;
}

.video-control-btn.active svg {
    color: var(--color-primary);
}

.video-control-btn:active {
    transform: scale(0.95);
}

/* Text Post Container */
.text-post-container {
    font-size: 16px;
    font-family: Arial, sans-serif;
    color: var(--color-text-bright);
    margin: 20px 0;
    min-height: 300px;
}

/* Text Post Formatting Styles */
.text-post-paragraph {
    margin: 0 0 8px 0;
    line-height: 1.6;
    /* make it left aligned */
    text-align: left;
}

.text-post-heading {
    color: var(--color-brand-primary);
    margin: 16px 0 10px 0;
    font-weight: 600;
    line-height: 1.3;
}

.text-post-container h1.text-post-heading { font-size: 2em; }
.text-post-container h2.text-post-heading { font-size: 1.75em; }
.text-post-container h3.text-post-heading { font-size: 1.5em; }
.text-post-container h4.text-post-heading { font-size: 1.25em; }
.text-post-container h5.text-post-heading { font-size: 1.1em; }
.text-post-container h6.text-post-heading { font-size: 1em; }

.text-post-bold {
    font-weight: 900;
    color: var(--color-text-bright);
}

.text-post-italic {
    font-style: italic;
}

.text-post-underline {
    text-decoration: underline;
    text-decoration-color: var(--color-brand-primary);
}

.text-post-strikethrough {
    text-decoration: line-through;
    opacity: 0.7;
}

.text-post-superscript {
    font-size: 0.75em;
    vertical-align: super;
}

.text-post-subscript {
    font-size: 0.75em;
    vertical-align: sub;
}

.text-post-link {
    color: var(--color-brand-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.text-post-link:hover {
    border-bottom-color: var(--color-brand-primary);
    opacity: 0.8;
}

.text-post-link:visited {
    color: var(--color-brand-accent);
}

.text-post-list {
    margin: 12px 0;
    padding-left: 25px;
}

.text-post-list li {
    margin: 6px 0;
    line-height: 1.6;
}

.text-post-quote {
    border-left: 4px solid var(--color-brand-primary);
    padding: 12px 16px;
    margin: 16px 0;
    background: rgba(200, 16, 46, 0.1);
    font-style: italic;
    color: var(--color-text-secondary);
}

.text-post-hr {
    border: none;
    border-top: 2px solid var(--color-border);
    margin: 24px 0;
    opacity: 0.5;
}

.text-post-code-block {
    background: #0d0d0d;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    position: relative;
}

.text-post-code-block .code-lang {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    opacity: 0.6;
}

.text-post-code-block pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-bright);
}

.text-post-code-block code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    color: var(--color-text-bright);
}

.text-post-inline-code {
    background: rgba(200, 16, 46, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-brand-primary);
    border: 1px solid rgba(200, 16, 46, 0.3);
}

/* Mobile-specific adjustments for text formatting */
@media (max-width: 768px) {
    .text-post-container {
        font-size: 15px;
        padding: 16px;
    }
    
    .text-post-container h1.text-post-heading { font-size: 1.75em; }
    .text-post-container h2.text-post-heading { font-size: 1.5em; }
    .text-post-container h3.text-post-heading { font-size: 1.35em; }
    .text-post-container h4.text-post-heading { font-size: 1.2em; }
    
    .text-post-code-block {
        padding: 12px;
        font-size: 13px;
    }
    
    .text-post-list {
        padding-left: 20px;
    }
    
    .text-post-quote {
        padding: 10px 12px;
        font-size: 0.95em;
    }
}

/* Link Post Card */
.link-post-card {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    max-height: 600px;
    text-decoration: none;
    margin: 20px 0;
}

.link-post-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease;
}

.link-post-card:hover img {
    filter: brightness(0.7);
}

.link-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay-dark);
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.link-post-card:hover .link-post-overlay {
    opacity: 1;
}

/* Avatar Cropper Styles */
.avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 0 auto 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.avatar-placeholder:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.avatar-placeholder-icon {
    font-size: 60px;
    color: white;
    font-weight: bold;
}

.avatar-display {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    display: block;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.avatar-display:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

/* Avatar Cropper Modal */
.cropper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-modal);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.cropper-modal.active {
    display: flex;
}

.cropper-modal-content {
    background: var(--color-bg-primary);
    border-radius: 8px;
    padding: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cropper-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 15px;
}

.cropper-modal-header h3 {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 20px;
}

.cropper-modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cropper-modal-close:hover {
    color: var(--color-success-vibrant);
}

#cropper-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#cropper-container canvas {
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.cropper-size-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-bg-body);
    border-radius: 4px;
}

.cropper-size-controls label {
    color: var(--color-text-secondary);
    font-weight: bold;
    min-width: 100px;
}

.size-slider {
    flex: 1;
    min-width: 150px;
    height: 6px;
    border-radius: 3px;
    background: var(--color-bg-button);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.size-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-success-vibrant);
    cursor: pointer;
    transition: background 0.2s;
}

.size-slider::-webkit-slider-thumb:hover {
    background: var(--color-success-darkest);
}

.size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-success-vibrant);
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.size-slider::-moz-range-thumb:hover {
    background: var(--color-success-darkest);
}

#crop-size-display {
    color: var(--color-success-vibrant);
    font-weight: bold;
    min-width: 60px;
    text-align: right;
}

.cropper-preview {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-bg-body);
    border-radius: 4px;
}

.cropper-preview-label {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cropper-preview-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--color-success-vibrant);
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.cropper-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--color-border-light);
    padding-top: 15px;
}

.cropper-modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.cropper-btn-cancel {
    background: var(--color-bg-button);
    color: var(--color-text-secondary);
}

.cropper-btn-cancel:hover {
    background: var(--color-bg-button-hover);
}

.cropper-btn-crop {
    background: var(--color-success-vibrant);
    color: white;
}

.cropper-btn-crop:hover {
    background: var(--color-success-darkest);
}

.hidden-file-input {
    display: none;
}

.avatar-form-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hashtag Links */
.hashtag-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
}

.hashtag-link:hover {
    background: var(--color-primary-transparent-10);
    text-decoration: underline;
}

.primary-hashtag-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-darker) 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 10px;
}

.primary-hashtag-badge .icon {
    font-size: 1.1em;
}

/* Gallery header tightening and primary tag positioning */
.image-header {
    position: relative;
    margin-bottom: 10px;
}
.image-header .gallery-title-heading {
    margin: 6px 0 2px 0;
}
.primary-hashtag-floating {
    position: absolute;
    right: 0;
    top: 0;
}
@media (max-width: 768px) {
    .primary-hashtag-floating {
        position: static;
        display: flex;
        justify-content: flex-end;
        margin: 6px 0 0 0;
    }
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet and smaller devices (768px and below) */
@media (max-width: 768px) {
    /* Header adjustments for tablets/phones */
    header {
        flex-wrap: nowrap;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .header-left h1 {
        font-size: 18px;
    }

    /* Show full logo when logged out */
    .logo-text-full {
        display: inline;
    }

    .logo-text-compact {
        display: none;
        font-size: 24px;
    }

    /* Show compact logo only when logged in */
    header.user-logged-in .logo-text-full {
        display: none;
    }

    header.user-logged-in .logo-text-compact {
        display: inline;
        font-size: 24px;
    }

    .logo-page-title {
        display: none;
    }
    
    /* Make search bar full width on smaller screens */
    .header-center {
        order: 3;
        flex-basis: 100%;
        width: 100%;
        margin-top: 10px;
        display: none;
    }
    
    .search-container {
        width: 100%;
        max-width: 100%;
    }
    
    #search-bar {
        font-size: 16px; /* Prevent iOS zoom on focus */
        padding: 10px 40px 10px 15px;
    }
    
    /* Header buttons - make them smaller and adjust spacing */
    .header-right {
        gap: 6px;
        margin-left: auto;
        justify-content: flex-end;
    }

    .mobile-search-toggle {
        display: inline-flex !important;
    }

    .sign-in-button,
    .sign-up-button,
    .upload-button,
    .email-button {
        padding: 8px 12px;
        font-size: 14px;
        margin-right: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .profile-button {
        padding: 8px 12px;
        font-size: 14px;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 0;
    }

    header.mobile-search-active .header-left {
        display: none;
    }

    header.mobile-search-active .upload-button,
    header.mobile-search-active .email-button,
    header.mobile-search-active .sign-in-button,
    header.mobile-search-active .sign-up-button,
    header.mobile-search-active .user-menu {
    display: none !important;
    }
    

    header.mobile-search-active {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 12px;
        align-items: center;
    }

    header.mobile-search-active .header-center {
        display: block;
        margin-top: 0;
        flex-basis: auto;
        flex-grow: 1;
        order: 1;
    }

    header.mobile-search-active .search-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    header.mobile-search-active #search-form {
        width: 100%;
    }

    header.mobile-search-active .header-right {
        width: auto;
        justify-content: flex-end;
        flex-grow: 0;
        order: 2;
    }
    
    /* Sort controls - make them more touch-friendly */
    .sort-controls {
        margin: 10px auto;
        max-width: 95%;
    }
    
    .sort-btn {
        padding: 10px 15px;
        font-size: 14px;
        touch-action: manipulation; /* Optimize for touch */
    }
    
    /* Container adjustments */
    .container {
        width: 95%;
        margin: 10px auto;
    }
    
    /* User dropdown menu adjustments */
    .user-dropdown {
        min-width: 160px;
        right: -10px;
    }
    
    .user-dropdown a {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    /* Footer adjustments */
    footer {
        padding: 15px 10px;
    }
    
    footer p {
        font-size: 12px;
    }
    
    /* Masonry will naturally adjust columns on this screen size */
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    /* Header - compact mobile layout */
    header {
        padding: 5px 8px;
        gap: 5px;
        min-height: auto;
    }
    
    .header-left h1 {
        font-size: 16px;
        margin: 0;
        line-height: 1.2;
    }
    
    /* Tighter header center spacing */
    .header-center {
        margin-top: 5px;
        order: 3;
        flex-basis: 100%;
    }
    
    .search-container {
        margin: 0;
    }
    
    #search-bar {
        padding: 6px 35px 6px 10px;
        height: 32px;
        font-size: 14px;
    }
    
    .search-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    /* Compact header buttons */
    .header-right {
        gap: 4px;
        flex-wrap: nowrap;
    }
    
    .sign-in-button,
    .sign-up-button {
        padding: 6px 8px;
        font-size: 12px;
        margin-right: 0;
    }
    
    .upload-button,
    .email-button {
        padding: 6px 8px;
        font-size: 12px;
        margin-right: 0;
        height: 32px;
        align-items: center;
    }
    
    /* Show only icon for email button on tiny screens */
    .email-button {
        white-space: nowrap;
        max-width: 70px;
    }
    
    .profile-button {
        padding: 8px 12px;
        font-size: 14px;
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 36px;
        align-items: center;
    }
    
    /* Compact sort controls for mobile */
    .sort-controls {
        margin: 10px auto;
        max-width: 98%;
        flex-wrap: wrap;
        border-radius: 6px;
    }
    
    .sort-btn {
        padding: 8px 10px;
        font-size: 11px;
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* Add border-bottom for wrapped items */
    .sort-btn:not(:last-child) {
        border-right: 1px solid var(--color-border-light);
    }
    
    /* Gallery grid - ensure single column with good spacing */
    .gallery {
        width: 100%;
        padding: 0 5px;
    }
    
    .gallery-item {
        width: 100% !important;
        margin-bottom: 15px;
    }
    
    /* Image cards - full width single column on small screens */
    .image-card {
        width: calc(100vw - 10px) !important;
        max-width: calc(100vw - 10px);
        margin: 0 auto 10px auto;
        border-radius: 0;
    }
    
    /* Container adjustments for small screens */
    .container {
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .gallery {
        width: 100%;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Disable masonry centering on mobile */
    .gallery {
        margin-left: 0 !important;
    }
    
    /* Image info - always visible on mobile (no need to hover) */
    .image-info {
        opacity: 0.9;
    }
    
    /* Container adjustments */
    .container {
        width: 100%;
        margin: 5px auto;
        padding: 0 5px;
    }
    
    /* User dropdown positioning */
    .user-dropdown {
        right: -5px;
        min-width: 140px;
    }
    
    .user-dropdown a {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* Intro text adjustments */
    .intro-text {
        font-size: 12px;
        margin: 5px 0;
        padding: 0 10px;
    }
    
    /* Loading message adjustments */
    .loading-message,
    .error-message {
        font-size: 14px;
        padding: 20px 10px;
    }
    
    /* Search icon adjustment */
    .search-icon {
        right: 15px;
    }
}

/* Very small devices (360px and below) */
@media (max-width: 360px) {
    .header-left h1 {
        font-size: 16px;
    }
    
    .header-right {
        gap: 5px;
    }
    
    .sign-in-button,
    .sign-up-button,
    .upload-button,
    .email-button,
    .profile-button {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .sort-btn {
        padding: 8px 8px;
        font-size: 11px;
    }
}

/* Mobile optimization for content types */
@media (max-width: 768px) {
    /* Image overlays and info */
    .image-overlay {
        font-size: 14px;
        padding: 10px;
    }
    
    .image-overlay h4 {
        margin: 0 0 3px 0;
        font-size: 13px;
        line-height: 1.3;
    }
    
    .image-meta {
        margin: 0;
        font-size: 11px;
        line-height: 1.3;
    }
    
    .image-info h3 {
        font-size: 14px;
    }
    
    .image-info p {
        font-size: 11px;
    }
    
    /* YouTube embeds - maintain aspect ratio */
    .youtube-container {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
        height: 0;
        overflow: hidden;
        margin: 15px 0;
    }
    
    .youtube-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    /* Video controls on mobile */
    .video-controls {
        padding: 10px 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .video-control-btn {
        font-size: 13px;
        padding: 7px 14px;
    }
    
    /* Text posts */
    .text-post-container {
        font-size: 15px;
        padding: 10px;
        min-height: auto;
    }
    
    /* Link posts */
    .link-post-card {
        max-height: 400px;
        margin: 15px 0;
    }
    
    .link-post-overlay {
        font-size: 16px;
        padding: 15px;
    }
    
    /* Vote buttons - make them larger and more touch-friendly */
    .vote-btn {
        padding: 10px 15px;
        font-size: 16px;
        min-width: 50px;
    }
    
    .vote-count {
        font-size: 14px;
        padding: 0 10px;
    }
    
    /* Comments on mobile */
    .comments-section {
        margin-top: 20px;
        margin-bottom: 20px; /* Less margin on mobile */
        padding: 10px;
    }
    
    .comment-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .comment-text {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Make sure images in posts are responsive */
    .post-image,
    .image-container img {
        max-width: 100%;
        height: auto;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .image-card:hover,
    .gallery-item:hover {
        transform: none;
    }
    
    /* Make clickable areas larger */
    .sort-btn,
    .vote-btn,
    button,
    a {
        min-height: 44px; /* Apple's recommended minimum touch target */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Exception: card username links should stay compact for alignment */
    .card-user-link {
        min-height: unset;
        padding: 0;
    }
    
    /* Make comment vote buttons larger on touch devices to fill the 44px touch target */
    .comment-vote-btn {
        min-height: 36px; /* Smaller than 44px but still touch-friendly */
        font-size: 16px;
        padding: 2px 10px;
    }
    
    .comment-vote-btn .vote-arrow,
    .comment-vote-btn.active .vote-arrow {
        font-size: 18px;
    }
    
    .comment-vote-btn .vote-count {
        font-size: 15px;
    }
    
    /* Reduce gap between vote buttons on touch devices */
    .comment-votes {
        gap: 2px; /* Minimal gap */
    }
    
    /* Make card stat buttons bigger on mobile to fill the touch target height */
    .card-stat-btn .stat-icon {
        font-size: 18px;
    }
    
    .card-stat-btn .stat-value {
        font-size: 14px;
    }
    
    /* Always show image info on touch devices */
    .image-info {
        opacity: 0.85 !important;
    }
}

/* My Uploads Page Styling */
.my-uploads-view {
    width: 100%;
}

/* Make image info always visible in my-uploads */
.my-uploads-view .image-info {
    position: static;
    opacity: 1;
    background: transparent;
}

/* Hide image-info when delete confirmation is shown in my-uploads */
.my-uploads-view .image-card:has(.inline-delete-confirm) .image-info,
.my-uploads-view .gallery-card:has(.inline-delete-confirm) .image-info {
    display: none;
}

/* Position delete confirmation in bottom right corner in my-uploads */
.my-uploads-view .image-card,
.my-uploads-view .gallery-card {
    position: relative;
}

.my-uploads-view .inline-delete-confirm {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    width: auto;
}

.uploads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.uploads-header h1 {
    margin: 0;
    flex: 1;
}

.uploads-header .btn {
    width: auto;
    padding: 10px 24px;
    font-size: 13px;
    flex-shrink: 0;
}

.uploads-gallery {
    width: 100%;
}

/* Image Actions Container */
.image-actions {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--overlay-darker);
    border-radius: 0 0 12px 12px;
    opacity: 1;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 5;
}

/* Hide actions on cards by default, show on hover (for my-uploads grid) */
.image-card .image-actions,
.gallery-card .image-actions {
    opacity: 0;
}

.image-card:hover .image-actions,
.gallery-card:hover .image-actions {
    opacity: 1;
}

.image-actions .btn {
    flex: 1;
    width: auto;
    padding: 8px 12px;
    font-size: 12px;
    margin: 0;
    text-align: center;
}

.image-actions .edit-btn {
    background-color: var(--color-success);
}

.image-actions .edit-btn:hover {
    background-color: var(--color-success-dark);
    box-shadow: 0 3px 10px var(--color-success-transparent-30);
}

.image-actions .delete-post-btn {
    background-color: var(--color-primary-light);
}

.image-actions .delete-post-btn:hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 3px 10px var(--color-primary-light-transparent-30);
}

/* Download Section */
.download-section {
    margin: 20px 0;
}

.download-menu {
    position: relative;
    display: inline-block;
}

.download-btn {
    background-color: var(--color-success);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background-color: var(--color-success-dark);
    box-shadow: 0 3px 10px var(--color-success-transparent-30);
}

.download-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    background-color: var(--color-bg-hover);
    min-width: 150px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    padding: 8px 0;
    z-index: 1000;
    border-radius: 4px;
}

.download-dropdown::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
}

.download-dropdown a {
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.download-dropdown a:hover {
    background-color: var(--color-bg-button-hover);
}

.download-menu.dropdown-open .download-dropdown {
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .download-menu:hover .download-dropdown {
        display: block;
    }
}

/* Responsive adjustments for my-uploads */
@media (max-width: 768px) {
    .uploads-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .uploads-header .btn {
        width: 100%;
    }
    
    .image-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.profile-actions .btn {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .profile-actions {
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
}

/* Post Navigation Buttons */
.image-container-wrapper {
    position: relative;
    width: 100%;
    margin: 20px auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-nav-btn {
    flex-shrink: 0;
    height: 400px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-decoration: none;
    font-size: 28px;
    font-weight: 100;
    opacity: 0.5;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 10;
    border-radius: 8px;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: -5px;
    line-height: 0.5;
}

.post-nav-btn.desktop-only {
    display: flex; /* Ensure desktop buttons show on desktop */
}

.post-nav-btn:hover {
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.7);
}

.post-nav-btn.post-nav-hidden {
    visibility: hidden;
    pointer-events: none;
}

.post-nav-prev {
    order: 1;
}

.post-nav-next {
    order: 3;
}

.post-nav-btn span {
    pointer-events: none;
    user-select: none;
    display: block;
    transform: scaleY(8);
    font-size: 24px;
}

.image-container {
    flex: 1;
    min-width: 0;
    order: 2;
}

@media (max-width: 768px) {
    .image-container-wrapper {
        gap: 5px;
        margin: 0 auto; /* Remove top/bottom margin on mobile */
    }
    
    /* Hide desktop navigation buttons on mobile */
    .post-nav-btn.desktop-only {
        display: none !important;
    }
    
    .post-nav-btn span {
        transform: scaleY(6);
        font-size: 18px;
    }
}

/* Mobile navigation buttons */
.mobile-nav-buttons {
    display: none; /* Hidden on desktop by default */
}

/* Show mobile buttons for galleries on all screen sizes */
.mobile-nav-buttons:not(.mobile-only) {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 2px auto 2px auto;
    padding: 0 10px;
    max-width: 100%;
    width: 100%;
}

/* Fine-tune gallery top/bottom nav spacing */
.gallery-top-nav {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
}
.gallery-bottom-nav {
    margin-top: 8px !important;
    margin-bottom: 4px !important;
}

@media (max-width: 768px) {
    .mobile-nav-buttons {
        display: flex !important; /* Force flex display on mobile */
        flex-direction: row !important; /* Force horizontal layout */
        gap: 10px;
        justify-content: center;
        align-items: center;
        margin: 2px auto 2px auto; /* Minimal margin */
        padding: 0 10px; /* Small horizontal padding for edge spacing */
        max-width: 100%;
        width: 100%;
    }
}

.mobile-nav-btn {
    flex: 1; /* Stretch to fill available space */
    min-width: 120px;
    max-width: none; /* Remove max-width constraint for full stretch */
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 400;
    border-radius: 4px;
    text-align: center;
    transition: background 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-btn:hover,
.mobile-nav-btn:active {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
}

.mobile-nav-btn.mobile-nav-hidden {
    visibility: hidden;
    pointer-events: none;
}

.mobile-nav-btn span {
    display: inline-block;
}

/* Responsive utility classes */
.mobile-only {
    display: none;
}

.desktop-only {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline;
    }
    
    .desktop-only {
        display: none;
    }
}

/* Upload from URL section */
.upload-from-url details {
    transition: background 0.2s ease;
}

.upload-from-url details[open] {
    background: rgba(255, 255, 255, 0.04);
}

.upload-from-url summary {
    transition: color 0.2s ease;
}

.upload-from-url summary:hover {
    color: var(--color-text-primary);
}

.upload-from-url summary::marker,
.upload-from-url summary::-webkit-details-marker {
    color: var(--color-text-subtle);
}

/* Camera button - hidden by default, shown via JavaScript if camera is detected */
#take-photo-btn {
    display: none;
}

/* Mobile specific styles for upload UI */
@media (max-width: 768px) {
    /* Make buttons more touch-friendly on mobile */
    .upload-from-url button {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px; /* iOS recommended touch target size */
    }
    
    .upload-from-url input[type="url"] {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }
    
    .upload-from-url details {
        padding: 10px;
    }
}
