/* Mobile-specific styles */

/* CRITICAL: Force mobile logo sizing - must be at top */
/* Override ALL possible logo image styles */
.mobile-logo-section .logo-image,
.mobile-footer-logo .logo-image,
.mobile-header .logo-image,
.mobile-footer .logo-image,
.mobile-top-bar .logo-image,
.mobile-footer-brand .logo-image {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Also override any inherited styles */
.mobile-logo-section img[src*="logo.png"],
.mobile-footer-logo img[src*="logo.png"] {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    min-width: 24px !important;
    min-height: 18px !important;
}

/* Additional size overrides for different screen sizes */
@media (max-width: 480px) {
    .mobile-logo-section .logo-image {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
    }
    
    .mobile-footer-logo .logo-image {
        width: 18px !important;
        height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
    }
}

@media (max-width: 360px) {
    .mobile-logo-section .logo-image {
        width: 18px !important;
        height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
    }
    
    .mobile-footer-logo .logo-image {
        width: 16px !important;
        height: 16px !important;
        max-width: 16px !important;
        max-height: 16px !important;
        min-width: 16px !important;
        min-height: 16px !important;
    }
}

/* CSS Variables for Mobile */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --border-color: #333333;
    --accent-color: #6366f1;
    --accent-color-hover: #5b5ae5;
    --error-color: #ef4444;
}

/* Dark theme adjustments */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --border-color: #2a2a2a;
}

/* Light theme adjustments */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
}

/* Ensure fixed positioning works on all mobile browsers */
.mobile-view {
    position: relative;
}

.mobile-view .mobile-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    z-index: 9999 !important;
}

/* Hide desktop header and footer when mobile versions are loaded */
body:has(.mobile-header) .main-header {
    display: none;
}

body:has(.mobile-footer) .main-footer {
    display: none;
}

/* Add top padding to body when mobile header is present */
body:has(.mobile-header) {
    padding-top: 90px !important; /* Increased to accommodate fixed header */
    margin-top: 0 !important;
}

/* Fallback for browsers that don't support :has() */
@supports not (selector(:has(*))) {
    /* When mobile class is present, hide desktop elements */
    .mobile-view .main-header,
    .mobile-view .main-footer {
        display: none;
    }
    
    .mobile-view {
        padding-top: 90px !important;
        margin-top: 0 !important;
    }
}
/* Mobile Header Styles */
/* Force mobile logo sizing for all mobile devices */
.mobile-logo-section .logo-image,
.mobile-footer-logo .logo-image {
    box-sizing: border-box !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.mobile-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: transform;
}

.mobile-header-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    width: 100%;
}

.mobile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    min-height: 56px;
    width: 100%;
    box-sizing: border-box;
}

.mobile-logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    max-width: 200px;
}

.mobile-logo-section:hover {
    opacity: 0.8;
}

.mobile-logo-section .logo-circle {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
}

.mobile-logo-section .logo-image {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.mobile-logo-section .logo-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mobile-user-menu {
    position: relative;
}

.mobile-user-profile {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.mobile-user-profile:active {
    transform: scale(0.95);
}

.mobile-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

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

.mobile-user-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 50%;
}

.mobile-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    transform: translateY(8px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
}

.mobile-user-dropdown.show {
    transform: translateY(8px) scale(1);
    opacity: 1;
    visibility: visible;
}

.mobile-user-info {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-user-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.mobile-user-role {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mobile-dropdown-content {
    padding: 8px 0;
}

.mobile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.mobile-dropdown-item:hover {
    background: var(--bg-secondary);
}

.mobile-dropdown-item.admin-item {
    color: var(--accent-color);
}

.mobile-dropdown-item.logout-item {
    color: var(--error-color);
}



.mobile-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.mobile-sign-in-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-sign-in-btn:hover {
    background: var(--accent-color-hover);
}

.mobile-hamburger {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
}

.mobile-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Navigation */
.mobile-nav {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    position: relative;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-nav.show {
    max-height: 600px;
    padding: 16px 0;
}

.mobile-nav-content {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 550px;
    overflow-y: auto;
}

/* Mobile Search Section in Dropdown */
.mobile-search-section {
    padding: 12px 0;
    margin-bottom: 8px;
}

.mobile-search-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.mobile-search-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 12px 12px 40px;
    color: var(--text-primary);
    font-size: 16px; /* Prevents zoom on iOS */
    outline: none;
    transition: border-color 0.2s ease;
}

.mobile-search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

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

.mobile-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 1;
    pointer-events: none;
}

.mobile-search-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-btn:hover,
.mobile-search-btn:active {
    background: var(--accent-color-hover);
    transform: scale(0.95);
}

/* Mobile Navigation Dividers */
.mobile-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
    opacity: 0.5;
}

/* Mobile User Section */
.mobile-user-section {
    padding: 12px 0;
    margin: 4px 0;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.mobile-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

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

.mobile-user-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 50%;
}

.mobile-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.mobile-user-role {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Mobile Navigation Action Buttons */
.mobile-nav-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.mobile-nav-action:hover {
    background: var(--bg-secondary);
}

.mobile-nav-action svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    background: var(--bg-secondary);
}

.mobile-nav-link.active {
    background: var(--accent-color);
    color: white;
}

.mobile-nav-link.admin-link {
    color: var(--accent-color);
}

.mobile-nav-link.logout-link {
    color: var(--error-color);
}

.mobile-nav-link.sign-in-link {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
}

.mobile-nav-link.sign-in-link:hover {
    background: var(--accent-color-hover);
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
}

/* Mobile Footer Styles */
.mobile-footer {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary, var(--bg-secondary)) 100%);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.mobile-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.6;
}

.mobile-footer-container {
    padding: 32px 20px 24px;
    position: relative;
}

.mobile-footer-brand {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.mobile-footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-footer-logo .logo-circle {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-hover, var(--accent-color)));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.mobile-footer-logo .logo-image {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.mobile-footer-logo .logo-circle::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), transparent);
    opacity: 0.3;
    z-index: -1;
}

.mobile-footer-logo .logo-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mobile-footer-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.mobile-footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 28px;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 24px 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-footer-section h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    position: relative;
    padding-bottom: 8px;
}

.mobile-footer-section h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 1px;
}

.mobile-footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-footer-section li {
    margin-bottom: 12px;
    transform: translateX(0);
    transition: transform 0.2s ease;
}

.mobile-footer-section li:hover {
    transform: translateX(4px);
}

.mobile-footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.mobile-footer-section a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.mobile-footer-section a:hover {
    color: var(--accent-color);
}

.mobile-footer-section a:hover::before {
    width: 100%;
}

.mobile-footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.mobile-footer-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--accent-color);
    opacity: 0.6;
}

.mobile-copyright {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 12px 0;
    opacity: 0.8;
}

.mobile-footer-love {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
    font-weight: 500;
}

.mobile-footer-love .heart {
    color: var(--error-color);
    animation: heartbeat 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mobile Footer Socials Section */
.mobile-footer-socials {
    text-align: center;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 24px 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-footer-socials h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    position: relative;
    padding-bottom: 8px;
}

.mobile-footer-socials h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 1px;
}

.mobile-social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mobile-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.mobile-social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-color-hover, var(--accent-color)));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.mobile-social-link:hover,
.mobile-social-link:active {
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-social-link:hover::before,
.mobile-social-link:active::before {
    opacity: 1;
}

.mobile-social-link svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.mobile-social-link:hover svg,
.mobile-social-link:active svg {
    transform: scale(1.1);
}

/* Social link specific colors on hover */
.mobile-social-link[aria-label="Twitter"]:hover {
    border-color: #1DA1F2;
}

.mobile-social-link[aria-label="Twitter"]:hover::before {
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
}

.mobile-social-link[aria-label="Discord"]:hover {
    border-color: #5865F2;
}

.mobile-social-link[aria-label="Discord"]:hover::before {
    background: linear-gradient(135deg, #5865F2, #4752c4);
}

.mobile-social-link[aria-label="Reddit"]:hover {
    border-color: #FF4500;
}

.mobile-social-link[aria-label="Reddit"]:hover::before {
    background: linear-gradient(135deg, #FF4500, #e63e00);
}

.mobile-social-link[aria-label="GitHub"]:hover {
    border-color: #333;
}

.mobile-social-link[aria-label="GitHub"]:hover::before {
    background: linear-gradient(135deg, #333, #24292e);
}

.mobile-social-link[aria-label="YouTube"]:hover {
    border-color: #FF0000;
}

.mobile-social-link[aria-label="YouTube"]:hover::before {
    background: linear-gradient(135deg, #FF0000, #cc0000);
}

/* Mobile-specific utility classes */
.keyboard-open {
    /* Adjust layout when mobile keyboard is open */
    padding-bottom: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .mobile-top-bar {
        padding: 10px 12px;
    }
    
    .mobile-search-section {
        padding: 0 12px 10px;
    }
    
    .mobile-footer-container {
        padding: 20px 12px;
    }
    
    .mobile-footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .mobile-footer-socials {
        padding: 20px 16px;
        margin-bottom: 24px;
    }
    
    .mobile-social-links {
        gap: 12px;
    }
    
    .mobile-social-link {
        width: 40px;
        height: 40px;
    }
}

/* Enhanced mobile responsive adjustments */
@media (max-width: 480px) {
    .mobile-top-bar {
        padding: 10px 12px;
        min-height: 52px;
    }
    
    .mobile-search-input {
        font-size: 16px;
        padding: 10px 10px 10px 36px;
    }
    
    .mobile-search-icon {
        left: 10px;
    }
    
    .mobile-search-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    .mobile-user-info {
        padding: 10px 12px;
    }
    
    .mobile-user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .mobile-user-name {
        font-size: 15px;
    }
    
    .mobile-user-role {
        font-size: 12px;
    }
    
    .mobile-nav-link,
    .mobile-nav-action {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .mobile-nav-link svg,
    .mobile-nav-action svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-footer-container {
        padding: 28px 16px 20px;
    }
    
    .mobile-footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 20px 16px;
    }
    
    .mobile-footer-logo .logo-circle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .mobile-footer-logo .logo-image {
        width: 16px;
        height: 16px;
    }
    
    .mobile-footer-logo .logo-text {
        font-size: 20px;
    }
    
    .mobile-footer-description {
        font-size: 14px;
        max-width: 250px;
    }
    
    /* Adjust body padding for smaller screens */
    body:has(.mobile-header) {
        padding-top: 85px !important;
    }
    
    .mobile-view {
        padding-top: 85px !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .mobile-logo-section .logo-image {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
    }
    
    .mobile-footer-logo .logo-image {
        width: 18px !important;
        height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
    }
}

@media (max-width: 360px) {
    .mobile-top-bar {
        padding: 8px 10px;
        min-height: 48px;
    }
    
    .mobile-logo-section .logo-text {
        font-size: 16px;
        max-width: 100px;
    }
    
    .mobile-logo-section {
        max-width: 150px;
    }
    
    .mobile-logo-section .logo-circle {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .mobile-logo-section .logo-image {
        width: 20px;
        height: 20px;
    }
    
    .mobile-hamburger {
        width: 28px;
        height: 28px;
    }
    
    .mobile-hamburger span {
        width: 18px;
        height: 2px;
    }
    
    .mobile-search-input {
        padding: 8px 8px 8px 32px;
        font-size: 15px;
    }
    
    .mobile-search-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }
    
    .mobile-nav-link,
    .mobile-nav-action {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .mobile-user-info {
        padding: 8px 10px;
    }
    
    .mobile-user-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* Adjust body padding for extra small screens */
    body:has(.mobile-header) {
        padding-top: 80px !important;
    }
    
    .mobile-view {
        padding-top: 80px !important;
    }
}

/* Dark theme adjustments for mobile */
[data-theme="dark"] .mobile-header {
    background: var(--dark-bg-primary);
    border-bottom-color: var(--dark-border-color);
}

[data-theme="dark"] .mobile-footer {
    background: var(--dark-bg-secondary);
    border-top-color: var(--dark-border-color);
}

/* Custom scrollbar for mobile navigation */
.mobile-nav-content::-webkit-scrollbar {
    width: 4px;
}

.mobile-nav-content::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-nav-content::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 2px;
}

/* Reduce animations on mobile for better performance */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav,
    .mobile-user-dropdown,
    .mobile-hamburger span {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-header,
    .mobile-footer {
        border-width: 2px;
    }
}

/* CSS custom properties for mobile viewport height */
:root {
    --vh: 1vh;
}

/* Universal mobile logo sizing override */
@media (max-width: 768px) {
    .mobile-logo-section .logo-image {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
    }
    
    .mobile-footer-logo .logo-image {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
    }
}

/* Full viewport height for mobile layouts */
.mobile-full-height {
    height: calc(var(--vh, 1vh) * 100);
}

/* Mobile Novel Cards */
.mobile-novels-scroll {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-novels-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-novel-card-link {
    flex: 0 0 160px;
    width: 160px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mobile-novel-card-link:active {
    transform: scale(0.95);
}

.mobile-novel-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.mobile-novel-card {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.mobile-cover-container {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.mobile-novel-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mobile-novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.mobile-novel-card-link:active .mobile-novel-cover img {
    transform: scale(1.05);
}

.mobile-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #666;
    text-align: center;
    width: 100%;
    height: 100%;
}

.mobile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-novel-card-link:active .mobile-overlay {
    opacity: 1;
}

.mobile-quick-stats {
    display: flex;
    gap: 6px;
    align-self: flex-start;
}

.mobile-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-rating svg {
    color: #fbbf24;
}

.mobile-quick-read {
    align-self: flex-end;
    width: 28px;
    height: 28px;
    background: rgba(99, 102, 241, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.mobile-novel-info {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.02), transparent);
}

.mobile-novel-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.1rem;
    max-height: 2.1rem;
}

.mobile-novel-author {
    color: #9ca3af;
    font-size: 0.7rem;
    margin: 0;
    line-height: 1.2;
}

.mobile-author-name {
    color: #d1d5db;
    font-weight: 500;
}

.mobile-novel-author .author-name {
    color: #6366f1;
    font-weight: 500;
}

.mobile-stats {
    display: flex;
    gap: 8px;
    margin: 4px 0;
}

.mobile-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.8;
}

.mobile-stat:first-child {
    color: #fbbf24;
}

.mobile-stat:last-child {
    color: #9ca3af;
}

.mobile-stat svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.mobile-read-btn {
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7rem;
    text-align: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    pointer-events: none;
}

/* Responsive adjustments for mobile novel cards */
@media (max-width: 480px) {
    .mobile-novels-scroll {
        gap: 12px;
        padding: 6px 0;
    }
    
    .mobile-novel-card-link {
        flex: 0 0 140px;
        width: 140px;
    }
    
    .mobile-cover-container {
        height: 105px;
    }
    
    .mobile-novel-info {
        padding: 10px 8px;
        gap: 5px;
    }
    
    .mobile-novel-title {
        font-size: 0.8rem;
        min-height: 1.9rem;
        max-height: 1.9rem;
    }
    
    .mobile-novel-author {
        font-size: 0.65rem;
    }
    
    .mobile-stats {
        gap: 6px;
        margin: 3px 0;
    }
    
    .mobile-stat {
        font-size: 0.6rem;
    }
    
    .mobile-read-btn {
        padding: 6px 10px;
        font-size: 0.65rem;
    }
    
    .mobile-quick-read {
        width: 24px;
        height: 24px;
    }
    
    .mobile-rating {
        padding: 2px 4px;
        font-size: 0.6rem;
    }
}

@media (max-width: 360px) {
    .mobile-novel-card {
        flex: 0 0 120px;
        width: 120px;
    }
    
    .mobile-cover-container {
        height: 90px;
    }
    
    .mobile-novel-info {
        padding: 8px 6px;
        gap: 4px;
    }
    
    .mobile-novel-title {
        font-size: 0.75rem;
        min-height: 1.8rem;
        max-height: 1.8rem;
    }
    
    .mobile-novel-author {
        font-size: 0.6rem;
    }
    
    .mobile-read-btn {
        padding: 5px 8px;
        font-size: 0.6rem;
    }
    
    .mobile-footer-socials {
        padding: 16px 12px;
        margin-bottom: 20px;
    }
    
    .mobile-social-links {
        gap: 8px;
    }
    
    .mobile-social-link {
        width: 36px;
        height: 36px;
    }
    
    .mobile-social-link svg {
        width: 16px;
        height: 16px;
    }
}
