
/* Global reset */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Content visibility and loading */
.content-hidden {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#mainContent:not(.content-hidden) {
    opacity: 1;
}

/* Page container layout */
#pageContainer {
    display: flex;
    flex-direction: row;
    margin-top: 150px;
    padding-bottom: 100px;
    min-height: calc(100vh - 250px);
    overflow-y: auto;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Header styling */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: black;
    z-index: 10;
}

header h1 {
    position: absolute;
    top: 10px;
    left: 30px;
    color: white;
    padding: 20px;
    font-size: 30px;
    font-family: Arial;
}

header img {
    float: right;
    height: 100px;
}

/* Main heading */
#mainHeading {
    position: fixed;
    top: 100px;
    left: 0;
    width: 100%;
    background-color: #030346;
    color: white;
    font-family: arial;
    text-align: center;
    z-index: 10;
}

#mainHeading h1 {
    padding: 10px;
}

/* Footer styling */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: black;
    height: 100px;
    display: flex;
    flex-wrap: nowrap;
    z-index: 10;
}

footer > div {
    width: 33%;
    font-size: 12px;
    font-family: arial;
    padding-top: 20px;
    color: white;
}

#left p {
    text-align: left;
    padding-left: 30px;
    margin-bottom: 8px;
}

#center {
    text-align: center;
    margin-bottom: 10px;
}

#right {
    text-align: right;
    padding-right: 30px;
    margin-bottom: 10px;
}

/* Mobile Landscape Styles - Reduce header/footer for better content visibility */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        height: 50px;
    }

    header h1 {
        font-size: 16px;
        padding: 8px;
        top: 5px;
        left: 10px;
    }

    header img {
        height: 50px;
    }

    #mainHeading {
        top: 50px;
        font-size: 12px;
    }

    #mainHeading h1 {
        padding: 5px;
        font-size: 16px;
    }

    #pageContainer {
        margin-top: 80px;
        padding-bottom: 50px;
        min-height: calc(100vh - 130px);
    }

    footer {
        height: 50px;
    }

    footer > div {
        font-size: 8px;
        padding-top: 10px;
    }

    #left p {
        padding-left: 10px;
        margin-bottom: 2px;
    }

    #right {
        padding-right: 10px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    #pageContainer {
        flex-direction: column;
        margin-top: 140px;
        margin-bottom: 100px;
        padding: 5px;
    }

    #content {
        width: 100%;
        margin-left: 0;
        padding: 5px;
    }

    .contentContainer {
        padding: 8px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Mobile table optimizations */
    table {
        max-width: 100%;
        font-size: 10px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    table th,
    table td {
        font-size: 12px;
        padding: 4px 3px;
        white-space: normal !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto;
    }

    table td p,
    table th p,
    table td div,
    table td span,
    table td ul,
    table td ol,
    table td li {
        font-size: 12px !important;
        line-height: 1.4 !important;
        margin: 3px 0 !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        max-width: 100% !important;
    }

    table .codeText,
    table .codeBox {
        font-size: 10px !important;
        word-break: break-all;
        overflow-x: auto;
    }

    /* Mobile image handling */
    img {
        max-width: 100%;
        height: auto;
    }

    .contentContainer div[style*="display:flex"] {
        flex-direction: column !important;
    }

    .contentContainer div[style*="display:flex"] img {
        max-width: 100% !important;
        width: auto !important;
        margin: 5px auto !important;
    }

    .codeBox {
        max-width: 100%;
        overflow-x: auto;
        font-size: 10px;
        padding: 10px;
    }

    .trinket {
        width: 100%;
        max-width: 100%;
        height: 300px;
    }

    /* Mobile footer adjustments */
    footer > div {
        font-size: 10px;
    }

    #left p {
        padding-left: 10px;
    }

    #right {
        padding-right: 10px;
    }
}
