@import url('https://fonts.googleapis.com/css2?family=Quattrocento+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?&family=Metamorphous&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merienda:wght@300..900&family=Josefin+Sans:ital,wght@0,100..700;1,100..700&family=Titillium+Web:ital,wght@0,400;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader {
    border-top: 2px solid #f3f3f3;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    margin-left: 5px;
    animation: spin 1s linear infinite;
    display: none;
}

.loader-auth {
    background-color: #ffffff;
    border-top: 2px solid #6a0dad;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    margin-left: 5px;
    animation: spin 1s linear infinite;
    display: none;
}

* {
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Titillium Web", "Quattrocento Sans", Arial, sans-serif;
}

body {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    background-color: #f9f9f9;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    padding: 0 10px;
    color: white;
    background-color: black;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

button:disabled {
    background: #a94dd0;
    cursor: not-allowed;
}

header .hamburger {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    position: absolute;
    left: 20px;
    transition: left 0.3s ease;
}

header .logo a {
    text-decoration: none;
}

header .logo img {
    margin-top: 7px;
    height: 40px;
}

header .header-right {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-right: 20px;
}

header .profile,
header .enter-code {
    display: block;
}

header .profile-icon {
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

header .enter-code,
header .header-right a {
    color: white;
    background-color: black;
    font-weight: bold;
    transition: all 0.3s ease;
    border-radius: 5px;
    padding: 0.7rem 1rem;
    border: 2px solid #444;
    cursor: pointer;
}

header .enter-code:hover,
header .header-right a:hover {
    background-color: #555;
}

header .header-right a {
    text-decoration: none;
    font-size: 0.9rem;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
}

header .header-right a.button-log-in {
    background-color: #333;
    border: 2px solid #444;
}


header .header-right a.button-sign-up,
header .header-right a.button-log-out {
    background-color: #6a0dad;
    border: none;
}

header .header-right a.button-log-in:hover {
    background-color: #555;
}

header .header-right a.button-sign-up:hover {
    background-color: #a94dd0;
}

/* Sidebar styles (Flyout Menu for Mobile) */
.sidebar {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 200px;
    height: calc(100vh - 60px);
    background-color: white;
    color: #333;
    padding: 20px;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: 5px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 500;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar .create-button,
.sidebar .signup-button,
.sidebar .login-button,
.sidebar .enter-code {
    background-color: #6a0dad;
    color: white;
    box-shadow: inset 0 -5px 1px rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 5px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    transition: box-shadow .2s ease;
    transition: outline 0s;
}

.sidebar .signup-button:hover,
.sidebar .login-button:hover,
.sidebar .create-button:hover,
.sidebar .enter-code:hover {
    background-color: #a94dd0;
    transition: background-color .2s ease;
}

.sidebar .signup-button:active,
.sidebar .login-button:active,
.sidebar .create-button:active,
.sidebar .enter-code:active {
    background-color: #520688;
    box-shadow: none;
    padding: 10px 24px;
    margin-top: 4px;
    outline: none;
    transition: background-color .2s ease;
}

.sidebar .create-button:focus-visible,
.sidebar .enter-code:focus-visible {
    outline: 3px solid #a94dd0c5;
    outline-offset: 3px;
}

/* Notification styles */
.notification {
    width: 40%;
    max-width: 75%;
    padding: 15px;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    position: fixed;
    top: 80px;
    right: 0;
    transition: all 0.3s ease;
    word-wrap: break-word;
    box-sizing: border-box;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transform: translateX(100%);
}

.notification.visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background-color: #489f49;
    color: white;
}

.notification.error {
    background-color: #F44336;
    color: white;
}

#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #f39d12c8;
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.4s ease;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: scale(1.1);
}

.enter-code-btn {
    background: #6a0dad;
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.enter-code-btn:hover {
    background-color: #5a4ae3;
}


/* Modal Styling */
.enter-code-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.97);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.enter-code-modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 50px;
    cursor: pointer;
    color: #fff;
}


#modalMessage {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #6a0dad;
}

.error-code {
    color: #ff0000;
}

.quiz-code-input {
    width: 100%;
    padding: 10px;
    margin: 20px 0;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.quiz-code-input.error {
    background-color: #ffdddd;
    border-color: #ff0000;
}


.enter-code-submit-btn {
    background: #6a0dad;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.enter-code-submit-btn:hover {
    background: #a94dd0;
    scale: 1.05;
}

.enter-code-submit-btn:active {
    background: #460575;
    scale: 1;
}

.enter-code-submit-btn:disabled {
    background: #1f0c27;
    cursor: not-allowed;
}

/* RESPONSIVE STYLES */

/* Mobile Styles */
@media only screen and (max-width: 768px) {
    header .hamburger {
        position: absolute;
        left: 20px;
        font-size: 1.5rem;
    }

    header {
        padding: 0 15px;
    }

    header .logo {
        margin-left: 30px;
    }

    .notification {
        width: 70%;
    }

    .sidebar {
        display: flex;
        left: -500%;
        transition: left 1s ease;
    }

    .sidebar.active {
        left: 0;
        transition: left 0.3s ease;
    }
}

@media only screen and (max-height: 600px) {
    .sidebar {
        gap: 5px;
        padding: 5px;
        padding-top: 10px;
    }

    .sidebar a {
        text-decoration: none;
        color: #333;
        padding: 10px 15px;
        display: flex;
        gap: 1rem;
    }
}

@media only screen and (max-width: 530px) {
    header .header-right {
        margin-right: 10px;
    }

    header .enter-code {
        display: none;
    }

    header .logo img {
        margin-top: 7px;
        height: 30px;
    }

    header .hamburger i {
        font-size: 1.2rem;
    }

    #backToTop {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 40px;
        right: 20px;
    }
}

@media only screen and (max-width: 300px) {
    header .header-right {
        display: none;
    }
}

@media only screen and (max-height: 450px) {
    .sidebar {
        gap: 2px;
        padding: 2px;
        padding-top: 10px;
    }

    .sidebar a {
        text-decoration: none;
        color: #333;
        padding: 10px 15px;
        display: flex;
        gap: .9rem;
    }
}

/* Desktop Styles */
@media only screen and (min-width: 769px) {
    .hamburger {
        display: none;
    }

    .sidebar {
        display: none;
    }
}