/* Muuttujat väreille */
:root {
    --navy-dark: #191833;
    --lime-accent: #a2ff4d;
    --text-light: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
}

/* Lomakekenttien vihjaisutekstin väri */
::placeholder {
    color: #ffffffbe;
}
/* Varmistetaan että sivu täyttää aina vähintään koko näytön korkeuden */
html, body {
    height: 100%;
    margin: 0;
}

/* Perusasetus scrollaamiselle */
html {
    scroll-behavior: smooth;
}

/* Korostettu tekstitausta otsikoissa */
.tausta {
    background-color: #0c3f83;
    padding: 0 8px;
    border-radius: 15px;
}

/* Taustakuva, värit ja fontit */
body {
    background-color: var(--navy-dark);
    background-image: url('background.png'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-light);
    font-family: 'Segoe UI', Roboto, sans-serif;
    margin: 0;
}

/* Sivun glass-efekti (sumennus ja reunat)*/
.page-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background-color: var(--glass-bg); 
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Pakottaa sisällön venymään pohjaan asti */
}

/* Navigointipalkin tausta */
.navbar {
    background-color: rgba(25, 24, 51, 0.9) !important;
    padding: 19px 32px;
    border-bottom: 1px solid rgba(162, 255, 77, 0.2);
}

/* Linkkien sijoittelu kauemmas logosta */
.navbar-nav {
    padding-left: 196px; 
}

/* Logon koon rajoitus */
.navbar-brand img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Linkkien perustyyli */
.nav-link { 
    color: rgba(255,255,255,0.9) !important; 
    transition: 0.3s; 
    font-weight: 500;
    font-size: larger;
}

/* Linkin väri kun linkin päällä ollaan tai sivu on aktiivinen */
.nav-link:hover, .nav-link.active { color: var(--lime-accent) !important; }

/* Hakupalkin sijainti ja koko */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
    width: 140px;
}

/* Lomakekenttien yhteiset värit ja koot */
input, textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px;
    border-radius: 6px;
    color: white;
}

/* Hero-osio */
.hero-section {
    padding: 120px 20px;
    text-align: center;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

/* Tila footerin ja heron välillä */
main {
    flex: 1; 
    padding-bottom: 40px;
}

/* Yhteydenottolomaakkeen taustalaatikko */
.form-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px;
    margin: 40px 40px 0 40px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Grid-asettelu: kaksi saraketta vierekkäin */
.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Otsikot kenttien yläpuolella: pieni, lihavoitu ja limen väri */
label {
    display: block;
    margin-bottom: 5px;
    color: var(--lime-accent);
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Viestikenttien minikorkeus */
textarea { min-height: 186px; 
}

/* SubmitButtonin tyyli */
button {
    background-color: var(--lime-accent);
    color: var(--navy-dark);
    border: none;
    padding: 12px 40px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

/* Väri muuttuu siniseksi vihreästä ja painike suurenee hieman hiiren ollessa päällä */
button:hover {
    background: #1b67cb;
    color: #000; 
    transition: 0.5s;
}

button:hover { transform: scale(1.05); 
}

/* Button vie koko rivin leveyden gridissä ja keskitys */
.button-wrapper {
    grid-column: span 2;
    display: flex;
    justify-content: center; /* Centers the button horizontally */
    margin-top: 15px;
}

/* Yhteystietolaatikot rinnakkain (automaattisesti rivittyvä grid) */
.contact-info-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    background: rgba(0, 0, 0, 0.3);
    padding: 30px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item { text-align: center; padding: 10px; }
.info-item h3 { font-size: 0.9rem; color: var(--lime-accent); margin-bottom: 5px; }
.info-item p { margin: 0; font-size: 0.85rem; opacity: 0.8; }

/* Alatunniste tummalla taustalla */
.mega-footer {
    background-color: rgba(15, 14, 30, 0.95);
    padding: 80px 60px 40px;
}

.footer-title { color: white; font-weight: bold; margin-bottom: 25px; }
.footer-link { color: #ffffffbe; text-decoration: none; display: block; margin-bottom: 1px; }
.footer-link:hover { color: var(--lime-accent); }

.footer-bottom {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* Mobiili-responsiivisuus: Säädöt kapeammille näytöille */
@media (max-width: 768px) {
    .contact-form { grid-template-columns: 1fr; } /* Lomake yhdelle sarakkeelle */
    .button-wrapper { grid-column: span 1; }
    .form-card { margin: 10px; }
    .navbar-nav { padding-left: 0; text-align: center; } /* Navigointipalkin keskitys */
}

/* Pakotetut värit lomakekentille (Boostrap-yliajo) */
input.form-control, textarea.form-control, .form-control:focus {
    color: #ffffffbe !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #ffffffbe !important; /* Pakottaa värin joissain selaimissa */
}


/*---------YHTEYDENOTONPOPUP-----------*/

/* Poistetaan selaimen oletusreunukset ja taustavärit */
#statusDialog {
    border: none !important;
    outline: none !important;
    background: none !important;
    padding: 0;
    
    /* Pakotetaan dialogi/popup keskelle */
    margin: auto !important; 
    overflow: visible;
    max-width: none;
    max-height: none;
    width: 100vw;
    height: 100vh;
}

/* Taustan tummennus ja taustan sumennus */
#statusDialog::backdrop {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Läpinäkyvä tausta (glass) */
.custom-dialog1 {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px;
    color: white;
    padding: 40px;
    
    /* Kiinteä asettelu keskelle ruutua */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Kokoasetukset */
    width: 90%;
    max-width: 450px;
    min-width: 300px;
    box-sizing: border-box; /* Varmistaa että padding ei levitä POPUPPIA */
    
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Sisällön asettelu ja keskitys flexboxilla */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 4. Otsikko ja viesti */
#statusTitle {
    font-weight: bold;
    font-size: 1.8rem;
    margin: 0 0 15px 0;
}

#statusMessage {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0 0 25px 0;
    color: rgba(255, 255, 255, 0.9);
}

.dialog-divider {
    width: 100%;
    border: none;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.btn-action {
    background-color: #a2ff4d;
    color: #191833;
    font-weight: bold;
    border-radius: 50px;
    padding: 12px 30px;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action:focus, 
.btn-action:active {
    border: none !important;
    outline: none !important;
}

.btn-action:hover {
    background-color: #1b67cb; /* Hiirenpäällä ollessa muutetaan väri */
    color: rgb(0, 0, 0);
    transform: scale(1.05); /* Hiiren päällä ollessa suurennetaan buttonia hieman */
}

#statusDialog[open] .custom-dialog1 {
    animation: dialogFadeIn 0.4s ease-out forwards;
}

@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}