/* ======== */
/* home css */
/* ======== */

body { font-family: Arial, sans-serif; background: #f8f9fa; margin: 0; padding: 0; }
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
h1 { margin: 0; font-size: 2em; }
.filters, .search-box { margin-top: 15px; }
.search-box input { padding: 10px; width: 100%; max-width: 400px; border: 1px solid #ccc; border-radius: 5px; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.quiz-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; display: flex; flex-direction: column; }
.quiz-image { width: 100%; height: 160px; object-fit: cover; }
.quiz-content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.quiz-content h3 { margin: 0 0 10px; font-size: 1.2em; }
.quiz-content p { color: #555; }
.quiz-meta { font-size: 0.9em; color: #777; margin-top: 10px; }
.quiz-actions { margin-top: 15px; display: flex; gap: 10px; }
button { padding: 8px 12px; border: none; border-radius: 5px; cursor: pointer; }
button.play { background: #4f46e5; color: #fff; }
button.details { background: #e5e7eb; }
.filters select, .filters button { margin-right: 8px; padding: 8px; border: 1px solid #ccc; border-radius: 5px; }



/* ========== */
/* header css */
/* ========== */

header { 
    background: #007bff; 
    color: white; 
    padding: 1rem; 
    text-align: center; 
}
.header-new { background: #007bff; color: white; padding: 1rem; text-align: center; }

nav a { color: white; margin: 0 10px; text-decoration: none; font-weight: bold; }
nav a:hover { text-decoration: underline; }
main { padding: 2rem; }
table { border-collapse: collapse; width: 100%; max-width: 600px; }
th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
th { background: #f5f5f5; }
tr:nth-child(even) { background: #fafafa; }

/* ========== */
/* footer css */
/* ========== */

footer {
    color: #777;
    background: #f1f1f1;
    text-align:center;
    padding: 1rem;
    margin-top: 2rem;
}


/* ====================== */
/* Used by the login page */
/* ====================== */
.login {
    width: 400px;
    background-color: #ffffff;
    box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.3);
    margin: 100px auto;
}
.login h1 {
    text-align: center;
    color: #5b6574;
    font-size: 24px;
    padding: 20px 0 20px 0;
    border-bottom: 1px solid #dee0e4;
}
.login form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 20px;
}
.login form label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: #3274d6;
    color: #ffffff;
}
.login form input[type="password"], .login form input[type="text"] {
    /* width: 80%; */
    width: 310px;
    height: 50px;
    border: 1px solid #dee0e4;
    margin-bottom: 20px;
    padding: 0 15px;
}
.login form input[type="submit"] {
    width: 100%;
    padding: 15px;
   margin-top: 20px;
    background-color: #3274d6;
    border: 0;
    cursor: pointer;
    font-weight: bold;
    color: #ffffff;
    transition: background-color 0.2s;
}
.login form input[type="submit"]:hover {
  background-color: #2868c7;
    transition: background-color 0.2s;
}

div.message {
    color: red;
    margin: 20px;
    width: 100%;
}


/* For tablets */
@media (max-width: 768px) {
  .login {
    width: 400px;
  }
  .login form input[type="password"], .login form input[type="text"] {
    width: 310px;
  }
}

/* For mobile phones */
@media (max-width: 480px) {
  .login {
    width: 320px;
  }
  .login form input[type="password"], .login form input[type="text"] {
    width: 200px;
  }
}

/* =========================================== */
/* subject css                                 */
/* =========================================== */

span.subject-latest-score-100 {
    color: green; 
    font-weight: bold;
}

span.subject-latest-score {
    font-weight: bold;
}

i.subject-score-tick {
     color: green; 
     font-weight: bold; 
     font-size: 1.4em;
}

/* ============================================ */
/* quiz.css                                     */
/* ============================================ */

/* CSS file for subject page */

div.quiz-main {
    display: flex;
    justify-content: center;
}


div.question {
    /* width: 20em; */
    text-align: center;
    margin: 4px;
    margin-top: 20px;
    font-size: 1.4em;
    cursor: pointer;
    font-weight: 500; 
} 

span#questionPrompt {
    font-size: 0.8em; 
}


/* Answer button */
button.answer {
    background-color:whitesmoke;
    color: black;
    border: 3px solid lightgray;

    /*  TODO: Setting this to 20em caused the buttons not to fit on mobile */
    width: 20em;
    
    text-align: center;
    margin: 5px;    
    font-size: 1.4em;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

button.answer:hover {
    background-color: lightblue;
}


button.next-button {
    background-color:lightgrey;
    color: black;
    border: 1px solid black;
    width: 20em;
    text-align: center;
    margin: 4px;
    margin-top: 20px;
    font-size: 1.4em;
    cursor: pointer;
} 

button.next-button:hover {
    background-color: grey;
}



button.try-again-button {
    background-color:lightgreen;
    color: black;
    border: 1px solid black;
    width: 20em;
    text-align: center;
    margin: 4px;
    margin-top: 20px;
    font-size: 1.4em;
    cursor: pointer;
} 

button.try-again-button:hover {
    background-color: green;
}



/* For tablets */
@media (max-width: 768px) {
  button.answer {
    /* width: 150px; */
    width: 15em;
  }
  button.next-button {
    width: 15em;
  }
  button.try-again-button {
    width: 15em;
  }
}

/* For mobile phones */
@media (max-width: 480px) {
  button.answer {
    width: 100%;
  }
  button.next-button {
    width: 100%;
  }
  button.try-again-button {
    width: 100%;
  }
}


div.correct {
    background-color: green;
    padding-left: 4px;
    font-size: 1.4em;
}

div.wrong {
    background-color: red;
    padding-left: 4px;
    font-size: 1.4em;
}

div.score {
    margin-bottom: 20px;
}


div.complete {
    font-size: 2em;
    margin-top: 60px;
    margin-bottom: 60px;
    color: red;
}

span#percent-score-outer {
    padding-left: 7px;
    padding-right: 7px;
    padding-top: 4px;
    padding-bottom: 4px;
    color: white;
}


div.correct-message {
    background: #d4edda;
    padding-left: 20px;
    padding-top: 8px;
    padding-bottom: 8px;
}

div.wrong-message {
    background: #f8d7da;
    padding-left: 20px;
    padding-top: 8px;
    padding-bottom: 8px;
}


button.highlight-chosen-green {
    background-color: lightgreen;
    border: 3px solid green;
}

button.highlight-chosen-green:hover {
    background-color: lightgreen;
    border: 3px solid green;
}


button.highlight-chosen-red {
    background-color: lightpink;
    border: 3px solid red;
}

button.highlight-chosen-red:hover {
    background-color: lightpink;
    border: 3px solid red;
}


button.highlight-correct-green {
    background-color: lightgreen;
    border: 3px solid green;
}

button.highlight-correct-green-outline {
    background-color: #E9FCE9;
    border: 3px solid green;
}
