/**
 * Layout CSS for Klick-Game
 * Defines the main layout structure of the site
 * Fully responsive with relative units
 */

/* ============================================
   BACKGROUND - ALWAYS VISIBLE, STRETCHED, FIXED
   ============================================ */
html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

/* Body background with image - always visible while scrolling */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url('/images/body-bg.jpg');
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-color: #2a2a2a;
}

/* Main container */
.site-header {
    width: 100%;
    margin: 0 auto;
}

.container {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Site content layout - Three column responsive layout */
.site-content {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem);
    grid-template-areas: "left main right";
    gap: 1rem;
    margin: 0;
    width: 100%;
    min-height: calc(100vh - 20rem);
    align-items: start;
}

/* Left sidebar */
.site-content-left {
    grid-area: left;
    min-width: 0;
}

/* Main content area */
.site-content-main {
    grid-area: main;
    min-width: 0;
    max-width: 100%;
}

/* Right sidebar */
.site-content-right {
    grid-area: right;
    min-width: 0;
}

/* Footer - now outside flex container */
.site-footer {
    width: 100%;
    max-width: 90rem;
    margin: 1.25rem auto 0;
    padding: 1rem;
}

/* Sidebar styling */
.sidebar {
    background-color: #021B40;
    border-radius: 0.3125rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

/* Menu divider */
.menu-div {
    background-color: #726B6C;
    padding: 0.3125rem 0.625rem;
    color: white;
    font-weight: bold;
    border-bottom: 0.0625rem solid #444;
}

/* Menu text */
.menu-text {
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* Sidebar items */
.sidebar-items-left,
.sidebar-items-right {
    padding: 0.3125rem 0;
}

.sidebar-items-left div,
.sidebar-items-right div {
    padding: 0.1875rem 0.625rem;
}

.sidebar-items-left a,
.sidebar-items-right a {
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
}

.sidebar-items-left a:hover,
.sidebar-items-right a:hover {
    text-decoration: underline;
}

.sidebar-items-left img,
.sidebar-items-right img {
    vertical-align: middle;
    margin-right: 0.3125rem;
}

/* Username in sidebar */
.sidebar-username {
    font-weight: bold;
    color: #fff;
    padding: 0.3125rem 0.625rem;
    margin-bottom: 0.3125rem;
    border-bottom: 0.0625rem solid #444;
}

/* Sidebar number */
.sidebar-num {
    display: inline-block;
    width: 1.25rem;
    color: #fff;
    font-weight: bold;
}

/* Menu placeholder */
.menu-placeholder {
    /* Remove placeholder behavior - display normally */
}

/* Text alignment */
.text-align-center {
    text-align: center;
}

/* Link styles */
.link7, .link13, .link18, .link3 {
    color: #fff;
    text-decoration: none;
}

.link7:hover, .link13:hover, .link18:hover, .link3:hover {
    text-decoration: underline;
}

.link13 {
    color: #FF7400;
}

.link18 {
    color: #00FFFF;
}

.link3 {
    color: #00FF00;
}

/* Responsive layout */
@media (max-width: 1200px) {
    .site-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "left"
            "main"
            "right";
        gap: 1rem;
    }
    
    /* Ensure sidebars don't overlap on narrow screens */
    .site-content-left,
    .site-content-right {
        position: relative;
        width: 100%;
        max-width: 100%;
    }
    
    .site-content-main {
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================
   Additional Responsive Layout Enhancements
   ============================================ */

/* Mobile Layout Optimizations */
@media (max-width: 767px) {
    /* Site header responsive */
    .site-header {
        padding: 0.5rem 0;
    }

    /* Container adjustments */
    .container {
        padding: 0 0.625rem;
    }

    /* Main content spacing */
    .site-content-main {
        padding: 0.625rem;
    }

    /* Sidebar responsive */
    .sidebar {
        margin-bottom: 1rem;
        border-radius: 0.25rem;
    }

    .menu-div {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .menu-text {
        font-size: 0.8125rem;
    }

    .sidebar-items-left,
    .sidebar-items-right {
        padding: 0.5rem 0;
    }

    .sidebar-items-left div,
    .sidebar-items-right div {
        padding: 0.5rem;
    }

    .sidebar-items-left a,
    .sidebar-items-right a {
        font-size: 0.8125rem;
        display: flex;
        align-items: center;
        padding: 0.25rem 0;
        min-height: 2.75rem; /* Touch-friendly */
    }

    .sidebar-items-left img,
    .sidebar-items-right img {
        margin-right: 0.5rem;
        width: 1rem;
        height: auto;
    }

    .sidebar-username {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .sidebar-num {
        width: 1.5625rem;
        font-size: 0.9rem;
    }

    /* Site footer responsive */
    .site-footer {
        padding: 1rem;
        font-size: 0.875rem;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .container {
        padding: 0 0.3125rem;
    }

    .site-content-main {
        padding: 0.3125rem;
    }

    .sidebar {
        margin-bottom: 0.75rem;
    }

    .menu-div {
        padding: 0.4rem;
        font-size: 0.8rem;
    }

    .menu-text {
        font-size: 0.75rem;
    }

    .sidebar-items-left a,
    .sidebar-items-right a {
        font-size: 0.75rem;
    }
}

/* Tablet layout */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 45rem; /* 720px */
        padding: 0 1rem;
    }

    .site-content-left,
    .site-content-right {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    /* Keep sidebar styling but full width */
    .sidebar {
        max-width: 100%;
    }

    /* Two-column sidebar layout on tablet */
    .sidebar-items-left,
    .sidebar-items-right {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .sidebar-items-left div,
    .sidebar-items-right div {
        padding: 0.5rem;
    }
}

/* Desktop layout enhancements */
@media (min-width: 1201px) {
    .container {
        max-width: 90%;
    }

    .site-content {
        grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem);
        gap: 1.5rem;
    }

    .sidebar {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        align-self: start;
    }

    /* Custom scrollbar for sidebar */
    .sidebar::-webkit-scrollbar {
        width: 0.5rem;
    }

    .sidebar::-webkit-scrollbar-track {
        background: #444;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 0.25rem;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: #aaa;
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 92%;
    }

    .site-content {
        grid-template-columns: minmax(13rem, 16rem) 1fr minmax(13rem, 16rem);
    }

    .sidebar-items-left a,
    .sidebar-items-right a {
        font-size: 0.8125rem;
    }
    
    /* Sticky sidebars on large screens */
    .site-content-left,
    .site-content-right {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Extra large screens */
@media (min-width: 1600px) {
    .container {
        max-width: 95%;
    }

    .site-content {
        grid-template-columns: minmax(14rem, 18rem) 1fr minmax(14rem, 18rem);
    }
    
    /* Sticky sidebars on extra large screens */
    .site-content-left,
    .site-content-right {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Scrollbar styling for sticky sidebars */
@media (min-width: 1200px) {
    .site-content-left::-webkit-scrollbar,
    .site-content-right::-webkit-scrollbar {
        width: 0.375rem;
    }
    
    .site-content-left::-webkit-scrollbar-track,
    .site-content-right::-webkit-scrollbar-track {
        background: #2a2a2a;
    }
    
    .site-content-left::-webkit-scrollbar-thumb,
    .site-content-right::-webkit-scrollbar-thumb {
        background: #595959;
        border-radius: 0.1875rem;
    }
    
    .site-content-left::-webkit-scrollbar-thumb:hover,
    .site-content-right::-webkit-scrollbar-thumb:hover {
        background: #726B6C;
    }
}

/* Fix for Bootstrap conflicts */
.mx-3 {
    margin-left: 1rem !important;
    margin-right: 1rem !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.text-white {
    color: #fff !important;
}
