body {
    background-color: rgb(14, 7, 85);
    font-family: Arial, sans-serif;
    color: #d1ab2e;
    margin: 0;
}

header,
section,
footer {
    text-align: center;
    padding: 10px;
    position: relative;
    z-index: 1;
    color: lightgray;
    box-sizing: border-box;
}

section {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    flex-wrap: wrap;
}

#responseContainer {
    border: 2px solid lightblue;
    color: white;
    opacity: 0.7;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    display: none;
    min-width: 70%;
    text-align: left;
    margin: 30px;
    font-size: 16px;
}

#responseContainer strong, #responseContainer h2, #responseContainer h3, #responseContainer h4 {
    color: #d4af37;
}

#tarot-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#tarot-section textarea {
    min-width: 30%;
    max-width: 70%;
    height: 100px;
    font-size: 14px;
    border-radius: 10px;
    padding: 10px;
}

#start-button {
    padding: 15px 30px;
    font-size: 20px;
    margin-top: 50px;
    background-color: transparent;
    color: rgb(231, 231, 236);
    border: 1px solid white;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 1s ease-in-out, box-shadow 0.5s ease-in-out; /* Dodajemo transition za box-shadow */
}

#start-button:hover {
    color: #d4af37;
    transform: scale(1.3);
    box-shadow: 0 0 15px #d4af37, 0 0 30px #d4af37, 0 0 45px #d4af37; /* Efekat sjaja */
}

#lightning-container {
    width: 100%;
    height: 0;
    position: relative;
}

#display-question {
    color: #d4af37;
    font-size: 16px;
    padding: 10px;
}

#lightning {
    position: fixed;
    width: 100vw;
    height: 100vw;
    background: url('./images/lightining.png') no-repeat center;
    background-size: cover;
    left: 0;
    top: 0;
    transform: none;
    display: none;
    z-index: 2; /* Osigurava da grom bude iznad drugih elemenata */
    pointer-events: none; /* Sprečava interakciju sa gromom */
    opacity: 0.8; /* Dodajemo malo providnosti radi lakšeg uočavanja */
}

#card-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    padding: 20px 20px 20px 0;
    margin-top: 20px;
    flex-wrap: nowrap;
    opacity: 0;
    transition: opacity 1s ease; /* Glatki prelaz pri pojavljivanju */
}

.card {
    width: 155px;
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
    margin: 30px;
    position: relative;
    flex-shrink: 0;
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95);
}

#card2 {
    transform: translateY(-40px); /* Srednja karta je blago podignuta */
}

@keyframes thunderboltRevealForCard1 {
    0% {
        transform: scale(0.1) rotate(-20deg);
        opacity: 0;
        filter: blur(8px);
    }
    50% {
        opacity: 0.5;
        filter: blur(2px);
        transform: scale(0.4) rotate(-15deg);
    }
    100% {
        transform: scale(1) rotate(-10deg);
        filter: blur(0);
        opacity: 1;
    }
}

/* Zamenjujemo thunderboltReveal samo za #card2 */
@keyframes thunderboltRevealForCard2 {
    0% {
        transform: translateY(-40px) scale(0.3) rotate(-10deg);
        opacity: 0;
        filter: blur(10px);
    }
    50% {
        opacity: 0.5;
        filter: blur(0);
        transform: translateY(-40px) scale(1.05) rotate(-5deg);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(-40px) scale(1) rotate(0);
    }
}

@keyframes thunderboltRevealForCard3 {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
        filter: blur(8px);
    }
    50% {
        opacity: 0.5;
        filter: blur(2px);
        transform: scale(0.7) rotate(0);
    }
    100% {
        transform: scale(1) rotate(10deg);
        filter: blur(0);
        opacity: 1;
    }
}

#card1.thunderbolt-reveal {
    animation: thunderboltRevealForCard1 2s ease-out forwards;
}

#card2.thunderbolt-reveal {
    animation: thunderboltRevealForCard2 4s ease-out forwards;
}

#card3.thunderbolt-reveal {
    animation: thunderboltRevealForCard3 5s ease-out forwards;
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    border: solid 15px white;
    position: absolute;
    backface-visibility: hidden;
    transition: transform 0.6s ease;
}

.card-front {
    background: url('./images/tarot-background.jpg') no-repeat center center;
    background-size: cover;
}

.card-back {
    background-size: cover;
    transform: rotateY(180deg);
}

.card-back:hover {
    box-shadow: 0 0 15px lightblue, 0 0 30px lightblue, 0 0 45px blue; /* Efekat sjaja */
}

.card.active:hover {
    cursor: hand;/* TODO */
}

.card.flipped {
    cursor: default; /* Promena kursora da ne bude klikabilan */
}

.card.flipped .card-front {
    transform: rotateY(180deg);
}

.card.flipped .card-back {
    transform: rotateY(0deg);
}

#responseContainer {
    border: 2px solid lightblue;
    color: white;
    opacity: 0.7;
    border-radius: 10px;
    padding: 10px;
    margin-top: 20px;
    display: none;
    min-width: 70%;
    text-align: left;
    font-size: 16px;
}

#responseCards {
    color: #d4af37;
    opacity: 0.7;
    border-radius: 10px;
    border: 10px solid #d4af37;
    padding: 5px;
    margin: 5px auto;
    display: none;
    min-width: 70%;
    text-align: center;
    font-size: 18px;
}

#tarot-description {
    color: #d4af37;
    padding: 0 10px;
    margin: 0 auto;
    max-width: 50%;
    text-align: center;
    font-size: 18px;
}

#responseCards p {
    padding: 5px;
    margin: 0px auto;
}

/* Style the smoke effect canvas */
#smoke-canvas {
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Ensure it's behind other elements */
    pointer-events: none; /* Allow clicks to pass through */
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

#lightning.active {
    display: block;
    animation: flash 0.2s ease-in-out infinite;
}

#responseContainer {
    border: 2px solid lightblue;
    color: white;
    opacity: 0.7;
    border-radius: 10px;
    padding: 10px;
    margin: 20px 10px;
    display: none;
    min-width: 70%;
    text-align: left;
    font-size: 16px;
}

@media only screen and (max-width: 767px) {
    .name {
        font-size: 25px;
    }

    header {
        font-size: 14px;
    }

    .description,
    footer p {
        font-size: 14px;
    }

    section {
        flex-direction: column;
        align-items: center;
    }

    #card-container {
        align-items: center;
        gap: 5px;
    }

    .card-front {
        border-radius: 15px;
        border: solid 1px #d4af37;
    }

    #tarot-section textarea {
        min-width: 70%;
        max-width: 80%;
        height: 100px;
        font-size: 14px;
        border-radius: 10px;
        padding: 10px;
    }

    .card-back {
        border-radius: 15px;
        border: solid 15px white;
    }

    .card {
        width: 110px;
        height: 193px;
        margin: 15px;
    }

    #card2 {
        transform: translateY(-20px); /* Srednja karta je i dalje blago podignuta */
    }

    #responseContainer {
        font-size: 18px;
        max-width: 90%;
    }

    #tarot-description {
        max-width: 80%;
        font-size: 16px;
    }
}
