/* --- AVARUUSTEEMA --- */
body {
    background-color: #0b0d17; /* Syvä tummansininen */
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif; /* Scifi-fontti otsikoihin */
    letter-spacing: 2px;
}

/* Päälaatikko */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1; /* Nostetaan sisällön tähtien päälle */
}

header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
}

/* --- TYÖKALUPALKKI --- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 10px;
}

input {
    flex: 1;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #444;
    background: #1a1d2e;
    color: white;
    font-size: 16px;
    min-width: 200px;
}

button {
    padding: 10px 20px;
    background: linear-gradient(45deg, #007bff, #00d4ff);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

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

/* --- KORTTIGRID --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* --- KORTIT (Glassmorphism) --- */
.space-card {
    background: rgba(255, 255, 255, 0.07); /* Läpinäkyvä */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(5px); /* Sumentaa taustan kortin takana */
}

.space-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.2);
    border-color: #00d4ff;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #00d4ff;
}

.badge {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: #333;
    color: #aaa;
    text-transform: uppercase;
}

/* Eri värit eri tyypeille */
.type-tähti { background: #ffaa00; color: #000; }
.type-planeetta { background: #007bff; color: #fff; }
.type-kuu { background: #666; color: #fff; }

.stats-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    font-size: 0.9rem;
    color: #ccc;
}

.stats-list li {
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 2px;
}

.fakta-box {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-left: 3px solid #00d4ff;
    font-style: italic;
    font-size: 0.85rem;
    color: #eee;
}

/* --- KIELIVALINTA --- */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.lang-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 1.5rem;
    padding: 5px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.1);
}

/* --- NASA HERO SECTION --- */
.hero-section {
    width: 100%;
    min-height: 400px;
    border-radius: 20px;
    margin-bottom: 40px;
    background-size: cover;
    background-position: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    
    /* Flexbox keskittää tekstin */
    display: flex;
    align-items: flex-end; /* Teksti alareunaan */
}

/* Tumma liukuväri kuvan päälle, jotta teksti näkyy */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    max-width: 800px;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin: 10px 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #ddd;
    max-width: 600px; /* Ei liian leveä teksti */
}

.nasa-date {
    font-style: italic;
    color: #aaa;
    margin-top: 10px;
}

/* Galleria-kuvat */
.gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

/* Mobiilissa siirretään kieli vähän alemmas ettei mene päällekkäin */
@media (max-width: 600px) {
    .language-selector {
        position: relative;
        justify-content: center;
        margin-bottom: 20px;
        right: auto;
        top: auto;
    }
}