/* Mobile First Responsive Design - Updated for Social Media Layout */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none !important;
    background: #ffffff;
    color: #212529;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10000;
}

.mobile-menu-toggle:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.mobile-menu-toggle.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.mobile-menu-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* Desktop: Hide mobile sidebar */
@media (min-width: 769px) {
    .mobile-sidebar {
        display: none !important;
    }
    
    .mobile-sidebar-overlay {
        display: none !important;
    }
}

/* Desktop: Hide mobile sidebar */
@media (min-width: 769px) {
    .mobile-sidebar {
        display: none !important;
    }
    
    .mobile-sidebar-overlay {
        display: none !important;
    }
}

.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(4px);
}

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

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 70px !important;
    background: white !important;
    border-top: 1px solid #e9ecef !important;
    z-index: 1000 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Only show on mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-around !important;
    }
}

/* Hide on desktop and tablet */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    body {
        padding-bottom: 0 !important;
    }
}

/* Mobile sidebar header and content (unused but kept for compatibility) */
.mobile-sidebar-header {
    padding: 2rem 2rem 1.5rem 2rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: sticky !important;
    top: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 10 !important;
}

.mobile-sidebar-header h3 {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.mobile-sidebar-content {
    padding: 2rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    background: transparent !important;
    color: white !important;
}

/* Bottom Navigation Items */
.bottom-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    padding: 0.5rem 1rem !important;
    color: #666 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    flex: 1 !important;
}

.bottom-nav-item i {
    font-size: 1.4rem !important;
    color: #666 !important;
}

.bottom-nav-item span {
    color: #666 !important;
    font-size: 0.7rem !important;
}

.bottom-nav-item.active {
    color: #667eea !important;
}

.bottom-nav-item.active i,
.bottom-nav-item.active span {
    color: #667eea !important;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
    background: #f8f9fa !important;
    color: #667eea !important;
}

.bottom-nav-item:hover i,
.bottom-nav-item:hover span {
    color: #667eea !important;
}

.bottom-nav-share {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 16px !important;
    padding: 0.75rem 1.25rem !important;
}

.bottom-nav-share i,
.bottom-nav-share span {
    color: white !important;
}

.bottom-nav-share:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.mobile-nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 16px !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
}

.mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.mobile-nav-item:hover::before {
    left: 100%;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateX(8px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
    text-decoration: none !important;
    color: white !important;
}

.mobile-nav-item i {
    width: 24px !important;
    text-align: center !important;
    font-size: 1.3rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.mobile-nav-item:hover i,
.mobile-nav-item.active i {
    color: white !important;
    transform: scale(1.1) !important;
}

.mobile-nav-item span {
    color: white !important;
}

.mobile-share-btn {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 16px !important;
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    width: 100% !important;
    border: none !important;
    cursor: pointer !important;
    margin-top: 0 !important;
}

.mobile-share-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateX(8px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.mobile-share-btn i,
.mobile-share-btn span {
    color: white !important;
}

.mobile-categories {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.mobile-categories-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.mobile-category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.mobile-category-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.mobile-category-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
}

/* Mobile Menu Animations */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}


/* Small devices (phones, 576px and up) */

/* Tablet and small desktop (769px - 1399px) */
@media (min-width: 769px) and (max-width: 1399px) {
    /* Adjust layout for tablets */
    .social-sidebar {
        display: none !important;
    }
    
    .ad-space {
        display: none !important;
    }
    
    .social-right-sidebar {
        display: none !important;
    }
    
    .social-layout {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .social-feed {
        width: 100% !important;
        max-width: 700px !important;
        padding: 1rem 2rem !important;
        margin: 0 auto !important;
    }
    
    /* Profile page adjustments */
    .profile-main {
        max-width: 100% !important;
        padding: 0 1rem !important;
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Add padding to body for bottom navigation */
    body {
        padding-bottom: 70px !important;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 10px;
    }
    
    /* Hide desktop sidebar */
    .social-sidebar {
        display: none !important;
        position: static !important;
        height: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
    }
    
    /* Hide old mobile sidebar */
    .mobile-sidebar {
        display: none !important;
    }
    
    .mobile-sidebar-overlay {
        display: none !important;
    }
    
    /* Adjust layout for mobile */
    .social-layout {
        flex-direction: column !important;
        gap: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Show ads in feed on mobile instead of fixed sidebar */
    .ad-space {
        display: none !important;
    }
    
    /* Ads inside feed on mobile */
    .ad-left,
    .ad-right {
        display: none !important;
    }
    
    /* Ad containers in main feed */
    .left-ad-container,
    .right-ad-container {
        display: flex !important;
        justify-content: center !important;
        margin: 1rem 0 !important;
    }
    
    .social-right-sidebar {
        display: none !important;
        position: static !important;
        height: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: auto !important;
    }
    
    /* Make feed full width on mobile */
    .social-feed {
        width: 100% !important;
        max-width: 100% !important;
        padding: 1rem !important;
        margin: 0 !important;
    }
    
    /* Profile page mobile adjustments */
    .profile-main {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }
    
    .profile-header {
        margin-bottom: 1rem !important;
    }
    
    .profile-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .btn-edit-profile,
    .btn-logout {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Adjust navbar */
    .modern-navbar {
        padding: 0 1rem;
        height: 60px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-brand {
        font-size: 1.3rem;
        gap: 0.5rem;
    }
    
    .navbar-brand .logo-emoji {
        font-size: 1.4rem;
    }
    
    .navbar-search {
        display: none;
    }
    
    .navbar-actions {
        gap: 0.75rem;
        right: 0.75rem;
    }
    
    .navbar-username {
        display: none;
    }
    
    .navbar-user-info {
        display: none;
    }
    
    .nav-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .navbar-user {
        padding: 0.4rem 0.7rem;
        gap: 0.5rem;
    }
    
    .navbar-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .navbar-username {
        font-size: 0.85rem;
    }
    
    
    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        left: 0.75rem;
    }
    
    .auth-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-icon-btn:hover {
        background: var(--gray-100);
        transform: scale(1.05);
    }
    
    .navbar-user:hover {
        background: var(--gray-50);
        transform: scale(1.02);
    }
    
    .mobile-menu-toggle:hover {
        background: var(--gray-100);
        transform: scale(1.05);
    }
    
    .auth-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    /* Adjust main feed */
    .social-feed {
        padding: 0.5rem;
        max-width: 100%;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .post-card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .quote-content {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .post-actions {
        padding: 0.5rem 0;
        gap: 0.75rem;
    }
    
    .action-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Category grid mobile */
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .category-item {
        padding: 0.5rem;
    }
    
    .category-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .category-name {
        font-size: 0.7rem;
    }
    
    /* Quote of the day mobile */
    .quote-of-day {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .quote-of-day-content {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .quote-of-day-author {
        font-size: 0.8rem;
    }
    
    .quote-of-day-stats {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .stat-item {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile devices */
    .modern-navbar {
        padding: 0 0.75rem;
        height: 56px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }
    
    .navbar-brand {
        font-size: 1.2rem;
        gap: 0.4rem;
    }
    
    .navbar-brand .logo-emoji {
        font-size: 1.3rem;
    }
    
    .navbar-actions {
        gap: 0.5rem;
        right: 0.5rem;
    }
    
    .nav-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .navbar-user {
        padding: 0.3rem 0.6rem;
        gap: 0.4rem;
    }
    
    .navbar-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .navbar-username {
        font-size: 0.8rem;
    }
    
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        left: 0.5rem;
    }
    
    .auth-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .auth-btn i {
        font-size: 1rem;
    }
    
    .nav-icon-btn:hover {
        background: var(--gray-100);
        transform: scale(1.03);
    }
    
    .navbar-user:hover {
        background: var(--gray-50);
        transform: scale(1.01);
    }
    
    .mobile-menu-toggle:hover {
        background: var(--gray-100);
        transform: scale(1.03);
    }
    
    .auth-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
    }
    
    /* Main feed adjustments */
    .social-feed {
        padding: 0.25rem;
    }
    
    .post-card {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }
    
    .quote-content {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .post-actions {
        padding: 0.25rem 0;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .action-btn {
        padding: 0.4rem;
        font-size: 0.75rem;
        min-width: auto;
    }
    
    .post-meta {
        font-size: 0.7rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    /* Category grid small mobile */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.25rem;
        padding: 0.25rem 0;
    }
    
    .category-item {
        padding: 0.25rem;
        text-align: center;
    }
    
    .category-icon {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    .category-name {
        font-size: 0.6rem;
        line-height: 1.2;
    }
    
    /* Quote of the day small mobile */
    .quote-of-day {
        padding: 0.75rem;
        margin: 0.75rem 0;
        border-radius: 8px;
    }
    
    .quote-of-day-header {
        margin-bottom: 0.5rem;
    }
    
    .quote-of-day-title {
        font-size: 0.9rem;
    }
    
    .quote-of-day-content {
        font-size: 0.9rem;
        line-height: 1.3;
        margin: 0.5rem 0;
    }
    
    .quote-of-day-author {
        font-size: 0.75rem;
    }
    
    .quote-of-day-stats {
        gap: 0.25rem;
        margin-top: 0.5rem;
        flex-wrap: wrap;
    }
    
    .stat-item {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Feed header small mobile */
    .feed-header {
        padding: 0.5rem 0;
    }
    
    .feed-title {
        font-size: 1.2rem;
    }
    
    .feed-subtitle {
        font-size: 0.8rem;
    }
    
    /* Modal adjustments small mobile */
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
    }
    
    /* Quote detail modal small mobile */
    .quote-detail-modal .modal-content {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .quote-detail-header {
        padding: 1rem;
    }
    
    .quote-detail-content {
        font-size: 1.1rem;
        line-height: 1.5;
        padding: 1rem;
    }
    
    .quote-detail-author {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    .quote-detail-actions {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .quote-detail-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Mobile sidebar adjustments */
    .mobile-sidebar {
        display: block !important;
        width: 280px;
        top: 0;
        height: 100vh;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-nav-item {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        text-decoration: none;
    }
    
    .mobile-category-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .mobile-category-icon {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding: 0 var(--spacing-3);
    }
    /* Mobile Navbar */
    .navbar {
        padding: var(--spacing-2) 0;
        position: relative;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
    }
    [data-theme="dark"] .navbar {
        background: var(--bg);
        border-bottom-color: var(--border);
    }
    .nav-brand {
        flex: 1;
    }
    .logo {
        display: flex;
        align-items: center;
        gap: var(--spacing-2);
    }
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }
    .logo-text {
        font-size: var(--font-size-lg);
        font-weight: 700;
    }
    /* Mobile Menu */
    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9999;
        backdrop-filter: blur(8px);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .nav-menu.active {
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        padding: 0;
        opacity: 1;
    }
    }
    .nav-list {
        flex-direction: column;
        gap: var(--spacing-1);
        width: 100%;
    }
    .nav-item {
        width: 100%;
    }
    .nav-link {
        display: flex;
        align-items: center;
        gap: var(--spacing-3);
        padding: var(--spacing-4);
        border-radius: var(--border-radius-lg);
        font-weight: 500;
        transition: all var(--transition-fast);
        width: 100%;
        text-align: left;
    }
    .nav-link:hover {
        background: var(--primary-100);
        color: var(--primary-700);
    }
    [data-theme="dark"] .nav-link:hover {
        background: var(--primary-900);
        color: var(--primary-300);
    }
    .nav-link.active {
        background: var(--primary-500);
        color: white;
    }
    /* Mobile Actions */
    .nav-actions {
        gap: var(--spacing-2);
        padding: var(--spacing-1);
        background: white;
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border);
    }
    [data-theme="dark"] .nav-actions {
        background: var(--bg-secondary);
        border-color: var(--border);
    }
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--primary-500);
        color: white;
        border: none;
        border-radius: var(--border-radius-lg);
        cursor: pointer;
        transition: all var(--transition-fast);
        box-shadow: var(--shadow-sm);
    }
    .mobile-menu-toggle:hover {
        background: var(--primary-600);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }
    .mobile-menu-toggle i {
        font-size: var(--font-size-lg);
        transition: transform var(--transition-fast);
    }
    .mobile-menu-toggle.active i {
        transform: rotate(90deg);
    }
    /* Mobile Buttons */
    .search-btn,
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-sm);
    }
    .auth-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 100px;
    }
    .auth-text {
        display: none;
    }
    .user-menu-btn {
        padding: var(--spacing-2);
    }
    .user-menu-btn span {
        display: none;
    }
    .logout-btn {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-sm);
    }
    /* Mobile Menu Close Button */
    .nav-menu.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1;
    }
    .nav-menu.active .nav-list::before {
        content: '×';
        position: absolute;
        top: var(--spacing-4);
        right: var(--spacing-4);
        font-size: var(--font-size-2xl);
        color: var(--text-muted);
        cursor: pointer;
        z-index: 1;
    }
    [data-theme="dark"] .nav-menu.active .nav-list::before {
        color: var(--text-muted);
    }
}

@media (min-width: 769px) {
    /* Desktop styles */
    body {
        padding-bottom: 0 !important;
    }
}

.hero {
    padding: var(--spacing-12) 0;
}

.hero-title {
    font-size: var(--font-size-3xl);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
}

.daily-quote-card {
    padding: var(--spacing-6);
}

.quote-text {
    font-size: var(--font-size-xl);
}

.quote-actions {
    flex-direction: column;
    gap: var(--spacing-3);
}

.action-btn {
    justify-content: center;
}

.quote-meta {
    flex-direction: column;
    gap: var(--spacing-3);
}

.categories-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-4);
}

.category-card {
    padding: var(--spacing-6);
}

.quotes-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-4);
}

.quote-card {
    padding: var(--spacing-4);
}

.quote-card-text {
    font-size: var(--font-size-base);
}

.quote-card-actions {
    flex-direction: column;
    gap: var(--spacing-3);
    align-items: flex-start;
}

.quote-card-actions-left {
    width: 100%;
    justify-content: space-between;
}

.cta-title {
    font-size: var(--font-size-3xl);
}

.cta-subtitle {
    font-size: var(--font-size-lg);
}

.cta-actions {
    flex-direction: column;
    align-items: center;
}

.footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-8);
}

.footer-links {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
}

.footer-bottom {
    flex-direction: column;
    gap: var(--spacing-4);
    text-align: center;
}

.modal-content {
    width: 95%;
    padding: var(--spacing-6);
}

.search-form {
    margin-bottom: var(--spacing-4);
}

.search-input {
    padding: var(--spacing-3);
    font-size: var(--font-size-base);
}


}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        padding: 0 var(--spacing-4);
    }
    /* Tablet Navbar */
    
    .navbar {
        padding: var(--spacing-3) 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
    }
    
    [data-theme="dark"] .navbar {
        background: var(--bg);
        border-bottom-color: var(--border);
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--primary-500);
        color: white;
        border: none;
        border-radius: var(--border-radius-lg);
        cursor: pointer;
        transition: all var(--transition-fast);
        box-shadow: var(--shadow-sm);
    }
    
    .mobile-menu-toggle:hover {
        background: var(--primary-600);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }
    
    .nav-actions {
        gap: var(--spacing-3);
        padding: var(--spacing-2);
        background: white;
        border-radius: var(--border-radius-xl);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border);
    }
    
    [data-theme="dark"] .nav-actions {
        background: var(--bg-secondary);
        border-color: var(--border);
    }
    
    .search-btn,
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    
    .auth-btn {
        padding: var(--spacing-3) var(--spacing-4);
        font-size: var(--font-size-sm);
    }
    
    .user-menu-btn {
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    .logout-btn {
        width: 36px;
        height: 36px;
    }
}

/* Responsive Filters */
@media (max-width: 768px) {
    .filters {
        padding: var(--spacing-4) 0;
        position: relative;
        top: 0;
    }
    
    .filters-content {
        flex-direction: column;
        gap: var(--spacing-4);
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .filter-actions {
        justify-content: center;
        width: 100%;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
    }
    
    .active-filters {
        margin-top: var(--spacing-3);
    }
    
    .filter-badge {
        font-size: var(--font-size-xs);
        padding: var(--spacing-1) var(--spacing-2);
    }
}
@media (max-width: 480px) {
    .filters-content {
        gap: var(--spacing-3);
    }
    
    .filter-group label {
        font-size: var(--font-size-xs);
    }
    
    .filter-select {
        padding: var(--spacing-2) var(--spacing-3);
        font-size: var(--font-size-xs);
    }
    
    .clear-filters-btn {
        padding: var(--spacing-2) var(--spacing-3);
        font-size: var(--font-size-xs);
    }
}
.hero-title {
    font-size: var(--font-size-4xl);
}
.daily-quote-card {
    padding: var(--spacing-8);
}
.quote-text {
    font-size: var(--font-size-2xl);
}
.categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-5);
}
.quotes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-5);
}
.footer-content {
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-12);
}
.footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-6);
}

}

/* Large devices (desktops, 992px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .nav-menu {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .hero-title {
        font-size: var(--font-size-5xl);
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-6);
    }
    .quotes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-6);
    }
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-8);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 992px) {
    .nav-menu {
        display: flex;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-6);
    }
    .quotes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-6);
    }
}

/* Extra extra large devices (1400px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-8);
    }
    .quotes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-8);
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        padding: var(--spacing-8) 0;
    }
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    .daily-quote-card {
        padding: var(--spacing-6);
    }
    .quote-text {
        font-size: var(--font-size-xl);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .logo-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .nav-actions,
    .quote-actions,
    .cta,
    .modal {
        display: none !important;
    }
    .hero {
        padding: var(--spacing-4) 0;
    }
    .daily-quote-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    .quote-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
        break-inside: avoid;
    }
    .container {
        max-width: none;
        padding: 0;
    }
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    .quote-text {
        font-size: 14pt;
    }
    .quote-author {
        font-size: 10pt;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .skeleton {
        animation: none;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
     :root:not([data-theme]) {
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --gray-300: #475569;
        --gray-400: #64748b;
        --gray-500: #94a3b8;
        --gray-600: #cbd5e1;
        --gray-700: #e2e8f0;
        --gray-800: #f1f5f9;
        --gray-900: #f8fafc;
    }
}

/* Focus styles for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .action-btn:focus,
    .nav-link:focus,
    .theme-toggle:focus,
    .mobile-menu-toggle:focus,
    .modal-close:focus,
    .search-submit:focus,
    .auth-tab:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
     :root {
        --primary-color: #000000;
        --primary-dark: #000000;
        --gray-600: #000000;
        --gray-700: #000000;
        --gray-800: #000000;
        --gray-900: #000000;
    }
    [data-theme="dark"] {
        --primary-color: #ffffff;
        --primary-dark: #ffffff;
        --gray-100: #ffffff;
        --gray-200: #ffffff;
        --gray-300: #ffffff;
    }
    .btn,
    .action-btn,
    .category-card,
    .quote-card,
    .daily-quote-card {
        border: 2px solid currentColor;
    }
}

/* Reduced data mode */
@media (prefers-reduced-data: reduce) {
    .hero::before {
        display: none;
    }
    .category-icon {
        background-color: var(--gray-400);
    }
    .skeleton {
        animation: none;
        background: var(--gray-200);
    }
    [data-theme="dark"] .skeleton {
        background: var(--bg-secondary);
    }
}