@import url('https://fonts.googleapis.com/css2?family=Minecraft&display=swap');
@import url('components/search.css');
@import url('components/post.css');
@import url('components/notifications.css');

/* Base Styles */
:root {
    --primary-bg: #181a1c;
    --secondary-bg: #1e2022;
    --accent-color: #2d3748;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --sidebar-width: 320px;
    --border-color: #252729;
    --hover-color: #202325;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* For Webkit browsers (Chrome, Safari, newer Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #3a3d40;
}

/* Hide horizontal scrollbar */
html {
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 300;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Subtle Animated Background Pattern - Grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    background-image: 
        linear-gradient(rgba(76, 175, 80, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(76, 175, 80, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: subtleRise 60s linear infinite;
}

/* Subtle Diagonal Lines Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 35px,
        rgba(76, 175, 80, 0.2) 35px,
        rgba(76, 175, 80, 0.2) 36px
    );
    animation: subtleFall 80s linear infinite reverse;
}

/* Subtle rising animation */
@keyframes subtleRise {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50px);
    }
}

/* Subtle falling animation */
@keyframes subtleFall {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(-50px) translateX(-50px);
    }
}

/* Ensure content stays above pattern */
.app-container,
.sidebar,
.main-content,
.feed-container {
    position: relative;
    z-index: 1;
}

/* Falling MineFun Logos */
.falling-logos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.falling-logo {
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0.2;
    background-image: url('/assets/css/components/minefunlogo_2.webp');
    background-size: contain;
    background-repeat: no-repeat;
    animation: fall linear infinite;
}

/* Create multiple logos with random positions, speeds, and spawn times */
.falling-logo:nth-child(1) {
    left: 8%;
    animation-duration: 14s;
    animation-delay: -2s;
}

.falling-logo:nth-child(2) {
    left: 23%;
    animation-duration: 16s;
    animation-delay: -8s;
    width: 18px;
    height: 18px;
}

.falling-logo:nth-child(3) {
    left: 45%;
    animation-duration: 18s;
    animation-delay: -5s;
}

.falling-logo:nth-child(4) {
    left: 67%;
    animation-duration: 15s;
    animation-delay: -12s;
    width: 22px;
    height: 22px;
}

.falling-logo:nth-child(5) {
    left: 12%;
    animation-duration: 17s;
    animation-delay: -10s;
}

.falling-logo:nth-child(6) {
    left: 89%;
    animation-duration: 16s;
    animation-delay: -3s;
    width: 19px;
    height: 19px;
}

.falling-logo:nth-child(7) {
    left: 34%;
    animation-duration: 15s;
    animation-delay: -7s;
}

.falling-logo:nth-child(8) {
    left: 56%;
    animation-duration: 18s;
    animation-delay: -14s;
    width: 21px;
    height: 21px;
}

.falling-logo:nth-child(9) {
    left: 78%;
    animation-duration: 14s;
    animation-delay: -6s;
}

.falling-logo:nth-child(10) {
    left: 92%;
    animation-duration: 17s;
    animation-delay: -11s;
    width: 20px;
    height: 20px;
}

/* Falling animation - start from way above screen */
@keyframes fall {
    0% {
        transform: translateY(-200px);
        opacity: 0;
    }
    5% {
        opacity: 0.2;
    }
    95% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(calc(100vh + 100px));
        opacity: 0;
    }
}

/* Reduce on mobile for performance */
@media (max-width: 768px) {
    .falling-logo:nth-child(n+6) {
        display: none;
    }
}

/* Modern Clean Loader */
.app-loader {
    position: fixed;
    inset: 0;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow: hidden;
}

.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.loader-logo {
    position: relative;
    width: 100px;
    height: 100px;
    animation: float 3s ease-in-out infinite;
}

.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.loader-ring {
    position: absolute;
    inset: -10px;
    border: 3px solid transparent;
    border-top-color: #4CAF50;
    border-right-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    z-index: 1;
}

.loader-text {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loader-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.03);
    }
}

@keyframes dotBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-8px) scale(1.2);
        opacity: 0.7;
    }
}

@keyframes textFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes drift {
    to {
        background-position: 24px 24px;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 1.5rem 0 1rem;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Search Container */
.search-container {
    padding: 0.5rem 1.5rem 0.3rem 1.5rem;
    position: sticky;
    top: 0;
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.search-box:focus-within {
    border-bottom-color: var(--text-primary);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 0.5rem;
    font-size: 1rem;
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    padding: 0.25rem 0;
    font-size: 0.95rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Trending Section */
.trending-section {
    margin: 1.5rem 1.5rem 0 1.5rem;
    background: #181a1c;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.trending-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 6px;
    padding: 0.75rem;
}

.trending-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

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

.trending-tag {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.trending-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 0;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Feed Navigation styles are in assets/css/components/feed-navigation.css */

/* Right Sidebar */
.right-sidebar {
    width: 300px;
    background: var(--secondary-bg);
    border-left: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

/* Make sure the sidebar content is visible */
.right-sidebar * {
    color: var(--text-primary);
}

.search-container {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Trending Section */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--text-primary);
}

.trending-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.trending-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.trending-tag {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.trending-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Sidebar Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 1.25rem;
    margin: 0 0.5rem 0 0;
    text-decoration: none;
    color: var(--text-primary);
    gap: 0.4rem;
    overflow: hidden;
}

.logo-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.site-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.1px;
    font-weight: 600;
    margin-left: 0.3rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
}

.sidebar-logo:hover .logo-icon {
    transform: scale(1.1);
    filter: brightness(1.1) drop-shadow(0 0 2px rgba(76, 175, 80, 0.7));
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(24, 26, 28, 0.85);
    backdrop-filter: blur(12px);
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 100;
    padding-top: 2rem;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    /* Hide scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    color: var(--accent-color);
    font-size: 1.5rem;
    text-align: left;
    padding: 0 1rem;
    margin: 0.5rem 0 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    flex: 1;
    padding: 0.5rem 0 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Menu Sections */
.menu-section {
    margin-bottom: 1.5rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(160, 174, 192, 0.6);
    padding: 0.5rem 1.5rem 0.5rem 1.2rem;
    margin-bottom: 0.25rem;
}

.section-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    list-style: none;
    margin: 0.375rem 1rem 0.375rem 0.5rem;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    /* Move highlight to screen edge */
    top: 0;
    width: 4px;
    height: 100%;
    background-color: #4CAF50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    border-radius: 0 4px 4px 0;
    z-index: 1;
    pointer-events: none;
}

.menu-item:hover a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    margin-left: 0.3rem;
    /* Maintain space on hover */
}

.menu-item:hover::before {
    transform: translateX(0);
}

.menu-item.active a {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.2) inset;
}

.menu-item.active::before {
    transform: translateX(0);
    background: linear-gradient(180deg, #4CAF50, #45a049);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    /* Green highlight for active state */
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    letter-spacing: 0.3px;
    margin-left: 0.3rem;
    /* Space from edge */
}

.menu-item i {
    width: 20px;
    margin-right: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    transition: color 0.2s ease;
}

.menu-item:hover i,
.menu-item.active i {
    color: #ffffff;
    /* White on hover/active */
}

/* Special styling for Lobby Stream icon */
.menu-item.active .fa-stream {
    color: #4CAF50;
    animation: streamPulse 2s ease-in-out infinite;
}

@keyframes streamPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Tooltip for menu items */
.menu-item[data-tooltip] {
    position: relative;
}

.menu-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: linear-gradient(135deg, rgba(30, 32, 34, 0.98), rgba(24, 26, 28, 0.98));
    color: var(--text-primary);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
    border: 1px solid rgba(76, 175, 80, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

.menu-item[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(15px);
}

/* Notification badge styles removed for cleaner UI */

.sidebar-action {
    padding: 1rem 1.5rem;
    margin-top: auto;
}

.btn-post {
    background-color: #4CAF50;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-post:hover {
    background-color: #45a049;
}

.btn-signin {
    background-color: #1da1f2;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-signin:hover {
    background-color: #1a8cd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

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

/* Sidebar Footer - Polished Modern Design */
.sidebar-footer {
    padding: 0.65rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    overflow: hidden;
    width: 100%;
}

.sidebar-action {
    width: 100%;
    overflow: hidden;
}

/* Sign Out button */
.btn-signout {
    background-color: #4CAF50;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-signout:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

/* User Profile Card - Completely Redesigned */
.sidebar-footer .user-profile {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0.65rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 0;
}

.sidebar-footer .user-profile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-footer .user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(76, 175, 80, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-footer .user-profile:hover::before {
    opacity: 1;
}

/* Avatar Container */
.sidebar-footer .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(69, 160, 73, 0.3));
    border: 2px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    transition: all 0.3s ease;
}

.sidebar-footer .user-profile:hover .avatar {
    border-color: #4CAF50;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
    transform: scale(1.05);
}

.sidebar-footer .avatar img,
.sidebar-footer .avatar .profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* User Info Container - Vertical Stack */
.sidebar-footer .user-info {
    flex: 1;
    min-width: 0;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Username with Crown */
.sidebar-footer .username {
    font-weight: 700;
    color: #ffffff;
    font-size: 0.875rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-footer .username .admin-crown {
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* User Handle */
.sidebar-footer .user-handle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-footer .user-more {
    display: none;
}

/* Admin Crown in Sidebar */
.sidebar-footer .admin-crown {
    color: #ffd700;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    animation: none;
}

.sidebar-footer .user-profile:hover .admin-crown {
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
}

/* Owner Crown in Sidebar */
.sidebar-footer .owner-crown {
    color: #ff6b6b;
    filter: drop-shadow(0 0 4px rgba(255, 107, 107, 0.6));
    animation: ownerGlowSidebar 2s ease-in-out infinite;
}

@keyframes ownerGlowSidebar {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(255, 107, 107, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.9));
    }
}

.sidebar-footer .user-profile:hover .owner-crown {
    filter: drop-shadow(0 0 8px rgba(255, 107, 107, 1));
}

/* Founder Badge (Adel Norberg) - Purple/Blue Star */
.founder-badge {
    color: #9b59b6;
    font-size: 0.85rem;
    margin-left: 0.25rem;
    filter: drop-shadow(0 0 4px rgba(155, 89, 182, 0.7));
    animation: founderGlow 3s ease-in-out infinite;
}

@keyframes founderGlow {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(155, 89, 182, 0.7));
        transform: rotate(0deg);
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(155, 89, 182, 1));
        transform: rotate(72deg);
    }
}

.founder-badge:hover {
    filter: drop-shadow(0 0 10px rgba(155, 89, 182, 1));
    transform: scale(1.1);
}

.sidebar-footer .founder-badge {
    color: #9b59b6;
    filter: drop-shadow(0 0 4px rgba(155, 89, 182, 0.7));
}

.sidebar-footer .user-profile:hover .founder-badge {
    filter: drop-shadow(0 0 8px rgba(155, 89, 182, 1));
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Feed Container */
.feed {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mobile-First Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        max-width: 800px;
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }

    .main-content {
        padding: 0;
        max-width: 800px;
        width: 100%;
    }

    .right-sidebar {
        display: none;
    }

    .sidebar {
        width: 280px;
    }

    .sidebar-logo {
        padding: 0.5rem 0.75rem 1.25rem;
    }

    .logo-icon {
        width: 56px;
        height: 56px;
    }

    .site-name {
        font-size: 1.05rem;
    }
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --mobile-header-height: 60px;
    }

    .app-container {
        padding: var(--mobile-header-height) 0 0 0;
        flex-direction: column;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        z-index: 1003;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
    }

    .sidebar.active,
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Hide tooltips on mobile */
    .menu-item[data-tooltip]::after {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 0;
        padding-top: 0;
    }

    .right-sidebar {
        display: none;
    }

    .search-container {
        margin: 0;
        padding-left: 1rem;
        padding-right: 1rem;
        position: relative;
        top: 0;
    }

    /* Mobile header */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--mobile-header-height);
        background: var(--primary-bg);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        z-index: 1001;
        backdrop-filter: blur(10px);
    }

    .mobile-menu-btn,
    .mobile-search-btn,
    .mobile-notifications-btn {
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1.4rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-btn:hover,
    .mobile-search-btn:hover,
    .mobile-notifications-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-menu-btn:active,
    .mobile-search-btn:active,
    .mobile-notifications-btn:active {
        transform: scale(0.95);
    }

    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-logo img {
        width: 36px;
        height: 36px;
    }

    .mobile-logo .mobile-site-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    /* Sidebar adjustments for mobile */
    .sidebar-logo {
        padding: 1rem;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
    }

    .site-name {
        font-size: 1rem;
    }

    .menu-item a {
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
    }

    .menu-item i {
        width: 26px;
        margin-right: 14px;
        font-size: 1.15rem;
    }

    .btn-post {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    /* Feed adjustments */
    .feed {
        padding: 0;
    }

    /* Post adjustments */
    .post {
        margin: 0 0 1rem 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    .post:first-child {
        border-top: none;
    }
}

@media (max-width: 480px) {
    :root {
        --mobile-header-height: 56px;
    }

    .app-container {
        padding-top: var(--mobile-header-height);
    }

    .mobile-header {
        height: var(--mobile-header-height);
        padding: 0 0.75rem;
    }

    .mobile-menu-btn,
    .mobile-search-btn,
    .mobile-notifications-btn {
        font-size: 1.3rem;
        padding: 0.4rem;
        min-width: 40px;
        min-height: 40px;
    }

    .mobile-logo .mobile-site-name {
        display: none;
    }

    .mobile-logo img {
        width: 32px;
        height: 32px;
    }

    .main-content {
        padding: 0;
    }

    .sidebar {
        width: 260px;
        padding: 1rem 0.5rem;
    }

    .sidebar-logo {
        padding: 0.75rem 0.5rem;
    }

    .logo-icon {
        width: 44px;
        height: 44px;
    }

    .sidebar-footer .user-profile {
        padding: 0.65rem;
    }

    .sidebar-footer .avatar {
        width: 44px;
        height: 44px;
    }

    .sidebar-footer .user-info {
        margin-left: 10px;
    }

    .sidebar-footer .username {
        font-size: 0.9rem;
    }

    .sidebar-footer .user-handle {
        font-size: 0.75rem;
    }

    .menu-item a {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .btn-post {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    /* Typography adjustments */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .search-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    :root {
        --mobile-header-height: 50px;
    }

    .app-container {
        padding-top: var(--mobile-header-height);
    }

    .mobile-header {
        height: var(--mobile-header-height);
    }

    .sidebar {
        width: 240px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .menu-item a {
        padding: 1.25rem 1.5rem;
        min-height: 56px;
    }

    .btn-post {
        padding: 1rem 1.5rem;
        min-height: 48px;
    }

    .mobile-menu-btn,
    .mobile-search-btn,
    .mobile-notifications-btn {
        padding: 0.75rem;
        min-width: 48px;
        min-height: 48px;
    }

    /* Larger tap targets for all interactive elements */
    button,
    a,
    .action-btn {
        min-height: 44px;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {

    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .mobile-header {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
            padding-top: env(safe-area-inset-top);
        }

        .sidebar {
            padding-top: max(1.5rem, env(safe-area-inset-top));
            padding-bottom: 1rem;
        }
        
        .app-container {
            padding-bottom: 0;
        }
    }
}