:root {
    --primary-color: #3f51b5;
    --secondary-color: #ffffff;
    --tertiary-color: #212121;
    --button-hover-color: #303f9f;
    --input-border-color: #757575;
    --gradient-primary: linear-gradient(90deg, #00f5d4, #0096c7);
    --gradient-danger: linear-gradient(90deg, #ff4d4d, #ff1a1a);
    --background-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-background: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
    --text-color: #ddd;
    --accent-color: #00f5d4;
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background-gradient);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-y: auto;
}

h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#course-container {
    background: var(--glass-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--glass-shadow);
    width: 500px;
    max-width: 90%;
    text-align: center;
    border: 1px solid var(--glass-border);
    animation: slideIn 1s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

form {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 15px;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

input[type="number"],
input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--secondary-color);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease-in-out;
    resize: vertical;
    min-height: 40px;
}

input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
    background: rgba(255, 255, 255, 0.25);
}

button {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: var(--secondary-color);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s ease-in-out;
}

button[type="reset"] {
    background: var(--gradient-danger);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

#result,
#percentage,
#grade {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
    animation: popUp 0.5s ease-out;
}

@keyframes popUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#celebration {
    display: none;
    font-size: 2.5rem;
    color: gold;
    margin-top: 20px;
    animation: celebrate 1s infinite alternate;
}

@keyframes celebrate {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.star {
    position: absolute;
    top: -50px;
    font-size: 20px;
    color: gold;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    background: gold;
    border-radius: 50%;
    animation: explode 1s ease-out infinite;
}

@keyframes explode {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.course {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
    animation: fadeIn 0.5s ease-in;
}

.course label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.course input,
.course textarea {
    flex: 2;
    margin: 5px 0;
}

.course button {
    background-color: #f44336;
    width: 30px;
    height: 30px;
    border-radius: 60%;
    font-size: 1.2rem;
    line-height: 0;
    padding: 0;
    box-shadow: 0 px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease-in-out;
}

.course button:hover {
    background-color: #d32f2f;
}

#add-course-button {
    margin-top: 20px;
    background-color: #4caf50;
}

#add-course-button:hover {
    background-color: #388e3c;
}
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    #course-container {
        width: 100%;
        max-width: 95%;
        padding: 20px;
        border-radius: 10px;
    }

    form {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .course {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .course label {
        flex: 1;
        text-align: left;
        font-size: 1rem;
    }

    .course input, 
    .course textarea {
        flex: 2;
        padding: 10px;
        font-size: 1rem;
        margin: 5px;
    }

    .course button {
        
        font-size: 1rem;
      
    }

    button {
        padding: 12px;
        font-size: 1rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .course {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .course label, 
    .course input, 
    .course textarea,
    .course button 
     {
        flex: 1;
        margin: 5px 0;
        text-align: center;
    }

    button {
        font-size: 0.9rem;
        padding: 10px;
    }
}