html {
    background-color: rgb(25, 25, 25);
    z-index: -2;
    /* border: 2px solid rgb(92, 29, 29); */
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Bahnschrift', 'Segoe UI', 'Roboto', 'sans-serif';
    /* border: 2px solid rgb(92, 29, 29); */
}

/* Prevent scrolling when popup is open */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
    -webkit-overflow-scrolling: none;
}

.page {
    width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex; 
    flex-direction: column;
    background-color: rgb(21, 19, 20);
    color: #ffffff;
    /* border: 2px dashed red; */
}

/* Animation canvas */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    /* border: 2px dashed red; */
}

/* Animated element */
.animated-line {
    position: absolute;
    background-color: rgb(191, 43, 23);
    transition: transform 8s linear, opacity 3s linear;
    pointer-events: none;
    opacity: 0;
}

/********************************* start - header *********************************/

header {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 300px;
    background-color: #000000;
    background-Size: cover;
    background-Position: center;
    /* border: 2px dashed red; */
}

.header-3d-live-status {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 10px;
    left: 5px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-3d-live-status:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.header-3d-live-status:active {
    transform: scale(0.98);
}

.header-3d-live-status .status-text {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.header-3d-live-status .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #888;
    box-shadow: 0 0 8px rgba(136, 136, 136, 0.5);
}

.header-3d-live-status .status-indicator.online {
    background-color: #4CAF50;
    animation: pulse-green 2s ease-in-out infinite;
}

.header-3d-live-status .status-indicator.offline {
    background-color: #f44336;
    box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.8);
    }
    50% {
        opacity: 0.4;
        box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
    }
}

.site-language {
    display: flex;
    text-align: end;
    font-weight: 100;
    align-self: flex-end;
    font-stretch: semi-condensed;
    padding-top: 10px;
    padding-right: 10px;
    font-size: 20px;
}

.site-language-dropdown-menu {
    display: none;
    flex-direction: column;
    align-items: end;
    align-self: flex-end;
    padding-top: 10px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 5px;
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 0 10px;
}

.site-language-dropdown-item {
    cursor: pointer;
    font-stretch: semi-condensed;
    font-size: 25px;
}

.site-language-dropdown-item:hover {
    cursor: pointer;
    font-weight: bold;
    text-decoration: underline;
}

/* Language Popup Modal Styles */
.language-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-in-out;
}

.language-popup-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.language-popup-modal {
    background: linear-gradient(145deg, rgb(35, 35, 40), rgb(20, 20, 25));
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.language-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: linear-gradient(90deg, rgba(191, 43, 23, 0.15), rgba(241, 72, 39, 0.15));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.language-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.language-popup-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.language-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: scale(1.1);
}

.language-popup-close:active {
    transform: scale(0.95);
}

.language-popup-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    background: linear-gradient(145deg, rgba(40, 40, 45, 0.8), rgba(30, 30, 35, 0.8));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    text-align: left;
}

.language-option:hover {
    background: linear-gradient(145deg, rgba(50, 50, 55, 0.9), rgba(40, 40, 45, 0.9));
    border-color: rgba(191, 43, 23, 0.5);
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(191, 43, 23, 0.3);
}

.language-option:active {
    transform: translateX(8px) scale(0.98);
}

.language-option-flag {
    font-size: 48px;
    line-height: 1;
}

.language-option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.language-option-name {
    font-size: 22px;
    font-weight: 500;
    color: #ffffff;
}

.language-option-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.header-contact-info {
    padding-left: 35px;
    padding-bottom: 90px;
    font-size: 20px;
    color: rgb(218, 218, 218);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.header-contact-info a {
    color: rgb(200, 200, 200);
    text-decoration: none;
    transition: color 0.2s;
}

.header-contact-info a:hover {
    color: rgb(255, 255, 255);
    text-decoration: underline;
}

.header-nav-bar {
    display: flex;
    flex-wrap: wrap;
    position: absolute;
    align-items: flex-start;
    justify-content: center;
    top: 226px;
    width: 1100px;
    gap: 5px 0;
    margin: 0 auto;
    padding: 5px 50px 5px 50px;
    background-color: rgba(128, 128, 128, 0.2);
    /* border: 2px dashed red; */
}

.header-nav-bar-link {
    color: #ffffff;
    text-decoration: none;
}

.header-nav-bar-link.active .header-nav-bar-button {
    text-decoration: underline;
    font-weight: bold;
    color: rgba(241, 72, 39, 0.5);
}

.header-nav-bar-button {
    font-size: 30px;
    font-weight: 400;
    margin-left: 20px;
    margin-right: 20px;
    text-shadow: 5px 3px 10px rgba(0, 0, 0, 1);
}

.header-nav-bar-button:hover {
    color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.site-language:hover {
    color: rgba(255, 255, 255, 0.6);
}

.sub-nav-bar {
    z-index: 1;
    display: "none";
    align-items: center;
    justify-content: center;
    width: 1100px;
    height: 46px;
    gap: 5px 0;
    margin: 0 auto;
    padding: 5px 50px 5px 50px;
    background-color: rgb(0, 0, 0);
    /* border: 2px dashed red; */
}

.sub-nav-bar-separator {
    font-size: 40px;
    margin: 0 10px;
    color: #999;
    font-weight: bold;
}

.sub-nav-bar-link {
    color: #ffffff;
    text-decoration: none;
}

.sub-nav-bar-link.active .sub-nav-bar-button {
    text-decoration: underline;
    font-weight: bold;
    color: rgba(241, 73, 39, 0.589);
}

.sub-nav-bar-button {
    font-size: 35px;
    margin-left: 10px;
    margin-right: 10px;
    text-shadow: 5px 3px 10px rgba(0, 0, 0, 1);
}

.sub-nav-bar-button:hover {
    color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.header-expansion {
    z-index: 1;
    display: none;
    height: 30px;
    background-color: rgb(0, 0, 0);
    /* border: 2px dashed red; */
}

/********************************* start - main *********************************/

.main {
    display: flex;
    flex-direction: column;
    flex: 1;    /* Venyttää pääsisällön täyttämään ylimääräisen tilan */
}

.main-header {
    display: flex;
    padding-right: 40px;
    padding-left: 55px;
    font-size: 50px;
    margin-bottom: auto;
}

.main-header-bottom-pad {
    padding-bottom: 20px;
}

.main-text {
    display: flex;
    padding-right: 60px;
    padding-left: 60px;
    font-size: 22px;
    color: rgb(218, 218, 218);
}

.slide-down {
    transform: translateY(-25%);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.slide-down.show {
    transform: translateY(0);
    opacity: 1;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.fade-out.hide {
    opacity: 1;
}

.main-bottom-pad {
    padding-bottom: 40px;
}

/********************************* start - footer *********************************/

footer {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    background-color: rgb(13, 13, 13);
}

.footer-links-bar {
    font-weight:200;
    font-stretch: semi-condensed;
    color: rgba(255, 255, 255);
    font-size: 22px;
}

.footer-link-a {
    text-decoration: none;
    color: rgba(255, 255, 255);
}

.footer-link-a:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
}

.footer-copyright {
    font-weight:200;
    font-stretch: semi-condensed;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
}

/********************************* MOBILE RESPONSIVE STYLES *********************************/

/* Tablet devices (portrait) */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .page {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    header {
        height: auto;
        min-height: 150px;
        padding-bottom: 20px;
        background-size: 100% auto;
        background-position: center top;
        background-repeat: no-repeat;
        background-color: #000000;
        justify-content: space-between;
        box-sizing: border-box;
        position: relative;
    }

    .site-language {
        font-size: 16px;
        padding-top: 8px;
        padding-right: 8px;
    }

    .site-language-dropdown-item {
        font-size: 20px;
    }

    .header-3d-live-status {
        position: absolute;
        left: auto;
        right: 2px;
        top: 110px;
    }

    .header-3d-live-status .status-text {
        font-size: 14px;
    }

    .header-contact-info {
        padding-left: 20px;
        padding-bottom: 10px;
        padding-top: 70px;
        padding-right: 130px;
        font-size: 16px;
        margin-top: auto;
    }

    .header-nav-bar {
        position: relative;
        top: auto;
        width: 100%;
        max-width: 100%;
        padding: 10px 10px;
        justify-content: center;
        box-sizing: border-box;
    }

    .header-nav-bar-button {
        font-size: 22px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .sub-nav-bar {
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 10px 10px;
        flex-wrap: wrap;
        box-sizing: border-box;
    }

    .sub-nav-bar-button {
        font-size: 24px;
        margin-left: 8px;
        margin-right: 8px;
    }

    .sub-nav-bar-separator {
        font-size: 30px;
        margin: 0 5px;
    }

    .main-header {
        padding-right: 20px;
        padding-left: 20px;
        font-size: 36px;
        box-sizing: border-box;
    }

    .main {
        width: 100%;
        box-sizing: border-box;
    }

    .main-text {
        padding-right: 20px;
        padding-left: 20px;
        font-size: 18px;
        box-sizing: border-box;
    }

    footer {
        height: auto;
        min-height: 50px;
        flex-wrap: wrap;
        padding: 10px;
        gap: 10px;
        box-sizing: border-box;
    }

    .footer-links-bar {
        font-size: 16px;
        text-align: center;
        flex-wrap: wrap;
    }

    .footer-copyright {
        font-size: 14px;
    }

    .background-animation {
        display: none !important;
    }

    .header-expansion {
        display: none !important;
    }

    /* Language Popup - Tablet Responsive */
    .language-popup-modal {
        width: 95%;
        max-width: 450px;
    }

    .language-popup-header {
        padding: 14px 24px;
    }

    .language-popup-title {
        font-size: 22px;
    }

    .language-popup-content {
        padding: 24px;
    }

    .language-option {
        padding: 12px 20px;
        gap: 16px;
    }

    .language-option-flag {
        font-size: 42px;
    }

    .language-option-name {
        font-size: 20px;
    }

    .language-option-description {
        font-size: 15px;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    html, body {
        overflow-x: hidden;
    }

    .page {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    header {
        min-height: 120px;
        background-size: 100% auto;
        background-position: center top;
        background-repeat: no-repeat;
        background-color: #000000;
        justify-content: flex-start;
        box-sizing: border-box;
        position: relative;
    }

    .site-language {
        font-size: 14px;
        padding-top: 6px;
        padding-right: 6px;
    }

    .site-language-dropdown-item {
        font-size: 18px;
    }

    .header-3d-live-status {
        position: absolute;
        top: 70px;
        left: auto;
        right: 2px;
        padding: 6px 10px;
    }

    .header-3d-live-status .status-text {
        font-size: 12px;
    }

    .header-3d-live-status .status-indicator {
        width: 8px;
        height: 8px;
    }

    .header-contact-info {
        padding-left: 15px;
        padding-bottom: 10px;
        padding-top: 35px;
        padding-right: 110px;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: auto;
    }

    .header-nav-bar {
        padding: 8px 5px;
        gap: 5px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .header-nav-bar-button {
        font-size: 18px;
        margin-left: 6px;
        margin-right: 6px;
    }

    .sub-nav-bar {
        padding: 8px 5px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .sub-nav-bar-button {
        font-size: 20px;
        margin-left: 5px;
        margin-right: 5px;
    }

    .sub-nav-bar-separator {
        font-size: 24px;
        margin: 0 3px;
    }

    .main-header {
        padding-right: 15px;
        padding-left: 15px;
        font-size: 28px;
        box-sizing: border-box;
    }

    .main {
        width: 100%;
        box-sizing: border-box;
    }

    .main-text {
        padding-right: 15px;
        padding-left: 15px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .footer-links-bar {
        font-size: 14px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .footer-copyright {
        font-size: 12px;
    }

    .background-animation {
        display: none !important;
    }

    .header-expansion {
        display: none !important;
    }

    /* Language Popup - Mobile Responsive */
    .language-popup-modal {
        width: 96%;
        max-width: 400px;
        margin: 0 10px;
    }

    .language-popup-header {
        padding: 12px 20px;
    }

    .language-popup-title {
        font-size: 18px;
    }

    .language-popup-close svg {
        width: 20px;
        height: 20px;
    }

    .language-popup-content {
        padding: 20px;
        gap: 12px;
    }

    .language-option {
        padding: 10px 18px;
        gap: 14px;
    }

    .language-option:hover {
        transform: translateX(4px);
    }

    .language-option-flag {
        font-size: 36px;
    }

    .language-option-name {
        font-size: 18px;
    }

    .language-option-description {
        font-size: 14px;
    }
}