/* ===========================
   Global Styles
=========================== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

/* ===========================
   Header Styles

.main-header {
    background-color: #333;
    color: white;
    padding: 15px 0;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}


.header-left h1 {
    margin: 0;
}

.header-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    flex-grow: 1;
}

.header-right p {
    margin: 0;
    flex: 1;
    line-height: 1.2em;
    word-wrap: break-word;
}

.btn-logout {
    margin-left: 20px;
    background-color: white;
    color: #333;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
    align-self: center;
}

.btn-logout:hover {
    background-color: #f2f2f2;
    color: #333;
}

/* ===========================
   Navigation Bar

.main-nav {
    background-color: #ff3333;
    padding: 5px 10px;
    text-align: center;
    display: flex;
    justify-content: flex-start;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px;
    margin: 0 5px;
    transition: background-color 0.3s;
}

.main-nav a:hover {
    background-color: #ffcccc;
    border-radius: 3px;
}

/* ===========================
   Box Modules Styles
=========================== */
.block {
    flex: 1 1 calc(33.333% - 40px); /* Three boxes per row with spacing */
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    min-width: 300px; /* Prevents the blocks from getting too narrow */
    margin: 10px; /* Adds 20px total spacing between blocks */
    box-sizing: border-box;
    overflow: hidden; /* Ensure content stays within the box */
}

/* ===========================
   Content Wrapper Styles
=========================== */
.content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Reduce gap between blocks */
    padding: 20px; /* Adjust padding to match the gap */
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

/* ===========================
   Responsive Design for Box Modules
=========================== */
/* On smaller screens (below 1024px), show 2 blocks per row */
@media (max-width: 1024px) {
    .block {
        flex: 1 1 calc(50% - 20px); /* 2 blocks per row */
    }
}

/* On even smaller screens (below 768px), show 1 block per row */
@media (max-width: 768px) {
    .block {
        flex: 1 1 100%; /* 1 block per row on small screens */
    }
}

/* ===========================
   Table Styles (for home.php)
=========================== */
.block table {
    width: 100%; /* Ensure table takes the full width of the block */
    table-layout: auto; /* Allow columns to adjust based on content */
    border-collapse: collapse; /* Ensure proper table formatting */
}

.block th, .block td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
    word-wrap: break-word; /* Ensure long text wraps within the cell */
}

/* Ensure the table fits within the box */
.block {
    max-width: 100%; /* Prevent the block content from overflowing */
}
/* ===========================
   SkillAssessment.php Specific Styles
=========================== */

/* Align the content of the skill assessment page */
.main-content-wrapper {
    display: flex;
    justify-content: center; /* Center the content horizontally */
    gap: 20px;
    align-items: flex-start; /* Align items at the top */
    box-sizing: border-box;
}

/* Side Navigation Block (Skills List) */
.side-nav-block {
    flex: 1;
    max-width: 30%; /* Keep the width at 30% */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Skill completion styles */
.side-nav ul {
    list-style-type: none;
    padding: 0;
}

.side-nav ul li {
    margin-bottom: 1em;
    display: flex;
    align-items: center;
}

.side-nav ul li a {
    text-decoration: none;
    color: #D32F2F;
    font-weight: bold;
    display: block;
    padding: 0.5em;
    border-radius: 5px;
    transition: background-color 0.3s;
    flex-grow: 1;
}

.side-nav ul li a:hover {
    background-color: #f2f2f2;
    color: #B71C1C;
}

.side-nav ul li.completed a {
    color: #4caf50;
}

.side-nav ul li.completed .tick {
    display: inline-block;
    color: #4caf50;
    margin-left: 5px;
}

.side-nav ul li .tick {
    display: none;
}

/* Skill Content Block (Form Box) */
.skill-content-block {
    flex: 1;
    max-width: 65%; /* Take the rest of the space */
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.criteria {
    margin-bottom: 1em;
    padding: 1em;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.skill-content-block textarea,
.skill-content-block select {
    width: 100%;
    padding: 0.8em;
    margin-bottom: 1em;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1em;
    background-color: white;
}

/* ===========================
   Buttons Styles
=========================== */

/* Controls Inline - For buttons in the skillAssessment.php page */
.controls-inline,
.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
}

.controls-inline button,
.controls button {
    padding: 0.8em 1.5em;
    background-color: #D32F2F;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1em; 
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    margin: 0 1em;
}

.controls-inline button:hover,
.controls button:hover {
    background-color: #B71C1C;
}

/* ===========================
   Utility Classes
=========================== */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* ===========================
   Skill Assessment Page Styles
=========================== */

/* Isolated styles for Skills Assessment Page */

.skill-assessment .content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    flex-wrap: nowrap; /* Prevent the flex items from wrapping */
}

.skill-assessment .skill-nav {
    flex-basis: 30%;
    max-width: 250px; /* Maximum width for the skill navigation */
    min-width: 200px; /* Prevent shrinking too much */
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
}

.skill-assessment .skill-nav h3 {
    color: #D32F2F;
    text-align: center;
}

.skill-assessment .skill-nav ul {
    list-style-type: none;
    padding: 0;
}

.skill-assessment .skill-nav li {
    margin-bottom: 1em;
    display: flex;
    align-items: center;
}

.skill-assessment .skill-nav li a {
    text-decoration: none;
    color: #D32F2F;
    font-weight: bold;
    flex-grow: 1;
    padding: 0.5em;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.skill-assessment .skill-nav li a:hover {
    background-color: #f2f2f2;
    color: #B71C1C;
}

.skill-assessment .skill-nav li.completed a {
    color: #4caf50;
}

.skill-assessment .skill-nav li.completed .tick {
    display: inline-block;
    color: #4caf50;
    margin-left: 5px;
}

.skill-assessment .skill-form-wrapper {
    flex-grow: 1;
    max-width: calc(100% - 270px); /* Adjust the remaining space accounting for nav width and margin */
    display: flex;
    flex-direction: column;
}

.skill-assessment .skill-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.skill-assessment .skill-form h3 {
    color: #D32F2F;
}

.skill-assessment .form-select,
.skill-assessment .form-textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1em;
    background-color: white;
}

.skill-assessment .form-button {
    padding: 10px 20px;
    background-color: #D32F2F;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.skill-assessment .form-button:hover {
    background-color: #B71C1C;
}

.skill-assessment .controls-inline {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.skill-assessment .saved-skills {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.skill-assessment .saved-skills h3 {
    color: #D32F2F;
}

@media (max-width: 1000px) {
    .skill-assessment .skill-nav {
        display: none; /* Hide the skill-nav when the screen is too small */
    }

    .skill-assessment .content {
        max-width: 100%; /* Form and saved skills take up the full width */
        justify-content: center;
    }
}


/* ===========================
   Dropdown and Text Area Styles
=========================== */

/* Dropdown (Select) Styling */
.skill-assessment .form-select {
    width: 50%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #D32F2F;
    border-radius: 5px;
    background-color: white;
    color: #333;
    font-size: 1em;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s, box-shadow 0.3s;
    appearance: none;
    position: relative;
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px; /* Ensure padding leaves room for the arrow */
}

.skill-assessment .form-select::after {
    content: '▼'; /* Down arrow */
    font-size: 12px;
    color: #333;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Ensure the arrow is not interactive */
}

.skill-assessment .form-select:hover,
.skill-assessment .form-select:focus {
    border-color: #B71C1C; /* Darker red on hover and focus */
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.2); /* Stronger shadow */
    outline: none; /* Remove default outline */
}

/* Text Area Styling */
.skill-assessment .form-textarea {
    width: 90%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #D32F2F; /* Red border */
    border-radius: 5px;
    background-color: white;
    color: #333;
    font-size: 1em;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1); /* Inner shadow for depth */
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: vertical; /* Allow vertical resize only */
}

.skill-assessment .form-textarea:hover,
.skill-assessment .form-textarea:focus {
    border-color: #B71C1C; /* Darker red on hover and focus */
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.2); /* Stronger shadow */
    outline: none;
}

/* Dropdown Arrow Customization */
.skill-assessment .form-select {
    background-position: right 15px center; /* Adjust for padding */
    background-size: 12px;
    background-repeat: no-repeat;
}


/* Button Style */
.btn-assessment {
    display: inline-block;
    padding: 10px 20px;
    background-color: #D32F2F; /* Red background */
    color: white; /* White text */
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
}

.btn-assessment:hover {
    background-color: #B71C1C; /* Darker red on hover */
    color: white; /* Ensure text stays white on hover */
    cursor: pointer;
}



/* ===========================
   Skill Navigation (Assessment Page) Styles
=========================== */

/* Hide the tick initially */
.skill-assessment .skill-nav li .tick {
    display: none;
}

/* When the skill is completed, show the green tick */
.skill-assessment .skill-nav li.completed .tick {
    display: inline-block;
    color: #4caf50; /* Green tick */
    margin-left: 5px;
}




/* ===========================
   Form Styling
=========================== */

form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

form label {
    font-weight: bold;
    margin-bottom: 5px;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1em;
    box-sizing: border-box; /* Ensure padding and borders are inside the width */
}

form input[type="text"]:hover,
form input[type="email"]:hover,
form input[type="password"]:hover,
form select:hover,
form textarea:hover,
form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form select:focus,
form textarea:focus {
    border-color: #B71C1C; /* Darker red on hover and focus */
    border: 1px solid #D32F2F;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.2); /* Stronger shadow on hover/focus */
    outline: none; /* Remove the default outline on focus */
}
form select {
    background-color: white;
    border: 1px solid #D32F2F;
    color: #333;
    appearance: none;
   
    background-repeat: no-repeat;
    background-position: right 10px center;
}

form input:focus,
form select:focus {
    border-color: #B71C1C;
    border: 1px solid #D32F2F;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.2); /* Stronger shadow on hover/focus */
    outline: none;
}

/* Form styling for the set_targets.php page */
form select, form input[type="number"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

/* ===========================
   Button Styling
=========================== */

form button {
    padding: 10px 20px;
    background-color: #D32F2F;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

form button:hover {
    background-color: #B71C1C;
}

/* ===========================
   Table Styling
=========================== */

.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1em;
}

.styled-table thead tr {
    background-color: #f4f4f4;
    text-align: left;
}

.styled-table th, 
.styled-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.styled-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.styled-table tbody tr:hover {
    background-color: #f1f1f1;
}

.styled-table th {
    background-color: #D32F2F;
    color: white;
}





.assessment-section {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

.assessment-section h3 {
    color: #343a40;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.assessment-section p {
    font-size: 1.1em;
    color: #495057;
}

.btn-assessment {
    display: inline-block;
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
    margin-top: 15px;
    text-align: center;
}

.btn-assessment:hover {
    background-color: #218838;
}

.alert-message {
    background-color: #ffebee;
    color: #c62828;
    font-size: 0.9em;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
}
