/* Reset default styles */
* {
    margin: 0;
    padding:0;
    box-sizing: border-box;
}

/* Blue-themed body for a 14-year-old girl */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #4682b4, #00b7eb);
    color: #ffffff;
    line-height: 1.6;
    padding: 20px;
}

/* Header styling */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.8rem;
    color: #e6f3ff;
    text-shadow: 0 0 10px #00b7eb;
    font-weight: bold;
}

/* Periodic table grid */
.periodic-table {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 5px;
    max-width: 1200px;
    margin: 0 auto;
}

.element {
    background: #eස;
    border: 2px solid #e6f3ff;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    background: linear-gradient(135deg, #00b7eb, #4682b4);
}

.element:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #e6f3ff;
}

.empty {
    background: transparent;
    border: none;
}

/* Lanthanides and Actinides sub-table */
.sub-table {
    max-width: 1200px;
    margin: 20px auto;
}

.sub-table h3 {
    text-align: center;
    color: #e6f3ff;
    margin-bottom: 10px;
}

.sub-grid {
    grid-template-columns: repeat(15, 1fr);
}

/* Details panel */
.details-panel {
    background-color: #e6f3ff;
    color: #1c2526;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 183, 235, 0.7);
    text-align: center;
    position: relative;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.4s, opacity 0.4s;
}

.details-panel.active {
    transform: translateY(0);
    opacity: 1;
}

/* Quiz button */
#quizButton {
    display: block;
    margin: 20px auto;
    padding: 12px 30px;
    background: linear-gradient(135deg, #00b7eb, #4682b4);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

#quizButton:hover {
    background: linear-gradient(135deg, #4682b4, #00b7eb);
}

/* Quiz container */
.quiz-container {
    display: none;
    background: #e6f3ff;
    color: #1c2526;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #00b7eb;
    text-align: center;
}

.quiz-container h2 {
    color: #4682b4;
    margin-bottom: 20px;
}

#quizOptions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#quizOptions button {
    padding: 12px;
    background: #ffffff;
    color: #4682b4;
    border: 2px solid #00b7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

#quizOptions button:hover {
    background: #b3e0ff;
}

#quizFeedback {
    margin: 15px 0;
    font-weight: bold;
}

#nextQuestion {
    padding: 12px 30px;
    background: linear-gradient(135deg, #00b7eb, #4682b4);
    color: #ffffff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
}

#nextQuestion:hover {
    background: linear-gradient(135deg, #4682b4, #00b7eb);
}

/* Responsive design */
@media (max-width: 768px) {
    .periodic-table {
        grid-template-columns: repeat(9, 1fr);
    }

    .sub-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    header h1 {
        font-size: 2rem;
    }

    .element {
        font-size: 0.9rem;
        padding: 8px;
    }

    .details-panel, .quiz-container {
        max-width: 90%;
        padding: 15px;
    }
}