/* ==================== CROSS-PLATFORM FONT STANDARDIZATION ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 🌊 Fixed Wallpaper Background with Animation Overlay */
body {
    background: url('../assets/pxfuel.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #eafaff;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
}

/* 🌊 Simple Static Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(135, 206, 235, 0.1) 0%, 
        rgba(70, 130, 180, 0.05) 50%, 
        rgba(255, 215, 0, 0.08) 100%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* Simplified Mac-compatible styling */

/* ✅ Tech panel with strong anime UI feel */
.panel {
    position: relative;
    background: rgba(11, 20, 38, 0.9);
    border: 1px solid rgba(135, 206, 235, 0.2);
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(135, 206, 235, 0.15);
    padding: 30px;
    max-width: 700px;
    margin: 80px auto;
    z-index: 1;
    text-shadow: 0 0 3px #87CEEB;
    border: 1px solid #ffffff;
}

/* Add white borders to main content areas */

.page-wrapper {
    display: flex;
    padding: 20px;
    flex-wrap: nowrap;
    flex: 1;
    position: relative;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.sidebar {
    min-width: 280px;
    margin-right: 20px;
    margin-left: 15px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.main {
    max-width: 1200px;
    margin: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0;
    flex: 1;
    min-width: 0;
    position: relative;
    border: 1px solid #ffffff;
    transition: all 0.3s ease;
}

/* Header section styling for all pages */
.header-section {
    background: linear-gradient(to right, #4682B4, #ADD8E6);
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 0;
    width: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="header" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10 0 L10 20 M0 10 L20 10" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23header)"/></svg>');
    opacity: 0.3;
}

.header-section h1 {
            color: #ffffff;
            text-align: center;
            margin: 0;
            font-size: 2em;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
            position: relative;
            z-index: 1;
        }

        .subtitle {
            color: #ffffff;
            font-size: 1.2em;
            margin-top: 10px;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
            position: relative;
            z-index: 1;
        }

.content-section {
    padding: 40px;
}

/* Right sidebar positioning fix */
.right-sidebar {
    width: 280px;
    min-width: 280px;
    flex: 0 0 280px;
    position: relative;
    top: auto;
    right: auto;
    margin-left: 20px;
    margin-right: 15px;
}

/* Ensure main content area has proper structure */
.main {
    max-width: 1200px;
    margin: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0;
    position: relative;
    border: 1px solid #ffffff;
    overflow: hidden;
}


/* Modern card styling for pages like rules and duel */
.modern-card {
    background: #f0f8ff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    border-left: 4px solid #4682B4;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.modern-title {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.modern-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4682B4, #ADD8E6);
    border-radius: 2px;
}

.modern-list {
    list-style-type: none;
    padding-left: 0;
}

.modern-list li {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-left: 3px solid #4682B4;
    transition: all 0.3s ease;
}

.modern-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.modern-list li::before {
    content: '📋';
    margin-right: 10px;
    font-size: 1.2em;
}

/* ==================== GLOBAL MOBILE NAVIGATION STYLES ==================== */

/* Mobile navigation styles are now handled in mobile_navigation.php */

/* ==================== GLOBAL RESPONSIVE UTILITIES ==================== */

/* Large Desktop: Full size components */
@media (min-width: 1400px) {
    .header {
        height: 20vh;
        min-height: 200px;
    }
    
    .sidebar, .right-sidebar {
        width: 280px;
        min-width: 280px;
        flex: 0 0 280px;
    }
    
    .main {
        max-width: 1200px;
    }
    
    .content-section {
        padding: 40px;
    }
    
    /* Full size typography */
    h1, h2, h3, h4, h5, h6 {
        font-size: inherit;
    }
    
    p, li, span, div {
        font-size: 1em;
        line-height: 1.6;
    }
}

/* 70% Screen Width: Medium-large components */
@media (max-width: 1399px) and (min-width: 1280px) {
    .page-wrapper {
        padding: 14px;
    }
    
    .header {
        height: 18vh;
        min-height: 180px;
    }
    
    .sidebar {
        width: 250px;
        min-width: 250px;
        flex: 0 0 250px;
        margin-left: 11px;
        margin-right: 16px;
        padding: 16px;
        font-size: 0.95em;
    }
    
    .right-sidebar {
        width: 250px;
        min-width: 250px;
        flex: 0 0 250px;
        margin-left: 16px;
        margin-right: 11px;
        padding: 13px 13px 23px 13px;
        height: fit-content;
        max-height: 90vh;
    }
    
    .main {
        max-width: 1050px;
    }
    
    .content-section {
        padding: 30px;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-size: 0.95em;
    }
    
    p, li, span, div {
        font-size: 0.95em;
        line-height: 1.5;
    }
}

/* Desktop: Slightly smaller components */
@media (max-width: 1279px) and (min-width: 1200px) {
    .page-wrapper {
        padding: 12px;
    }
    
    .header {
        height: 17vh;
        min-height: 170px;
    }
    
    .sidebar {
        width: 230px;
        min-width: 230px;
        flex: 0 0 230px;
        margin-left: 9px;
        margin-right: 14px;
        padding: 14px;
        font-size: 0.9em;
    }
    
    .right-sidebar {
        width: 230px;
        min-width: 230px;
        flex: 0 0 230px;
        margin-left: 14px;
        margin-right: 9px;
        padding: 11px 11px 21px 11px;
        height: fit-content;
        max-height: 87vh;
    }
    
    .main {
        max-width: 950px;
    }
    
    .content-section {
        padding: 25px;
    }
    
    /* Slightly smaller typography */
    h1, h2, h3, h4, h5, h6 {
        font-size: 0.9em;
    }
    
    p, li, span, div {
        font-size: 0.9em;
        line-height: 1.4;
    }
}

/* Large Tablet: Medium components */
@media (max-width: 1199px) and (min-width: 1024px) {
    .page-wrapper {
        padding: 10px;
    }
    
    .header {
        height: 15vh;
        min-height: 150px;
    }
    
    .sidebar {
        width: 210px;
        min-width: 210px;
        flex: 0 0 210px;
        margin-left: 8px;
        margin-right: 12px;
        padding: 12px;
        font-size: 0.85em;
    }
    
    .right-sidebar {
        width: 210px;
        min-width: 210px;
        flex: 0 0 210px;
        margin-left: 12px;
        margin-right: 8px;
        padding: 9px 9px 19px 9px;
        height: fit-content;
        max-height: 85vh;
    }
    
    .main {
        max-width: 850px;
    }
    
    .content-section {
        padding: 20px;
    }
    
    /* Medium typography */
    h1, h2, h3, h4, h5, h6 {
        font-size: 0.85em;
    }
    
    p, li, span, div {
        font-size: 0.85em;
        line-height: 1.3;
    }
}

/* Tablet: Smaller components */
@media (max-width: 1023px) and (min-width: 769px) {
    .page-wrapper {
        padding: 12px;
    }
    
    .header {
        height: 14vh;
        min-height: 140px;
    }
    
    .sidebar {
        width: 180px;
        min-width: 180px;
        flex: 0 0 180px;
        margin-left: 8px;
        margin-right: 12px;
    }
    
    .right-sidebar {
        width: 180px;
        min-width: 180px;
        flex: 0 0 180px;
        margin-left: 12px;
        margin-right: 8px;
    }
    
    .main {
        max-width: 600px;
    }
    
    .content-section {
        padding: 25px;
    }
    
    /* Smaller typography */
    h1, h2, h3, h4, h5, h6 {
        font-size: 0.95em;
    }
    
    p, li, span, div {
        font-size: 0.95em;
        line-height: 1.3;
    }
}

/* Mobile: Hide sidebars, allow scrolling */
@media (max-width: 768px) {
    /* Allow scrolling on mobile */
    body {
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 100vh;
        padding-top: 120px !important; /* More space between header and content */
    }
    
    /* Hide desktop sidebars */
    .sidebar,
    .right-sidebar {
        display: none !important;
    }
    
    /* Adjust page wrapper for mobile */
    .page-wrapper {
        display: flex !important;
        flex-direction: column !important;
        padding: 20px !important; /* Match desktop padding */
        margin-top: 0 !important; /* Remove top margin since header is fixed */
        margin-bottom: 80px !important; /* Space for bottom nav */
        min-height: calc(100vh - 120px) !important; /* Account for fixed header with extra space */
    }
    
    .main {
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        grid-column: 1;
    }
    
    /* Mobile navigation z-index hierarchy */
    .mobile-hamburger-left,
    .mobile-hamburger-right {
        z-index: 11000 !important; /* Highest - hamburger buttons */
    }
    
    .mobile-menu {
        z-index: 10000 !important; /* Mobile menus */
    }
    
    .mobile-menu-overlay {
        z-index: 9999 !important; /* Overlay */
    }
    
    .header {
        z-index: 1000 !important; /* Header */
    }
    
    .bottom-nav {
        z-index: 998 !important; /* Bottom navigation */
    }
    
    /* Mobile typography */
    h1, h2, h3, h4, h5, h6 {
        font-size: 0.9em;
    }
    
    p, li, span, div {
        font-size: 0.9em;
        line-height: 1.2;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .page-wrapper {
        padding: 5px !important;
    }
    
    /* Extra small typography for small mobile */
    h1, h2, h3, h4, h5, h6 {
        font-size: 0.85em;
    }
    
    p, li, span, div {
        font-size: 0.85em;
        line-height: 1.1;
    }
}

/* ==================== HEADER SIDEBAR ALIGNMENT ==================== */

/* Ensure header aligns with sidebar margins */
.header {
    box-sizing: border-box;
}

/* ==================== FIREFOX-SPECIFIC COMPATIBILITY ==================== */

/* Firefox-specific fixes for sidebar and layout issues */
@-moz-document url-prefix() {
    .sidebar {
        margin-left: 15px !important;
        margin-right: 20px !important;
        width: 280px !important;
        min-width: 280px !important;
        flex: 0 0 280px !important;
        height: auto !important;
    }
    
    .right-sidebar {
        margin-left: 20px !important;
        margin-right: 15px !important;
        width: 280px !important;
        min-width: 280px !important;
        flex: 0 0 280px !important;
        height: fit-content !important;
        max-height: 95vh !important;
    }
    
    .main {
        flex: 1 !important;
        min-width: 0 !important;
        width: auto !important;
    }
    
    .page-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    .header {
        width: calc(100% - 180px) !important;
        margin: 0 auto !important;
    }
}

/* ==================== MAC-SPECIFIC COMPATIBILITY ==================== */

/* Mac Safari and Chrome specific fixes */
@supports (-webkit-appearance: none) {
    /* Ensure proper rendering on Mac */
    .main {
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        -webkit-perspective: 1000;
    }
    
    .sidebar, .right-sidebar {
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
    }
    
    /* Fix Mac font rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Mac-specific grid fallbacks */
@supports not (display: grid) {
    .page-wrapper {
        display: flex;
        flex-wrap: nowrap !important;
    }
    
    .sidebar {
        flex: 0 0 280px;
        margin-right: 20px;
    }
    
    .main {
        flex: 1;
        min-width: 0;
    }
    
    .right-sidebar {
        flex: 0 0 280px;
        margin-left: 20px;
    }
}

/* Mobile navigation is handled by mobile_navigation.php */

/* ==================== CLICK TIMEOUT SYSTEM ==================== */

/* Click timeout message styling */
#click-timeout-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
}

@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; }
}

/* Click timeout system ready for JavaScript integration */
