/*
Theme Name: SCDev Supreme Theme
Description: The ultimate all-in-one WordPress theme - A complete professional website builder with social features, commerce, blog, user accounts, reactions system, PayPal integration, and advanced customization. Turn features on/off as needed. Perfect for social websites, e-commerce, blogs, and more.
Version: 4.0.0
Author: scdev
Author URI: https://scdev.pro
Text Domain: scdev-supreme-theme
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Developed by scdev - Professional WordPress Development
Website: https://scdev.pro
Support: support@scdev.pro

Features:
- Complete user account system with registration, login, profile management
- Social reactions system (like, love, laugh, wow, sad, angry)
- PayPal commerce integration with digital/physical products
- Advanced 3-column responsive layout system
- Individual height controls for content areas
- Complete dark/light mode system with persistence
- Social share buttons (Facebook, Twitter, WhatsApp, Gmail, Copy Link, Instagram)
- Advanced typography controls
- Professional visual effects and animations
- Mobile-first responsive design
- Comprehensive customization options
- Modular design - enable/disable features as needed
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile-First: Prevent horizontal overflow */
html,
body,
#page,
.site-content,
.three-column-layout,
.main-content,
.left-sidebar,
.right-sidebar,
.site-footer,
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Header needs visible overflow for dropdowns */
.site-header,
.header-layout,
.header-left,
.header-center,
.header-right {
    max-width: 100%;
    overflow: visible !important;
}

/* Ensure all images and media are responsive */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Prevent tables from breaking layout */
table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

html {
    height: 100%;
    overflow: hidden;
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    line-height: 1.6;
}

body {
    height: 100vh;
    overflow: hidden;
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile: Allow normal scrolling */
@media (max-width: 767px) {
    /* Force everything to fit within viewport */
    html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    html, body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    /* Ensure all containers fit */
    * {
        max-width: 100%;
    }
    
    /* Fix any elements that might overflow */
    #page,
    .site-content,
    .three-column-layout,
    .main-content,
    .left-sidebar,
    .right-sidebar,
    .site-footer,
    .container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Header needs visible overflow for dropdowns */
    .site-header,
    .header-layout {
        max-width: 100vw !important;
        overflow: visible !important;
    }
}

#page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--footer-height);
    padding-top: var(--header-gap);
}

/* Mobile: Allow normal page flow */
@media (max-width: 767px) {
    #page {
        height: auto;
        min-height: 100vh;
        padding-bottom: 0;
    }
}

/* Container */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e1e5e9;
    height: var(--header-height) !important;
    min-height: var(--header-height);
    max-height: var(--header-height);
    border-bottom-left-radius: var(--header-border-radius);
    border-bottom-right-radius: var(--header-border-radius);
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    z-index: 1000;
    padding: 0;
    flex-shrink: 0;
    margin: 0;
}

/* Mobile menu toggle - hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

.mobile-menu-dropdown {
    display: none;
}

/* Desktop header content - visible on desktop */
.desktop-header-content {
    display: block;
}

/* Mobile: Hide desktop content, show mobile menu */
@media (max-width: 767px) {
    .desktop-header-content {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .mobile-menu-dropdown {
        display: block !important;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* NEW: 3-Column Header Layout */
.header-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    gap: var(--content-gap);
    align-items: center;
    height: var(--header-height);
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    height: var(--header-height);
    overflow: visible;
    position: relative;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    justify-content: center;
}

.header-right {
    justify-content: flex-end;
}

.header-menu {
    list-style: none;
    display: flex;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.header-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.header-menu a:hover {
    color: #667eea;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.site-title:hover {
    color: #667eea;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 15px;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.main-navigation a:hover {
    color: #667eea;
}

/* Main Layout - 3 Column Grid */
.site-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.site-content {
    flex: 1;
    overflow: hidden;
}

/* Mobile: Allow normal flow */
@media (max-width: 767px) {
    .site-content {
        overflow: visible;
        flex: none;
    }
}

.three-column-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    gap: var(--content-gap);
    height: calc(100vh - var(--header-height) - var(--footer-height));
    max-width: var(--total-layout-width); /* Overridden by dynamic CSS based on layout mode */
    margin: var(--header-gap) auto var(--footer-gap) auto;
    padding: 0 20px;
}

/* Mobile: Stack layout vertically with flexbox */
@media (max-width: 767px) {
    .three-column-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 10px;
        max-width: 100%;
    }
}

/* Content Area */
.main-content {
    background: var(--content-bg-color);
    color: var(--content-text-color);
    margin: 10px 0;
    padding: 30px;
    border-radius: var(--content-border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    height: calc(100vh - var(--header-height) - var(--footer-height) - var(--header-gap) - var(--footer-gap) - 50px);
}

/* Mobile: Normal block layout */
@media (max-width: 767px) {
    .main-content {
        height: auto;
        min-height: 300px;
        margin: 10px 0;
        padding: 20px;
        overflow-y: visible;
        order: 2; /* Default order, can be overridden by positioning setting */
        width: 100%;
    }
}

/* Sidebars */
.left-sidebar,
.right-sidebar {
    background: #fff;
    margin: 10px 0;
    padding: 20px;
    border-radius: var(--sidebar-border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    height: calc(100vh - var(--header-height) - var(--footer-height) - var(--header-gap) - var(--footer-gap) - 50px);
}

/* Mobile: Stack sidebars */
@media (max-width: 767px) {
    .left-sidebar,
    .right-sidebar {
        height: auto;
        min-height: 200px;
        margin: 10px 0;
        padding: 15px;
        overflow-y: visible;
        width: 100%;
    }
    
    .left-sidebar {
        order: 1; /* Default order, can be overridden by positioning setting */
    }
    
    .right-sidebar {
        order: 3; /* Default order, can be overridden by positioning setting */
    }
}

/* Widgets */
.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #666;
    text-decoration: none;
}

.widget a:hover {
    color: #667eea;
}

/* Footer */
.site-footer {
    background: #333;
    color: #fff;
    height: var(--footer-height) !important;
    min-height: var(--footer-height);
    max-height: var(--footer-height);
    border-top-left-radius: var(--footer-border-radius);
    border-top-right-radius: var(--footer-border-radius);
    display: flex;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Mobile: Allow normal footer */
@media (max-width: 767px) {
    .site-footer {
        position: relative;
        height: auto !important;
        min-height: 60px;
        max-height: none;
        padding: 10px 0;
    }
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0;
}

/* NEW: 3-Column Footer Layout */
.footer-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    gap: var(--content-gap);
    align-items: center;
    height: var(--footer-height);
    width: 100%;
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    align-items: center;
    height: var(--footer-height);
}

.footer-left {
    justify-content: flex-start;
}

.footer-center {
    justify-content: center;
}

.footer-right {
    justify-content: flex-end;
}

.footer-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    text-decoration: none;
    color: #fff;
    font-size: 14px;
}

.footer-menu a:hover {
    opacity: 0.8;
}

.copyright-text {
    margin: 0;
    font-size: 14px;
    color: #fff;
}

/* Page Headers */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 18px;
    color: #666;
}

/* Mobile-First Responsive Design */

/* Base Mobile Styles (320px+) */
@media (max-width: 767px) {
    /* Reset container for mobile */
    .container {
        padding: 0 10px;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Force all content to fit */
    .main-content,
    .left-sidebar,
    .right-sidebar,
    article,
    .entry-content,
    .post,
    .page {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
    }
    
    /* Ensure images don't overflow */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix tables */
    table {
        display: block !important;
        overflow-x: auto !important;
        max-width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Mobile sticky header with smaller height */
    .site-header {
        height: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
        padding: 5px 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        background: var(--header-bg-color) !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }
    
    /* Add top padding to body to account for fixed header */
    body {
        padding-top: 50px !important;
    }
    
    .header-layout {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        height: 50px;
        text-align: left;
        padding: 0 15px;
    }
    
    .header-left,
    .header-center,
    .header-right {
        justify-content: flex-start;
        height: 50px;
        width: auto;
        flex: 1;
    }
    
    .header-left {
        justify-content: flex-start;
        flex: 0 0 auto;
    }
    
    .header-center {
        justify-content: center;
        flex: 1;
    }
    
    .header-right {
        justify-content: flex-end;
        flex: 0 0 auto;
    }
    
    /* Mobile menu toggle - 20px clickable area with small icon */
    .mobile-menu-toggle {
        display: block !important;
        background: var(--primary-color);
        border: none;
        color: white;
        cursor: pointer;
        padding: 0 !important; /* Override general button padding */
        width: 20px;
        height: 20px;
        min-width: 20px !important; /* Override general button min-width */
        min-height: 20px !important; /* Override general button min-height */
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: all 0.3s ease;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
        position: relative;
        overflow: hidden;
    }
    
    .mobile-menu-toggle:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        background: var(--primary-color);
        filter: brightness(1.1);
    }
    
    .mobile-menu-toggle:focus {
        outline: 1px solid var(--primary-color);
        outline-offset: 1px;
    }
    
    .mobile-menu-toggle:active {
        transform: translateY(0);
    }
    
    /* Small menu icon inside the 24px button */
    .menu-icon {
        position: relative;
        width: 12px;
        height: 9px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .menu-icon::before,
    .menu-icon::after,
    .menu-icon span {
        content: '';
        display: block;
        height: 2px; /* Increased from 1px to 2px for thicker strokes */
        width: 100%;
        background: white;
        border-radius: 1px;
        transition: all 0.3s ease;
    }
    
    .menu-icon::before {
        width: 100%;
    }
    
    .menu-icon span {
        width: 80%;
        margin-left: auto;
    }
    
    .menu-icon::after {
        width: 60%;
        margin-left: auto;
    }
    
    /* Animated icon when menu is open */
    .mobile-menu-toggle.active .menu-icon::before {
        transform: rotate(45deg) translate(3px, 3px);
        width: 100%;
    }
    
    .mobile-menu-toggle.active .menu-icon span {
        opacity: 0;
        transform: translateX(10px);
    }
    
    .mobile-menu-toggle.active .menu-icon::after {
        transform: rotate(-45deg) translate(3px, -3px);
        width: 100%;
        margin-left: 0;
    }
    
    /* Hide desktop navigation on mobile */
    .header-menu,
    .main-navigation ul,
    .desktop-header-content {
        display: none !important;
    }
    
    /* Show mobile menu elements */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Mobile dropdown menu with theme colors */
    .mobile-menu-dropdown {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        background: var(--header-bg-color);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        z-index: 999;
        max-height: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
        transform: translateY(-10px);
    }
    
    .mobile-menu-dropdown.active {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
    }
    
    .mobile-menu-dropdown ul {
        list-style: none;
        margin: 0;
        padding: 8px 0;
    }
    
    .mobile-menu-dropdown li {
        margin: 0;
        transform: translateX(-20px);
        opacity: 0;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-dropdown.active li {
        transform: translateX(0);
        opacity: 1;
    }
    
    .mobile-menu-dropdown.active li:nth-child(1) { transition-delay: 0.1s; }
    .mobile-menu-dropdown.active li:nth-child(2) { transition-delay: 0.15s; }
    .mobile-menu-dropdown.active li:nth-child(3) { transition-delay: 0.2s; }
    .mobile-menu-dropdown.active li:nth-child(4) { transition-delay: 0.25s; }
    .mobile-menu-dropdown.active li:nth-child(5) { transition-delay: 0.3s; }
    
    .mobile-menu-dropdown a {
        display: block;
        padding: 10px 20px;
        color: var(--nav-menu-color);
        text-decoration: none;
        font-size: var(--nav-menu-font-size);
        font-weight: 500;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        min-height: 40px;
        display: flex;
        align-items: center;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-menu-dropdown a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--nav-menu-hover-color);
        transform: translateX(-4px);
        transition: transform 0.3s ease;
    }
    
    .mobile-menu-dropdown a:hover::before {
        transform: translateX(0);
    }
    
    .mobile-menu-dropdown a:hover {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
        color: var(--nav-menu-hover-color);
        padding-left: 30px;
    }
    
    .mobile-menu-dropdown li:last-child a {
        border-bottom: none;
    }
    
    /* Mobile navigation */
    .main-navigation ul {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 10px;
        margin: 0;
        padding: 0;
    }
    
    /* Mobile footer */
    .footer-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
        text-align: center;
        height: auto;
    }
    
    .footer-left,
    .footer-center,
    .footer-right {
        justify-content: center;
        height: auto;
        width: 100%;
    }
    
    .footer-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .footer-menu a {
        padding: 8px 12px;
        min-height: 44px;
        display: block;
    }
    
    /* Mobile typography */
    .site-title {
        font-size: 18px !important;
        margin-bottom: 0;
        line-height: 1.2;
    }
    
    /* Mobile UI elements - adjust for sticky header */
    .scroll-to-top {
        width: 50px !important;
        height: 50px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 20px !important;
    }
    
    /* Mobile social media */
    .social-media-icons {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    /* Social media hover effects */
    .social-media-icons a {
        transition: transform 0.2s ease, opacity 0.2s ease !important;
        display: inline-block;
        position: relative;
    }
    
    .social-media-icons a:hover {
        transform: scale(1.2) !important;
        opacity: 0.8 !important;
    }
    
    /* Tooltip styling for social media */
    .social-media-icons a[title]:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        z-index: 1000;
        pointer-events: none;
    }
    
    .social-media-icons a[title]:hover::before {
        content: '';
        position: absolute;
        bottom: 95%;
        left: 50%;
        transform: translateX(-50%);
        border: 4px solid transparent;
        border-top-color: rgba(0, 0, 0, 0.8);
        z-index: 1000;
        pointer-events: none;
    }
    
    /* Mobile widgets */
    .widget {
        margin-bottom: 20px;
    }
    
    .widget-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }
    
    .main-content,
    .left-sidebar,
    .right-sidebar {
        margin: 5px 0;
        padding: 15px;
    }
    
    .header-menu a,
    .footer-menu a {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .dark-mode-toggle {
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
    
    .scroll-to-top {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
    }
}

/* Tablet Styles (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .three-column-layout {
        grid-template-columns: 200px 1fr 200px;
        padding: 0 15px;
    }
    
    .header-layout,
    .footer-layout {
        grid-template-columns: 200px 1fr 200px;
        gap: 15px;
    }
    
    .main-content,
    .left-sidebar,
    .right-sidebar {
        margin: 8px 5px;
        padding: 20px;
    }
}

/* Desktop Styles (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .three-column-layout {
        grid-template-columns: 250px 1fr 250px;
        padding: 0 15px;
    }
    
    .header-layout,
    .footer-layout {
        grid-template-columns: 250px 1fr 250px;
        gap: 15px;
    }
    
    .main-content,
    .left-sidebar,
    .right-sidebar {
        margin: 8px 5px;
        padding: 22px;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .three-column-layout {
        grid-template-columns: 300px 1fr 300px;
        padding: 0 20px;
    }
    
    .header-layout,
    .footer-layout {
        grid-template-columns: 300px 1fr 300px;
        gap: 20px;
    }
    
    .main-content {
        padding: 30px;
    }
    
    .left-sidebar,
    .right-sidebar {
        padding: 20px;
    }
}

/* Links and Buttons */
a {
    color: #667eea;
    text-decoration: none;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
}

a:hover {
    opacity: 0.8;
}

/* Touch-friendly buttons */
button,
.button,
a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* Mobile touch improvements */
@media (max-width: 767px) {
    a, button, .button {
        min-height: 44px;
        padding: 8px 12px;
    }
    
    /* Improve touch targets */
    .header-menu a,
    .footer-menu a {
        min-height: 44px;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

button,
.button {
    background: #667eea;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.button:hover {
    background: #5a6fd8;
    color: #fff;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

/* Touch Device Improvements */
.touch-device .dark-mode-toggle.touch-active,
.touch-device .scroll-to-top.touch-active,
.touch-device .mobile-menu-toggle.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Improve text selection on mobile */
    * {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Better button interactions */
    button, .button, a {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    }
    
    /* Improve form elements on mobile */
    input, textarea, select {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-appearance: none;
        appearance: none;
        border-radius: 4px;
    }
    
    /* Better spacing for mobile */
    .widget {
        margin-bottom: 15px;
    }
    
    .widget:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile menu overlay for better UX */
    .mobile-menu-dropdown.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.2);
        z-index: -1;
        opacity: 0;
        animation: fadeIn 0.3s ease forwards;
    }
    
    @keyframes fadeIn {
        to {
            opacity: 1;
        }
    }
}