@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Light Theme */
    --bg: #EFE6CA; 
    --bg-top: #F7F2DC; 
    --bg-bottom: #F7F3E1;

    --border: rgb(166, 121, 43);
    --node-bg: rgba(166, 121, 43, 0.25);

    --accent: #c40094;
    --accent-darker: #760059;
    --darkbg: #0a0710;

    --correct-color: #00c94a;
    --incorrect-color: #c70053;

    --logo-drop-shadow: #09001d;

    @media (prefers-color-scheme: dark) {
        --bg: #393633;
        --bg-top: #353126;
        --bg-bottom: #534D44;

        --border: #7b6f48;
        --node-bg: rgba(123, 111, 72, 0.25);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    color: #fff;
    background: var(--darkbg); /* when pop up is active and main bg is blurred, show black blurred edges instead of white */
    overflow: hidden; /* For at least using 200% in the container? */
}

/* HIDE/SHOW --------------------------------------
* This did not work with how the tutorial did it by having the hidden
* being the default and active being added. So will have hidden there by default
* and then remove it and add active instead
*/
.hidden {
    /* Hide the pop-up until we are ready to see it */
    opacity: 0; 
    pointer-events: none; /* When hidden, need to make sure the pointer doesn't change or work on the hidden buttons */    
}
.active {
    /* When visible, make it visible and restore pointer events */
    opacity: 1; 
    pointer-events: auto;
}

/* HEADER --------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 10%;
    background: transparent;
    display: flex;
    justify-content: space-between; /* Put them (logo and nav button grp) in opposite corners */
    align-items: center;
    z-index: 100;
}

/* Quiz "Logo" - made from text */
.logo {
    font-size: 32px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    filter: drop-shadow(0 0 5px var(--logo-drop-shadow));
}

.navbar a {
    font-size: 18px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    margin-left: 35px;
    transition: 0.3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--accent);
}

/* MAIN -------------------------------------- */
.main {
    min-height: 100vh;
    
    /* background: url('someimage.jpg') no-repeat; */
    /* background-size: cover;  */
    /* background-position: center; */

    background-color: var(--accent-darker);

    pointer-events: auto; /* reg pointer events */    
    transition: 0.3s ease; /* To the blur active class for main */
}

.main.active {
    filter: blur(15px);
    pointer-events: none; /* When popup info is up, disable main's nav buttons */    
}

/* Contains home and quiz section */
.container {
    display: flex;
    height: 100vh;
    width: 200%;
}

.home {
    position: relative;
    left: -50%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-content {
    max-width: 600px;
    display: flex;
    justify-content: center;
    flex-direction: column;

    h1 {
        font-size: 30px; /* if set to 70 like in the tutorial then the button becomes left aligned */
        font-weight: 700;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    }
    
    p {
        font-size: 16px;
        text-align: center;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
        margin-bottom: 30px;
    }
    
    .start-btn {
        width: 190px;
        height: 55px;
        background: var(--accent);
        border: 2px solid #FFF;
        outline: none;
        border-radius: 6px;
        box-shadow: 0 0 10px var(--accent);
        font-size: 18px;
        color: #FFF;
        letter-spacing: 1px;
        font-weight: 600;
        cursor: pointer;
        transition: 0.5s;
    }

    .start-btn:hover {
        background: #09001d;
        box-shadow: none;
    }
}

@media only screen and (max-width: 720px) {
    .home-content {
        max-width: 500px;
    }
}


/* Pop Up ----------------------------------------- */
.popup-info {
    position: absolute;    
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9); /* Moves the pop-up from below the quiz to up and center area */
    width: 500px;
    background: #FFF; /* When the pop-up is visible it will have a white bg */
    border-radius: 6px;
    padding: 10px 25px;
    transition: 0.3s ease;

    h2 {
        font-size: 50px;
        color: var(--accent);
    }

    .info {
        display: block; /* tutotial put inline-block but it put them side by side */
        font-size: 16px;
        color: #333;
        font-weight: 500;
        margin: 4px 0;
    }

    .btn-group {
        display: flex;
        justify-content: space-between; /* Puts them in opposite corners */
        align-items: center;

        /* Make a dividing line between info and button group below */
        border-top: 1px solid #999;
        margin-top: 10px;
        padding: 15px 0 7px;

        .info-btn {
            /* Centers the link (a) version */
            display: inline-flex; 
            justify-content: center;
            align-items: center;
            /* Button and link styling */
            width: 130px;
            height: 45px;
            background: var(--accent);
            border: 2px solid var(--accent);
            outline: none;
            border-radius: 6px;
            text-decoration: none;
            font-size: 16px;
            color: #FFF;
            font-weight: 600;   
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            transition: 0.3s;
        }

        .info-btn:nth-child(1) {
            background: transparent;
            color: var(--accent);
        }

        .info-btn:nth-child(1):hover {
            background: var(--accent);
            color: #FFF;
        }

        .info-btn:nth-child(2):hover {
            background: var(--accent-darker);
            border-color: var(--accent-darker);
        }
    }
}

@media only screen and (max-width: 720px) {
    .popup-info  {
        width: 300px;

        h2 {
            font-size: 30px;
        }

        .info {
            font-size: 14px;
        }

        .btn-group {
            .info-btn {
                /* Button and link styling */
                width: 120px;
                height: 35px;
            }
        }
    }
}

.popup-info.active {
    transform: translate(-50%, -50%) scale(1); /* Moves the pop-up from below the quiz to up and center area */
}

/* quiz section */
.quiz-section {
    position: relative;
    left: -100%; /* pushes section to the left side of the screen. */
    width: 100%;
    background: var(--darkbg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* place quiz section infront of main and the popup info */
    transition: 0.8s ease-in-out;
    transition-delay: 0.25s;

    .quiz-box {
        position: relative;
        width: 500px;
        background: transparent;
        border: 2px solid var(--accent);
        border-radius: 6px;
        display: flex;
        flex-direction: column;
        padding: 20px 30px;
        opacity: 0; 
        pointer-events: none;
        transform: scale(0.9);
        transition: 0.3s ease;
        transition-delay: 0s;

        h1 {
            font-size: 32px;
            text-align: center;
            
            /* linear gradient - accent colour in the center and then be transparent on the edges */
            background: linear-gradient(45deg, transparent, var(--accent), transparent);
            
            border-radius: 6px;
        }

        .quiz-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 0;
            border-bottom: 2px solid var(--accent); /* Dividing line before the questions */
            margin-bottom: 30px;

            span {
                font-size: 18px;
                font-weight: 500;
            }

            .header-score {
                background: var(--accent);
                border-radius: 3px;
                padding: 7px;
            }
        }

        .question-text {
            font-size: 24px;
            font-weight: 600;
        }

        .option-list .option {
            width: 100%;
            padding: 12px;
            background: transparent;
            border: 2px solid rgba(255,255,255,.2);
            border-radius: 4px;
            font-size: 17px;
            margin: 15px 0;
            cursor: pointer;
            transition: .3s;
        }

        .option-list .option.correct {
            background: var(--darkbg);
            color: var(--correct-color);
            border-color: var(--correct-color);;
        }

        .option-list .option.incorrect {
            background: var(--darkbg);
            color: var(--incorrect-color);
            border-color: var(--incorrect-color);;
        }

        .option-list .option.disabled {
            pointer-events: none;
        }

        .option-list .option:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: rgba(255, 255, 255, 0.1);
        }

        .quiz-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 2px solid var(--accent);
            padding-top: 20px;
            margin-top: 25px;

            .question-total {
                font-size: 16px;
                font-weight: 600;
            }
    
            .next-btn {
                width: 100px;
                height: 45px;
                background: rgba(255, 255, 255, 0.1);
                border: 2px solid rgba(255, 255, 255, 0.1);
                outline: none;
                border-radius: 6px;
                font-size: 16px;
                color: rgba(255, 255, 255, 0.3);
                font-weight: 600;
                cursor: pointer;
                pointer-events: none;
                transition: 0.5s;
            }

            .next-btn.active {
                background: var(--accent);
                border-color: var(--accent);
                color: #FFF;
                cursor: pointer;
                pointer-events: auto;
            }

            .next-btn.active:hover {
                background: var(--accent-darker);
                border-color: var(--accent-darker);
            }
        }
    }

    .quiz-box.active {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
        transition: 1s ease;
        transition-delay: 1s;
    }

    @media only screen and (max-width: 720px) {
        .quiz-box {
            width: 95%;
            transform: scale(0.9);
    
            h1 {
                text-align: center;
            }
    
            .quiz-header {
                border-bottom: 2px solid var(--accent); /* Dividing line before the questions */
                margin-bottom: 25px;
    
                span {
                    font-size: 16px;
                }
    
                .header-score {
                    padding: 5px;
                    font-size: 14px;
                }
            }
    
            .question-text {
                font-size: 22px;
            }
    
            .option-list .option {
                width: 100%;
                padding: 10px;
                font-size: 15px;
                margin: 13px 0;
            }
    
            .quiz-footer {
                padding-top: 18px;
                margin-top: 22px;
    
                .question-total {
                    font-size: 14px;
                }
        
                .next-btn {
                    font-size: 14px;
                }
            }
        }
    }
}

.quiz-section.active {
    /* Move the quiz section from the -50% left to 0 - it will slide in from the left */
    left: 0;
}

/* RESULT SECTION ------------------------------------ */
.result-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(0.9);
    width: 500px;
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;

    /* Hide initially and disable pointer events */
    opacity: 0; 
    pointer-events: none; /* When hidden, need to make sure the pointer doesn't change or work on the hidden buttons */    

    /* Transition away? */
    transition: 0.3s ease;

    h2 {
        font-size: 52px;
    }

    .percentage-container {
        width: 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 20px 0 40px;

        .circular-progress {
            position: relative;
            width: 250px;
            height: 250px;
            background: conic-gradient(var(--accent) 3.6deg, rgba(255,255,255, 0.1) 0deg);
            border-radius: 50%;

            /* Put the % in the center of the circle */
            display: flex;
            justify-content: center;
            align-items: center;

            .progress-value {
                position: relative; /* Make it float on top of the inner dark circle from .circular-progress::before */
                font-size: 45px;
                font-weight: 600
            }
        }

        /*  Inner circle in the progress circle. 
            Set as bg colour to make the circle only fill up on the outside */
        .circular-progress::before {
            content: '';
            position: absolute;
            width: 210px;
            height: 210px;
            background: var(--darkbg);
            border-radius: 50%;
        }

        .score-text {
            font-size: 26px;
            font-weight: 600;
            margin-top: 20px;
        }
    }

    .buttons {
        display: flex;

        button {
            width: 130px;
            height: 45px;
            background: var(--accent);
            border: 2px solid var(--accent);
            outline: none;
            border-radius: 6px;
            font-size: 16px;
            color: #FFF;
            font-weight: 600;   
            margin: 0 20px 20px;
            cursor: pointer;
            transition: 0.5s;
        }

        button:nth-child(1):hover {
            background: var(--accent-darker);
            border-color: var(--accent-darker);
        }

        button:nth-child(2) {
            background: transparent;
            color: var(--accent);
        }

        button:nth-child(2):hover {
            background: var(--accent);
            color: #fff;
        }
    }

}

.result-box.active {
    /* Make visible and restore events */
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%,-50%) scale(1);
}