/*
Theme Name: SCDev Supreme Theme
Description: The ultimate flexible WordPress theme with per-page layout control, advanced customization, and built-in user account system. Create unique layouts for every page - from full-width landing pages to traditional blogs. Features: Per-page sidebar control (both/left/right/none), header/footer visibility per page, background sliders with rotating images, background-only pages for visual storytelling, extensive color controls, dark mode, user registration/login, Google Sign-In, style presets, and mobile-responsive design. Perfect for blogs, business sites, portfolios, agencies, membership sites, and custom web applications.
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

🎯 KEY FEATURES:

📐 Per-Page Layout Control (NEW!)
- Choose different layouts for each page/post
- Options: Both sidebars, left only, right only, no sidebars, or no content area
- Control header/footer visibility per page
- Perfect for landing pages, articles, and custom designs
- Background-only pages for full-screen visual storytelling

🎨 Advanced Customization
- Three-column layout with flexible sidebars
- Extensive color controls for every element
- Custom header and footer builder (left/center/right sections)
- Style presets for quick design changes
- Individual height controls for all elements
- Dark mode with customizable colors
- Typography controls (fonts, sizes, weights)

👤 User Account System
- Built-in registration and login
- Google Sign-In integration
- Custom user profiles
- Dropdown account menu in header
- Customizable user interface colors
- Email confirmation support
- Role-based menu visibility

🎯 Layout Flexibility
- Configurable sidebar positions
- Mobile sidebar positioning options
- Collapsible sidebar menus
- Widget-ready sidebars
- Full-width content option
- Responsive design for all devices

💡 QUICK TIPS:

→ Create Landing Pages: Set layout to "No Content Area" + hide header/footer for full-screen designs
→ Article Pages: Use "No Sidebars" for distraction-free reading
→ Custom Layouts: Mix and match sidebars per page for unique designs
→ Style Presets: Save your color schemes and switch between them instantly
→ Dark Mode: Enable automatic dark mode or let users toggle manually
→ User Accounts: Add login/registration without plugins
→ Mobile First: All layouts automatically adapt to mobile devices

🚀 GETTING STARTED:

1. Activate theme and go to Appearance > Customize
2. Configure your colors, fonts, and layout defaults
3. When editing pages, use the "Page Layout Options" meta box to customize each page
4. Enable user accounts in Customizer > User Account System
5. Add widgets to sidebars in Appearance > Widgets

📱 Perfect for: Blogs, Business Sites, Portfolios, Membership Sites, E-commerce, Landing Pages, Custom Web Apps
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Sticky Footer Layout */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
}

/* 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);
    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: visible;
    position: relative;
    z-index: 1000;
    padding: 0;
    flex-shrink: 0;
    margin: 0;
    top: 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: 25% 50% 25%;
    gap: 0;
    align-items: center;
    height: var(--header-height);
    width: 100%;
    overflow: visible;
    position: relative;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    height: var(--header-height);
    overflow: visible;
    position: relative;
    min-width: 0;
    padding: 0 10px;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    justify-content: center;
}

.header-right {
    justify-content: flex-start;
}

.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) - 20px);
    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: 10px;
    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) - 30px);
}

/* Mobile: Normal block layout */
@media (max-width: 767px) {
    .main-content {
        height: auto;
        min-height: 300px;
        margin: 10px 0;
        padding: 10px;
        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: 10px;
    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) - 30px);
}

/* Scrollbar styles moved to customizer settings in functions.php */

/* 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);
    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;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow: visible;
}

/* Footer Layout - 25% / 50% / 25% */
.footer-layout {
    display: grid;
    grid-template-columns: 25% 50% 25%;
    gap: 0;
    align-items: center;
    height: var(--footer-height);
    width: 100%;
    overflow: visible;
    position: relative;
}

.footer-left,
.footer-center,
.footer-right {
    display: flex;
    align-items: center;
    height: var(--footer-height);
    overflow: visible;
    position: relative;
    min-width: 0;
    padding: 0 10px;
}

.footer-left {
    justify-content: flex-start;
}

.footer-center {
    justify-content: center;
}

.footer-right {
    justify-content: flex-end;
}

/* Add padding to body to prevent content from going under fixed footer */
body {
    padding-bottom: var(--footer-height);
}

/* Mobile: Allow normal footer */
@media (max-width: 767px) {
    .site-footer {
        position: fixed;
        height: auto !important;
        min-height: 60px;
        max-height: none;
        padding: 10px 0;
    }
    
    body {
        padding-bottom: 60px;
    }
}

.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: center;
        align-items: center;
        gap: 0;
        height: 50px;
        text-align: center;
        padding: 0 15px;
    }
    
    /* Mobile: Hide left and right, only show center */
    .header-left,
    .header-right {
        display: none !important;
    }
    
    .header-center {
        justify-content: center;
        height: 50px;
        width: 100%;
        flex: 1;
    }
    
    /* 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 and Footer ALWAYS 25% / 50% / 25% */
    .header-layout,
    .footer-layout {
        grid-template-columns: 25% 50% 25%;
        gap: 15px;
    }
    
    .main-content,
    .left-sidebar,
    .right-sidebar {
        margin: 8px 5px;
        padding: 10px;
    }
}

/* 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 and Footer ALWAYS 25% / 50% / 25% */
    .header-layout,
    .footer-layout {
        grid-template-columns: 25% 50% 25%;
        gap: 15px;
    }
    
    .main-content,
    .left-sidebar,
    .right-sidebar {
        margin: 8px 5px;
        padding: 10px;
    }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .three-column-layout {
        grid-template-columns: 300px 1fr 300px;
        padding: 0 20px;
    }
    
    /* Header and Footer ALWAYS 25% / 50% / 25% */
    .header-layout,
    .footer-layout {
        grid-template-columns: 25% 50% 25%;
        gap: 20px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .left-sidebar,
    .right-sidebar {
        padding: 10px;
    }
}

/* 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;
        }
    }
}

/* ============================================
   CUSTOM COMMENTS SYSTEM
   Modern comment styling with emoji support
   ============================================ */

.comments-area {
    margin: 40px 0;
    padding: 30px;
    background: var(--content-bg-color, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.comments-title {
    font-size: 24px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color, #0066cc);
    color: var(--text-color, #000000);
}

/* Comment List */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.comment-list .comment {
    margin-bottom: 25px;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin-left: 50px;
    padding-left: 20px;
    border-left: 3px solid var(--primary-color, #0066cc);
}

/* Comment Body */
.comment-body {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--sidebar-bg-color, #f9f9f9);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.comment-body:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Avatar */
.comment-author-avatar {
    flex-shrink: 0;
}

.comment-author-avatar img {
    border-radius: 50%;
    border: 3px solid var(--primary-color, #0066cc);
}

/* Comment Content */
.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-author-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-color, #000000);
}

.comment-author-name a {
    color: var(--link-color, #0066cc);
    text-decoration: none;
}

.comment-author-name a:hover {
    color: var(--link-hover-color, #0052a3);
}

/* Admin badge - hidden */
.admin-badge {
    display: none !important;
}

/* Original admin badge styling - commented out
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 11px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 600;
}
*/

.comment-metadata {
    font-size: 13px;
    color: #666;
}

.comment-text {
    margin: 15px 0;
    line-height: 1.7;
    color: var(--text-color, #000000);
    word-wrap: break-word;
}

.comment-text p {
    margin-bottom: 10px;
}

.comment-awaiting-moderation {
    padding: 10px 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.comment-actions a {
    font-size: 14px;
    color: var(--link-color, #0066cc);
    text-decoration: none;
    transition: all 0.2s ease;
}

.comment-actions a:hover {
    color: var(--link-hover-color, #0052a3);
    transform: translateX(3px);
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 30px;
    font-size: 16px;
    color: #666;
    background: var(--sidebar-bg-color, #f9f9f9);
    border-radius: 8px;
}

/* Comment Form */
.comment-respond {
    margin-top: 40px;
    padding: 30px;
    background: var(--sidebar-bg-color, #f9f9f9);
    border-radius: 12px;
}

.comment-reply-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-color, #000000);
}

.comment-reply-title small {
    font-size: 14px;
    margin-left: 10px;
}

.comment-reply-title small a {
    color: #dc3545;
    text-decoration: none;
}

.comment-reply-title small a:hover {
    text-decoration: underline;
}

.comment-notes {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.required {
    color: #dc3545;
    font-weight: bold;
}

/* Form Fields */
.comment-form-author,
.comment-form-email,
.comment-form-url,
.comment-form-comment {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color, #000000);
    font-size: 14px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--content-bg-color, #ffffff);
    color: var(--text-color, #000000);
}

.comment-form input:focus {
    outline: none;
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Comment Textarea with Emoji Picker */
.comment-textarea-wrapper {
    position: relative;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    padding-right: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    height: 100px;
    transition: all 0.3s ease;
    background: var(--content-bg-color, #ffffff);
    color: var(--text-color, #000000);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Emoji Picker Trigger */
.emoji-picker-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #0066cc);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 10;
}

.emoji-picker-trigger:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    top: 50px;
    right: 10px;
    width: 300px;
    max-height: 250px;
    overflow-y: auto;
    background: var(--content-bg-color, #ffffff);
    border: 2px solid var(--primary-color, #0066cc);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-picker span {
    font-size: 24px;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.emoji-picker span:hover {
    background: var(--primary-color, #0066cc);
    transform: scale(1.3);
}

/* Submit Button */
.submit-comment-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color, #0066cc) 0%, #0052a3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.submit-comment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

.submit-comment-btn:active {
    transform: translateY(0);
}

/* Comment Navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.comment-navigation a {
    color: var(--link-color, #0066cc);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.comment-navigation a:hover {
    color: var(--link-hover-color, #0052a3);
    transform: translateX(5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comments-area {
        padding: 20px;
    }
    
    .comment-list .children {
        margin-left: 20px;
        padding-left: 15px;
    }
    
    .comment-body {
        flex-direction: column;
        gap: 10px;
    }
    
    .comment-author-avatar {
        align-self: flex-start;
    }
    
    .emoji-picker {
        width: 250px;
        grid-template-columns: repeat(6, 1fr);
    }
    
    .comment-respond {
        padding: 20px;
    }
}

/* Dark Mode Support */
body.dark-mode .comments-area {
    background: var(--dark-content-bg-color, #2a2a2a);
}

body.dark-mode .comment-body {
    background: var(--dark-sidebar-bg-color, #1a1a1a);
}

body.dark-mode .comment-respond {
    background: var(--dark-sidebar-bg-color, #1a1a1a);
}

body.dark-mode .emoji-picker {
    background: var(--dark-content-bg-color, #2a2a2a);
    border-color: var(--dark-primary-color, #4d94ff);
}

body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
    background: var(--dark-content-bg-color, #2a2a2a);
    color: var(--dark-text-color, #ffffff);
    border-color: #444;
}

body.dark-mode .comment-form input:focus,
body.dark-mode .comment-form textarea:focus {
    border-color: var(--dark-primary-color, #4d94ff);
}


/* ========================================
   SCDev Downloads - Profile Integration
   ======================================== */

.scdev-downloads-list {
    margin-top: 20px;
}

.scdev-download-item {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.scdev-download-item:hover {
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scdev-download-item .download-info h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--text-color, #333);
}

.scdev-download-item .download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: var(--text-muted, #666);
}

.scdev-download-item .download-meta span {
    display: inline-flex;
    align-items: center;
}

.scdev-download-item .download-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scdev-download-item .download-button {
    background: var(--primary-color, #007bff);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.scdev-download-item .download-button:hover {
    background: var(--primary-hover, #0056b3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.scdev-download-item .order-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.scdev-download-item .order-status.status-completed {
    background: #d4edda;
    color: #155724;
}

.scdev-download-item .order-status.status-pending {
    background: #fff3cd;
    color: #856404;
}

.scdev-download-item .order-status.status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Dark Mode Support */
body.dark-mode .scdev-download-item {
    background: var(--card-bg-dark, #2a2a2a);
    border-color: var(--border-color-dark, #444);
}

body.dark-mode .scdev-download-item:hover {
    border-color: var(--primary-color, #007bff);
}

body.dark-mode .scdev-download-item .download-info h4 {
    color: var(--text-color-dark, #f0f0f0);
}

body.dark-mode .scdev-download-item .download-meta {
    color: var(--text-muted-dark, #aaa);
}

/* Responsive Design */
@media (max-width: 768px) {
    .scdev-download-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .scdev-download-item .download-actions {
        width: 100%;
        margin-top: 15px;
        justify-content: space-between;
    }
    
    .scdev-download-item .download-button {
        flex: 1;
        text-align: center;
    }
}
