body {
    background-color: #333333;
    color: #ffffff;
}
.hero-section {
    position: relative;
    height: 150px; /* Base height for mobile */
    background-size: cover;
    background-position: center;
    margin-bottom: 45px;
    max-width: 1536px;
}

/* Scale hero height based on screen width */
@media (min-width: 768px) {
    .hero-section {
        height: min(calc(150px + (100vw - 768px) * 0.05), 250px);
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.5));
}
.grid-container {
    width: 100%;
    margin: 0 auto;
}
.gutter-sizer {
    width: 8px;
}
/* Base grid size - mobile first */
.grid-sizer,
.image-card {
    width: calc(25% - 6px); /* 4 columns by default */
}

/* Grid size classes for all screen sizes */
.grid-size-8 .grid-sizer,
.grid-size-8 .image-card {
    width: calc(12.5% - 7px);
}
.grid-size-7 .grid-sizer,
.grid-size-7 .image-card {
    width: calc(14.285% - 7px);
}
.grid-size-6 .grid-sizer,
.grid-size-6 .image-card {
    width: calc(16.666% - 7px);
}
.grid-size-5 .grid-sizer,
.grid-size-5 .image-card {
    width: calc(20% - 7px);
}
.grid-size-4 .grid-sizer,
.grid-size-4 .image-card {
    width: calc(25% - 6px);
}
.grid-size-3 .grid-sizer,
.grid-size-3 .image-card {
    width: calc(33.333% - 6px);
}
.grid-size-2 .grid-sizer,
.grid-size-2 .image-card {
    width: calc(50% - 4px);
}

.image-card {
    margin-bottom: 8px;
    break-inside: avoid;
    background: #1a1a1a;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.4s ease-in;
    position: relative;
}
.image-card.loaded {
    opacity: 1;
}
.image-card img,
.image-card video {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}
.image-card:hover .image-overlay {
    opacity: 1;
}

/* Controls container */
.controls-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 0.5rem;
    width: 100%;
    justify-content: space-between;
    min-height: 48px;
}

/* Archive bar (matches controls container styling) */
.archive-bar {
    margin-top: 10px;
    padding: 12px;
    border-radius: 0.5rem;
    border: 1px solid #2d2d2d;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.archive-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e5e7eb;
    font-size: 0.95rem;
    flex-wrap: wrap;
}
.archive-title {
    font-weight: 700;
    letter-spacing: 0.3px;
}
.archive-hint {
    color: #9ca3af;
    font-size: 0.85rem;
}
.archive-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #2d2d2d;
    color: #e5e7eb;
    border: 1px solid #4a4a4a;
}
.archive-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.archive-select {
    background-color: #2d2d2d;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 0.5rem;
    padding: 6px 10px;
    font-size: 0.85rem;
}
.archive-select:hover {
    background-color: #3d3d3d;
    border-color: #6a6a6a;
}
.archive-select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.archive-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.archive-clear {
    background: #2d2d2d;
    color: #fca5a5;
    border: 1px solid #4a4a4a;
    border-radius: 0.5rem;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.archive-clear.is-hidden {
    display: none;
}
.archive-clear:hover {
    background: #3d3d3d;
    border-color: #6a6a6a;
    color: #fca5a5;
}
.archive-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .archive-bar {
        flex-direction: row;
        align-items: center;
    }
    .archive-controls {
        width: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    .archive-select,
    .archive-clear {
        width: auto;
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .archive-left {
        gap: 6px;
        width: 87px;
    }
    .archive-hint {
        display: none;
    }
}

/* Control group with icon */
.control-group {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0; /* Allow shrinking below content size */
}

/* Enhanced select styling */
.control-select {
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    background-color: #2d2d2d;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.control-select:hover {
    background-color: #3d3d3d;
    border-color: #6a6a6a;
}

.control-select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.control-icon {
    position: absolute;
    left: 8px;
    color: #9ca3af;
    pointer-events: none;
    font-size: 0.9em;
}

.control-select.with-icon {
    padding-left: 28px;
}

.profile-avatar {
    position: absolute;
    bottom: -45px;
    left: 16px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid #1a1a1a;
    background-color: #1a1a1a;
}

.profile-info {
    padding-top: 0px;
    padding-left: 16px;
    container-type: inline-size;
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

/* Profile stats container auto-sizing */
.profile-stats {
    display: flex;
    flex-wrap: nowrap !important; /* Prevent wrapping */
    width: 100%;
    gap: 16px;
    color: #a0a0a0;
    font-size: 0.9rem;
}

@container (max-width: 600px) {
    .profile-stats {
        font-size: clamp(0.7rem, 2vw, 0.9rem);
    }
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .controls-container {
        padding: 8px;
        gap: 6px;
    }
    .control-select {
        font-size: 0.85rem;
        padding: 6px 20px 6px 24px;
    }
    .control-icon {
        left: 6px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .control-select {
        font-size: 0.75rem;
        padding: 6px 16px 6px 20px;
    }
    .control-icon {
        font-size: 0.7em;
    }
    option {
        font-size: 0.75rem;
    }
}

/* Shorten text for smaller screens */
@media (max-width: 640px) {
    .control-select option[value="recent"]:after { content: "Recent"; }
    .control-select option[value="top"]:after { content: "Top Rated"; }
    .control-select option[value="views"]:after { content: "Most Views"; }
    .control-select option[value="comments"]:after { content: "Most Comments"; }
    .control-select option[value="all"]:after { content: "All"; }
    .control-select option[value="day"]:after { content: "24h"; }
    .control-select option[value="week"]:after { content: "Week"; }
    .control-select option[value="month"]:after { content: "Month"; }
    .control-select option[value="year"]:after { content: "Year"; }
}

/* Add styles for online indicator */
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(0.95); opacity: 0.5; }
}
.online-indicator {
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

/* Edit Profile Button and Modal Styles */
#editProfileBtn {
    font-size: 13px;
    font-weight: bold;
    margin-left: auto;
    background-color: #505050;
    border: 1px solid #888;
    padding: 8px 11px;
    line-height: 15px;
}

#editProfileModal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#editProfileModal .w-96 {
    max-width: 24rem;
    width: 90%;
}

#editProfileModal label {
    color: #e5e7eb;
}

#editProfileModal button {
    font-size: 14px;
    font-weight: 500;
}

#editProfileModal input[type="file"] {
    display: none;
}

#currentAvatar {
    object-fit: cover;
}

#currentBg {
    background-color: #374151;
    background-size: cover;
    background-position: center;
}

/* Background Image Preview Styles */
#bgPreviewContainer {
    width: 100%;
    height: 150px;
    position: relative;
    overflow: hidden;
    background-color: #1a1a1a;
    border-radius: 0.5rem;
    margin-top: 8px;
}

#bgPreview {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#bgPreview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

#bgPreview img.dragging {
    cursor: grabbing;
}

/* Preview Instructions */
.preview-instructions {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
}
