/**
 * Final Design Fixes for Klick-Game
 * Addresses all remaining design issues
 */

/* ============================================
   1. SIDEBAR LINEBREAKS FIX
   Icons and numbers on same line as links
   ============================================ */

.sidebar-items-left div,
.sidebar-items-right div {
    display: flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    white-space: nowrap;
}

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

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

.sidebar-notification {
    margin-left: auto;
    padding-left: 0.3125rem;
    color: #FF7400;
    font-weight: bold;
    white-space: nowrap;
}

.event-badge {
    background-color: #FF7400;
    color: #000;
    border-radius: 0.625rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    margin-left: 0.3125rem;
}

/* ============================================
   2. BACKGROUND IMAGE FIXES
   Fixed background that stays visible and stretched
   ============================================ */

html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #2a2a2a;
}

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

/* Ensure body background is always visible */
html {
    background-color: #2a2a2a;
}

/* ============================================
   3. TITLE WIDTH FIX
   Titles should match sidebar + content width
   ============================================ */

.page-title,
.site-header h1,
.main-title {
    width: 100%;
    max-width: 90rem;
    margin: 0 auto;
    padding: 0.625rem 1rem;
    box-sizing: border-box;
}

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

/* ============================================
   4. FOOTER STYLING
   Less transparent, rounded top corners
   ============================================ */

.site-footer {
    background: linear-gradient(135deg, #021B40 0%, #022554 100%) !important;
    border-top-left-radius: 0.625rem !important;
    border-top-right-radius: 0.625rem !important;
    border: 0.125rem solid #FF7400;
    border-bottom: none;
    opacity: 0.95 !important;
    box-shadow: 0 -0.25rem 0.625rem rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 90rem;
    margin: 1.25rem auto 0;
    padding: 1rem;
    color: #fff;
}

.site-footer a {
    color: #FF7400;
    text-decoration: none;
}

.site-footer a:hover {
    color: #FFA040;
    text-decoration: underline;
}

/* ============================================
   5. NEWS BORDER ON HOMEPAGE
   ============================================ */

.news-item,
.news-container,
.homepage-news {
    border: 0.125rem solid #FF7400;
    border-radius: 0.3125rem;
    padding: 0.9375rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #021B40 0%, #022554 100%);
}

.news-title {
    color: #fff;
    background: linear-gradient(90deg, #fff 0%, #FF7400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    margin-bottom: 0.625rem;
}

/* ============================================
   6. BUGS TEXT FIX IN RIGHT SIDEBAR
   ============================================ */

.sidebar .menu-div:first-child {
    margin-top: 0;
}

.site-content-right .menu-div:first-child {
    margin-top: 0;
}

/* Ensure Bugs section doesn't overflow */
.sidebar-items-right.text-align-center div {
    text-align: center;
    padding: 0.625rem;
    overflow: hidden;
}

/* ============================================
   7. RESPONSIVE GRID LAYOUT FIX
   Ensure proper layout on all screen sizes
   ============================================ */

.site-content {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) 1fr minmax(12rem, 15rem);
    grid-template-areas: "left main right";
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
    max-width: 90rem;
    min-height: calc(100vh - 20rem);
    align-items: start;
    padding: 0;
    box-sizing: border-box;
}

/* Left sidebar */
.site-content-left {
    grid-area: left;
    min-width: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

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

/* Right sidebar */
.site-content-right {
    grid-area: right;
    min-width: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

/* ============================================
   8. RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1200px) {
    .site-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "main"
            "left"
            "right";
        gap: 1rem;
    }
    
    .site-content-left,
    .site-content-right {
        position: relative;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .container,
    .site-content,
    .site-footer,
    .page-title {
        padding: 0 0.625rem;
    }
}

/* ============================================
   9. HOMEPAGE LOGIN SPACING FIX
   Remove unnecessary spacing below login
   ============================================ */

.login-container {
    margin-bottom: 0 !important;
}

.login-form {
    margin-bottom: 1rem;
}

.homepage-spacing-fix {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ============================================
   10. ENSURE ALL CONTAINERS USE SAME WIDTH
   ============================================ */

.site-header,
.site-content,
.site-footer,
.container {
    max-width: 90rem;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   11. SCROLLBAR STYLING FOR SIDEBARS
   ============================================ */

.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: rgba(0, 0, 0, 0.2);
}

.site-content-left::-webkit-scrollbar-thumb,
.site-content-right::-webkit-scrollbar-thumb {
    background: #FF7400;
    border-radius: 0.1875rem;
}

.site-content-left::-webkit-scrollbar-thumb:hover,
.site-content-right::-webkit-scrollbar-thumb:hover {
    background: #FFA040;
}

/* ============================================
   12. IMPRESSUM PAGE STYLING
   ============================================ */

.impressum-container {
    background: linear-gradient(135deg, #021B40 0%, #022554 100%);
    border: 0.125rem solid #FF7400;
    border-radius: 0.3125rem;
    padding: 1.5rem;
    margin: 1rem 0;
}

.impressum-container h1,
.impressum-container h2 {
    color: #fff;
    background: linear-gradient(90deg, #fff 0%, #FF7400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 0.125rem dashed #00FF00;
    padding-bottom: 0.625rem;
    margin-bottom: 1rem;
}

.impressum-container p {
    color: #fff;
    line-height: 1.6;
    margin-bottom: 0.9375rem;
}

/* ============================================
   13. ENSURE CONTENT VISIBILITY
   ============================================ */

.site-content-main > * {
    position: relative;
    z-index: 1;
}

/* Make sure content is visible over background */
.content-wrapper {
    background-color: rgba(2, 27, 64, 0.85);
    border-radius: 0.3125rem;
    padding: 1rem;
}

/* ============================================
   14. SIDEBAR POLISH
   ============================================ */

.sidebar {
    border: 1px solid #444;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.sidebar .menu-div {
    letter-spacing: 0.04em;
}

.sidebar .menu-div:not(:first-child) {
    margin-top: 0.4rem;
}

.sidebar-items-left div,
.sidebar-items-right div {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-items-left div:last-child,
.sidebar-items-right div:last-child {
    border-bottom: none;
}

.sidebar-items-left div:hover,
.sidebar-items-right div:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-items-left a,
.sidebar-items-right a {
    color: #BAB3B4;
}

.sidebar-items-left a:hover,
.sidebar-items-right a:hover {
    color: #ff9900;
    text-decoration: none;
}

.sidebar-items-left img,
.sidebar-items-right img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.sidebar-username {
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid #444;
    text-align: center;
}

.sidebar-num {
    color: #ff9900;
    font-weight: 700;
    min-width: 1.4rem;
    text-align: right;
}

.menu-div.menu-placeholder {
    background: transparent;
    border-bottom: none;
    padding: 0;
    min-height: 0.5rem;
}

/* ============================================
   15. DISCLAIMER LAYOUT
   ============================================ */

.disclaimer-card .kg-card-body {
    padding: 1.25rem;
}

.disclaimer-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.disclaimer-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.disclaimer-section h3 {
    color: #ff6600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.disclaimer-section p {
    color: #BAB3B4;
    margin-bottom: 0.5rem;
}

/* ============================================
   16. LEGACY HTML TAG NORMALIZATION
   ============================================ */

font,
center,
big,
tt,
strike,
s,
u,
marquee,
blink,
basefont,
dir {
    font-family: inherit;
    line-height: inherit;
}

center {
    display: block;
    text-align: center;
}

font[size="1"] { font-size: 0.75rem; }
font[size="2"] { font-size: 0.875rem; }
font[size="3"] { font-size: 1rem; }
font[size="4"] { font-size: 1.125rem; }
font[size="5"] { font-size: 1.25rem; }
font[size="6"] { font-size: 1.5rem; }
font[size="7"] { font-size: 1.75rem; }

tt {
    font-family: "Roboto Mono", "Courier New", monospace;
}

strike,
s {
    text-decoration: line-through;
}

u {
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}

[align="center"] { text-align: center; }
[align="right"] { text-align: right; }
[align="left"] { text-align: left; }
