/* ===========================================
   LAYOUT STYLES
   Grid System, Columns, Responsive Design
   =========================================== */

header,
footer {
    max-width: 1920px;
    margin: 8px auto;
    padding: 0 16px;
}

main {
    max-width: 1920px;
    margin: 10px auto;
    display: grid;
    grid-template-columns: 350px 1fr 350px;
    gap: 10px;
    padding: 0 16px;
    flex: 1;
    align-items: center;
    min-height: calc(100vh - 20px);
}

/* Responsive behavior */
@media (max-width: 1360px) {
    main {
        grid-template-columns: 310px 1fr 310px;
    }
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .left,
    .center,
    .right {
        width: 100%;
        min-height: auto;
        max-height: none;
        height: auto;
    }
}

/* Column styling */
.left,
.center,
.right {
    background: var(--panel);
    border-radius: 15px;
    padding: 20px;
    min-height: 900px;
    max-height: 1120px;
    height: clamp(900px, calc(100vh - 40px), 1120px);
}

/* Center column should vertically center the canvas */
.center {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Make the right column a container for fixed positioning */
.right {
    position: relative;
    padding-bottom: 105px;
    /* space for the fixed download button (button height 60px + 25px margin + 20px buffer) */
}

/* Make the left column a container for fixed positioning */
.left {
    position: relative;
    padding-bottom: 80px;
    /* space for the fixed footer menu */
}

/* Canvas styling */
#glcanvas {
    max-width: 100%;
    height: auto;
    max-height: calc(min(100vh - 90px, 1070px));
    min-height: 860px;
    display: block;
    cursor: zoom-in;
    margin: 0 auto;
    object-fit: contain;
    /* center horizontally */
}

.canvas-wrap {
    width: 100%;
    background: #ffffff;
    border: none;
    cursor: zoom-in;
}

/* Demo navigation */
.demo-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'DM Mono', monospace;
    width: 75%;
    z-index: 11;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-author {
    font-size: 14px;
    color: white;
}

.demo-pagination {
    display: flex;
    align-items: center;
    gap: 15px;
}

.demo-counter {
    font-size: 14px;
    color: white;
    min-width: 40px;
    text-align: center;
}

.demo-arrow {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-arrow img {
    width: 12px;
    height: 12px;
    filter: invert(1);
}

.demo-arrow-left {
    transform: rotate(180deg);
}

.demo-arrow:hover img {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(15deg);
}

/* Footer menu in left column - fixed at bottom */
.footer-menu {
    position: absolute;
    bottom: 25px;
    left: 25px;
    right: 25px;
    margin: 0;
}

.footer-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.footer-menu li {
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.footer-menu a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-menu a:hover {
    color: #e6623c;
}

/* Download row in right column - fixed at bottom */
.download-row {
    position: absolute;
    bottom: 25px;
    left: 20px;
    right: 20px;
    margin: 0;
}

.download-row #downloadBtn {
    height: 60px;
    border-radius: 5px;
    width: 100%;
}

/* Logo styling */
.logo-icon {
    width: 130px;
    height: auto;
    vertical-align: -7px;
    margin-bottom: 5px;
}