/* Üldised sätted */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #e0f7fa;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Päis */
.header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 42px;
    margin: 0;
}

/* Logo */
.logo {
    width: 180px; /* Logo suurus */
    height: auto;
    margin-top: 10px;
}

/* Konteiner */
.container {
    display: flex;
    gap: 20px;
    width: calc(100% - 40px);
    max-width: 1200px;
    justify-content: center;
    position: relative;
    height: auto;
}

/* Tase */
.level {
    flex: 1;
    background-color: #42a5f5;
    color: white;
    border-radius: 20px;
    padding: 40px;
    position: relative;
    height: 300px;
    transition: all 0.5s ease-in-out;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    z-index: 1;
}

/* Hover-efekt ainult arvutivaates */
@media (hover: hover) and (pointer: fine) {
    .level:hover {
        flex: 2;
        transform: scale(1.08);
        box-shadow: 0 12px 18px rgba(0, 0, 0, 0.2);
        z-index: 10;
    }

    .level:hover .center-content {
        top: 0%; /* h2 liigub kõrgemale hoveril */
        left: 50%; /* Keskel horisontaalselt */
        transform: translateX(-50%);
    }

    .level:hover .content {
        opacity: 1;
        visibility: visible;
        padding: 20px;
        border-radius: 20px;
    }
}

/* Pealkiri keskjoondusega */
.center-content {
    position: absolute;
    top: 50%; /* Vertikaalselt keskel */
    left: 50%; /* Horisontaalselt keskel */
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 28px; /* Suurem pealkiri arvutivaates */
    transition: top 0.5s ease-in-out, transform 0.5s ease-in-out, font-size 0.5s ease-in-out;
}

/* Content - alguses peidetud */
.level .content {
    opacity: 0;
    visibility: hidden;
    text-align: left;
    padding: 20px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    border-radius: 10px;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out, padding 0.5s ease-in-out;
}

/* Nuppude stiil */
.btn {
    display: inline-block;
    background-color: #ffffff;
    color: #007bff;
    text-decoration: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: #007bff;
    color: #ffffff;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

/* Telefonivaate reeglid */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Kastid vertikaalselt */
        height: calc(100% + 150px); /* Lisame konteinerile kõrgust */
    }

    .level {
        height: 350px; /* Suurem kast kõrgus */
        transition: all 0.5s ease-in-out;
    }

    .level.active {
        flex: 2;
        transform: scale(1.08);
        box-shadow: 0 12px 18px rgba(0, 0, 0, 0.2);
    }

    .level.active .center-content {
        top: 0%; /* h2 liigub kõrgemale aktiivses kastis */
        left: 50%; /* Horisontaalselt keskel */
        transform: translateX(-50%);
    }

    .center-content {
        font-size: 24px; /* Väiksem pealkiri ainult telefoni vaates */
        width: 300px; /* Fikseeritud laius */
        word-wrap: break-word; /* Murdub vajadusel */
    }

    .level.active .content {
        opacity: 1;
        visibility: visible;
        padding: 20px;
        border-radius: 20px;
    }
}
