/* General styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

h1, h2 {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}
#login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Add spacing below the header */
  }
  
  /* Navigation links styling */
  .nav-container {
    display: flex;
    justify-content: center;
    gap: 15px;
  }
  .nav-links {
    display: flex;
    gap: 15px; /* Add space between links */
  }
  
  .nav-links a {
    text-decoration: none; /* Remove underline */
    font-weight: bold; /* Make links bold */
    color: #0056b3; /* Customize the link color */
    margin-left: 10px
  }
  
  .nav-links a:hover {
    text-decoration: underline; /* Add underline on hover */
  }

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

}

/* Form styles */
form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    margin-left: 30px;
    margin-right: 30px;
    font-family: sans-serif;
    font-size: 16px; /* Adjust font size */
}

form input, form select, form textarea, form button {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: sans-serif;
    font-size: 16px;
}

form input, form select {
    flex: 1;
    min-width: 200px;
}

form textarea {
    flex: 2;
    height: 80px;
    resize: none;
    white-space: pre-wrap;
}

form button {
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #0056b3;
}

form i {
    margin-right: 5px;
}

/* Question card styles */
#question-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center items horizontally */
    align-items: center; /* Align items vertically */
    width: 90%; /* Maintain width */
    margin: 20px auto; /* Center the form */
}
#questions-container {
    width:90%;
    margin: 20px auto;
    white-space: pre-wrap;
}
#questions-container-blog {
    width:90%;
    margin: 5px auto;
    /*white-space: pre-wrap;  Note: this line create big space between "asked by...." and question, and answer*/
}
/* Style the question card */
details {
    margin-bottom: 0px 5px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    cursor: pointer;
}

/* Style the summary (question header) */
summary {
    font-weight: bold;
    font-size: 16px;
    line-height: 1.4;
    margin: 0px 5px;
    outline: none;
}

/* Style the answer content */
details p, details div {
    margin: 5px 0;
}
.author {
    font-size: 14px;
    color: gray; 
    font-style: italic;   
}
/* Styling for "Asked by" line */
/*.summary-author {
    font-size: 12px;
    color: gray;
    margin-bottom: 4px; 
}*/

/* Styling for the question */
.summary-question {
    font-size: 16px;
    font-weight: bold;
    cursor: pointer; /* Adds pointer cursor for interactivity */
}

/* Styling for the answer section */
/*.answer-author {
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;
}*/

.answer-details > div {
    margin: 5px 0;
    line-height: 1.5;
}

/* General card styling */
details {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

details[open] {
    background-color: #f3f3f3;
}

.question-card {
    display: flex;
    flex-direction: column;
    margin-top: 5px; /* Adjust the margin of the entire question card */
    padding: 5px; /* Adjust padding around the card */
    border: 1px solid #ddd; /* Optional: Add a border for separation */
    border-radius: 5px; /* Optional: Add rounded corners */
    background-color: #f9f9f9; /* Optional: Light background color */
    max-width: 800px; /* Restrict width for better readability */
}

.question-card pre[contenteditable="true"] {
    background-color: #fff9e6; /* Highlight editable area */
    padding: 10px; /* Space inside editable area */
    border: 1px solid #ddd; /* Visual distinction for the editable field */
    border-radius: 4px; /* Consistent rounded corners */
    font-family: inherit; /* Use the same font as the parent */
    font-size: 16px; /* Adjust to match the admin page */
    line-height: 1.5; /* Ensure proper line spacing */
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word; /* Allow word wrapping */
    min-height: 50px; /* Minimum height for visibility */
}

.answer-text {
    font-family: inherit; /* Inherit the parent's font */
    font-size: 16px; /* Ensure consistent font size */
    line-height: 1.5; /* Set line spacing */
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word; /* Prevent long lines from overflowing */
    color: #333; /* Set consistent text color */
    margin: 0; /* Remove extra margin */
}

.question-card h3 { /* question*/
    margin-top: 5px; /* Reduce space above the question */
    margin-bottom: 5px; /* Reduce space below "Asked by" */
    font-weight: bold;
    font-size: 16px; /* Optional: Adjust font size */
    line-height: 1.4;/* Adjust the line height for the question text */
}

.question-card .answer-text p:first-of-type {
    margin-top: 0; /* Adjust margin for "Answered by EXP:" */
}

.question-card .answer-text p:last-of-type {
    margin-top: 0; /* Adjust margin for the actual answer */
}
.question-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.actions .save-btn {
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.actions .save-btn:hover {
    background-color: #4cae4c;
}

.actions .delete-btn {
    background-color: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
}

.actions .delete-btn:hover {
    background-color: #c9302c;
}

/* Responsive design */
@media (max-width: 767px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
    }
/*    .banner {
        width: 100vw; 
        height: auto; 
        background-size: cover; 
    }*/

    form {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 0 auto;
        width: 95%; /* Ensure form is horizontally centered */
        max-width: 400px;
        gap: 10px; /* Spacing between elements */
    }

    form input, form select, form textarea, form button {
        width: 100%; /* Full width for elements */
        font-family: Arial, sans-serif;
    }

    h2 {
        font-size: 18px;
        margin: 5px 0;
        text-align: center;
    }

    #name, #category, #question {
        margin: 0;
        padding: 4px;
        height: 20px;
        font-size: 14px;
    }

    #question {
        height: 60px;
    }

    .answer-details {
        font-size: 14px;
    }
    .author {
        font-size: 13px;
    }

    form button {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 35px;
        font-size: 16px;
        margin: 0;
    }
}