/* Basic Body Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #0a192f; /* Base background color for the entire site */
    color: #ccd6f6; /* Light text color for contrast */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    position: sticky; /* Make the header "stick" to the top */
    top: 0;
    z-index: 1000; /* Ensure header is always on top of other content */
    background-color: #112240; /* A slightly lighter blue for the header */
    border-bottom: 3px solid #ff8c00; /* Orange bottom border */
}

/* Main content section below the header */
main {
    /* Set the background image for this section only */
    background: url('assets/homepage.png') no-repeat center top;
    background-size: cover; /* Ensures the image covers the entire space without distortion */
    background-attachment: fixed; /* Fix the background for the homepage */
    background-color: #f0f0f0; /* Example: Light gray background */

    /* Ensures this section fills the remaining screen space.
       100vh (full screen height) minus 93px (approximate header height) */
    min-height: calc(100vh - 93px - 61px); /* 100vh - header height - footer height */
    flex-grow: 1; /* Allow main content to grow and push the footer down */
}

/* Specific background for the student view page */
#student-ask {
    background-image: url('assets/background-student.png');
    background-attachment: scroll; /* Make the background scroll with the page */
}

/* Specific background for the dashboard page */
#dashboard {
    background: url('assets/dashboard.jpg') no-repeat center top;
    background-size: cover;
    background-attachment: scroll;
}

/* Specific background for the login page */
#login {
    background: url('assets/login.jpg') no-repeat center top;
    background-size: cover;
    background-attachment: scroll;
}

/* Header Sections (Left, Center, Right) */
.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

/* Left Section - Website Name */
.header-left {
    justify-content: flex-start;
}

.header-left h1 {
    margin: 0;
    font-size: 1.8em;
    color: #ff8c00; /* Orange */
}

/* Center Section - Logo */
.header-center {
    justify-content: center;
}

.header-center img {
    height: 60px; /* You can change this logo size */
    width: 60px; /* Ensure width and height are equal for a perfect circle */
    border-radius: 50%; /* This will make the image circular */
    object-fit: cover; /* Ensures the image fills the circle without distortion */
    border: 2px solid #ff8c00; /* Orange border around the logo */
    background-color: #0a192f; /* Background color if the logo is transparent */
}

/* Right Section - Navigation */
.header-right {
    justify-content: flex-end;
}

.header-right nav a {
    color: #ccd6f6;
    text-decoration: none;
    margin-left: 25px;
    font-size: 1.1em;
    font-weight: bold;
    transition: color 0.3s ease;
}

.header-right nav a:hover {
    color: #ff8c00; /* Change to orange on hover */
}

/* Removes the underline from the link in header-left */
.header-title-link {
    text-decoration: none;
}

/* General Styles for Content Sections */
.content-section {
    padding: 80px 50px;
    text-align: center;
    flex-grow: 1; /* Allow content sections to grow and push the footer down */
}

.content-section h2 {
    font-size: 2.5em;
    color: #ff8c00;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* "Start Now" Section Styles */
#start {
    background: url('assets/background-start.jpg') no-repeat center top;
    background-size: cover;
    background-attachment: scroll;
}

.start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: left;
}

.start-card {
    background-color: #112240;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #ff8c00;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.start-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.start-card h3 {
    color: #ccd6f6;
    font-size: 1.5em;
    margin-top: 0;
}

.card-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff8c00;
    color: #0a192f;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.card-button:hover {
    background-color: #ffac4d;
}

/* "Contact" Section Styles */
#contact {
    background: url('assets/contact.jpg') no-repeat center top;
    background-size: cover;
    background-attachment: scroll;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #8892b0;
    background-color: #0a192f;
    color: #ccd6f6;
    font-size: 1em;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #8892b0;
}

.contact-form button {
    padding: 15px;
    background-color: #ff8c00;
    color: #0a192f;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: #ffac4d;
}

/* ==========================================================================
   Utility & Reusable Component Styles
   ========================================================================== */

/* Reusable Button Style */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    border: 2px solid #ff8c00;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background-color: #ff8c00;
    color: #0a192f;
    border-color: #ff8c00;
}

/* Login Page Styles */
.login-form {
    max-width: 450px;
    margin: 0 auto;
    padding: 40px;
    background-color: #112240;
    border: 1px solid #ff8c00;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.login-form input,
.login-form select {
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #8892b0;
    background-color: #0a192f;
    color: #ccd6f6;
    font-size: 1em;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #ffac4d;
    color: #0a192f;
    transform: translateY(-3px); /* Menambah kesan 'terangkat' */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Menambah bayang-bayang lembut */
    outline: none;
}

.btn-primary:active {
    transform: translateY(-1px); /* Kesan ditekan */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); /* Bayang-bayang lebih kecil */
}

/* Container for password input and toggle icon */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    width: 100%; /* Make input fill the container */
}

.toggle-password-icon {
    position: absolute;
    right: 15px; /* Position icon inside the input field */
    cursor: pointer;
    user-select: none; /* Prevent text selection on the icon */
}

/* Student Question Form Styles */
.question-form {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #8892b0;
    background-color: #0a192f;
    color: #ccd6f6;
    font-size: 1.1em;
    resize: vertical;
}

/* Lecturer Dashboard Styles */
.questions-container {
    max-width: 900px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-card {
    background-color: #112240;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #ff8c00;
    text-align: left;
    font-size: 1.2em;
    color: #ccd6f6;
}

/* Gaya khas untuk teks status di papan pemuka */
.dashboard-status-text {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-size: 1.1em;
    color: #a8b2d1; /* Warna yang lebih lembut sedikit */
    margin-top: 0;
    margin-bottom: 25px;
}

/* Footer Styles */
footer {
    background-color: #0a192f;
    text-align: center;
    padding: 20px;
    border-top: 1px solid #112240;
    color: #8892b0;
}

/* Specific background for the student class selection page */
#class-select {
    background: url('assets/student-class.jpg') no-repeat center top;
    background-size: cover;
    background-attachment: scroll;
}

/* Class Selection Page Styles */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.class-button {
    display: block;
    padding: 30px 20px;
    background-color: #112240;
    color: #ccd6f6;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: bold;
    border: 1px solid #ff8c00;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.class-button:hover {
    background-color: #ff8c00;
    color: #0a192f;
    transform: translateY(-5px);
}

/* Styles for the dashboard header containing the title and end session button */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    margin-bottom: -30px; /* Adjust spacing */
}

.end-session-button {
    padding: 10px 23px; /* Laraskan padding untuk border */
    background-color: transparent; /* Latar belakang lutsinar */
    color: #ff8c00; /* Warna teks oren tema */
    font-size: 1em; /* Saiz fon lebih kecil sedikit */
}

.end-session-button:hover {
    background-color: #ff8c00; /* Isi dengan warna oren apabila dihover */
    color: #0a192f; /* Tukar warna teks kepada gelap untuk kontras */
}


/* Gaya untuk kesan "pop up" soalan baharu */
.question-card.new {
    /* Mencetuskan animasi apabila kelas 'new' ditambah */
    animation: newQuestionAnimation 2.5s ease-out;
    transform-origin: center;
}

@keyframes newQuestionAnimation {
    0% {
        transform: scale(1.05); /* Membesar sedikit */
        background-color: #ff8c00; /* Warna latar oren yang menonjol */
        color: #0a192f; /* Teks gelap untuk kontras */
    }
    60% {
        /* Kekalkan kesan untuk seketika */
        transform: scale(1.05);
        background-color: #ff8c00;
        color: #0a192f;
    }
    100% {
        transform: scale(1); /* Kembali ke saiz asal */
        background-color: #112240; /* Kembali ke warna latar asal */
        color: #ccd6f6; /* Kembali ke warna teks asal */
    }
}

/* Gaya untuk Modal Pop-up di Tengah Skrin */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.85); /* Latar belakang gelap separa lutsinar */
    z-index: 2000; /* Pastikan ia di atas semua elemen lain */
    display: none; /* Sembunyikan secara lalai, JavaScript akan menukarnya kepada 'flex' */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

/* Tambah kelas 'closing' untuk mencetuskan animasi keluar */
.modal-overlay.closing {
    /* `forwards` memastikan elemen kekal pada keadaan akhir animasi (lutsinar) */
    animation: fadeOut 0.3s ease forwards;
}

.modal-overlay.closing .modal-content {
    /* Animasi untuk mengecilkan kandungan modal apabila ditutup */
    animation: scaleDown 0.3s ease forwards;
}

.modal-content {
    background-color: #112240;
    padding: 40px;
    border-radius: 8px;
    border: 2px solid #ff8c00;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    animation: scaleUp 0.3s ease forwards;
}

.modal-content h3 {
    color: #ff8c00;
    margin-top: 0;
    font-size: 1.8em;
}

.modal-content p {
    font-size: 1.4em;
    color: #ccd6f6;
    margin-bottom: 30px;
}

/* Container untuk butang tindakan dalam modal (cth: Cancel, Confirm) */
.modal-actions {
    display: flex;
    justify-content: flex-end; /* Letakkan butang di sebelah kanan */
    gap: 15px; /* Jarak antara butang */
    margin-top: 20px;
}

/* Gaya untuk butang sekunder (cth: Cancel) */
.btn-secondary {
    background-color: transparent;
    color: #ccd6f6;
    border-color: #8892b0;
}

.btn-secondary:hover {
    background-color: #3a506b; /* Warna latar hover yang lembut */
    border-color: #ccd6f6;
}

/* Gaya untuk butang bahaya (cth: Delete, End Session) */
.btn-danger {
    background-color: #e63946; /* Warna merah yang jelas */
    color: #f1faee;
    border-color: #e63946;
}

.btn-danger:hover {
    background-color: #d62828; /* Merah yang lebih gelap semasa hover */
    border-color: #d62828;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from { transform: scale(0.95); }
    to {
        transform: scale(1);