/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    margin: 0;
}

h1 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
}

/* Navigation Styles */
nav {
    background-color: #333;
    padding: 10px;
    text-align: center;
    margin-bottom: 20px; /* Add space between nav and content */
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav a:hover {
    text-decoration: underline;
    color: #00b3ff; /* Light blue on hover for better visibility */
}

/* Updated Styles for Responsive Navigation */

/* Base navigation styles */
#navbar {
    position: relative;
}

#navbar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center; /* Center the list items horizontally */
}

#navbar ul li {
    margin-right: 15px;
}

#navbar ul li:last-child {
    margin-right: 0; /* Remove the margin from the last item */
}

#navbar ul li a {
    text-decoration: none;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
}

#navbar ul li a:hover {
    background-color: #555;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    #navbar ul {
        flex-direction: column;
        display: none; /* Hide the menu by default on smaller screens */
        width: 100%;
        background-color: #333;
        position: absolute;
        top: 50px;
        left: 0;
        z-index: 1;
    }

    #navbar ul li {
        margin: 0;
        width: 100%;
    }

    #navbar ul li a {
        padding: 12px;
        text-align: center;
        border-bottom: 1px solid #444;
    }

    #navbar ul li a:last-child {
        border-bottom: none;
    }

    #navbar .menu-icon {
        display: block;
        color: white;
        font-size: 24px;
        padding: 14px 16px;
        cursor: pointer;
        text-align: right;
    }
}

/* Display menu when toggled */
@media screen and (max-width: 768px) {
    #navbar ul.show {
        display: block;
    }
}

/* Form Container */
form {
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px solid #ddd; /* Added a subtle border for a better-defined form */
}

/* Labels */
label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #555;
}

/* Input, Select, Textarea, Button Styles */
input, select, textarea {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    color: #333;
    background-color: #f9f9f9;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Focus States */
input:focus, select:focus, textarea:focus {
    border-color: #007BFF;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
    outline: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
}

select[multiple] {
    height: auto;
}

select:focus {
    border-color: #007BFF;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
    outline: none;
}

/* Button Styles */
button,
.btn {
    width: auto;
    padding: 12px 20px;
    margin-top: 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* Button Hover */
button:hover {
    background-color: #0056b3;
}

/* Email Address Highlight */
#emailAddress p {
    color: #d9534f;
    font-weight: bold;
}

/* Link Styles */
a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s;
}

/* Form Section Titles */
form h2 {
    margin-top: 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#progress-container {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
}

#progress-bar {
    width: 0;
    height: 20px;
    background-color: #007BFF;
    text-align: center;
    line-height: 20px;
    color: white;
    border-radius: 5px;
}

/* Optional: Style for required fields */
input[required], select[required], textarea[required] {
    border-left: 3px solid #d9534f;
}

/* Optional: Subtle Shadow on focus */
input:focus, select:focus, textarea:focus {
    box-shadow: 0px 4px 6px rgba(0, 123, 255, 0.1);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden; /* Ensure rounded corners for table */
}

th, td {
    padding: 12px 15px;
    border: 1px solid #ddd; /* Subtle border around table cells */
    text-align: left;
}

th {
    background-color: #007BFF;
    color: #fff;
    font-weight: bold;
}

td {
    background-color: #f9f9f9;
}

/* Hover effect on table rows */
tr:hover td {
    background-color: #f1f1f1;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    grid-gap: 20px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

.dashboard-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-section h2 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
    text-align: center;
}

.dashboard canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    background-color: #fff;
    border-radius: 8px;
}

/* Grid Area Definitions */
.line-chart { grid-area: line-chart; }
.pie-chart { grid-area: pie-chart; }
.bar-chart { grid-area: bar-chart; }
.member-utilization { grid-area: member-utilization; }
.heatmap { grid-area: heatmap; }
.stacked-bar-chart { grid-area: stacked-bar-chart; }
.activity-word-cloud { grid-area: activity-word-cloud; }
.unit-word-cloud { grid-area: unit-word-cloud; }

/* Responsive Grid Layout */
@media (min-width: 1200px) {
    .dashboard {
        grid-template-areas: 
            "line-chart pie-chart bar-chart"
            "member-utilization heatmap stacked-bar-chart"
            "activity-word-cloud activity-word-cloud unit-word-cloud";
    }
}

@media (max-width: 1199px) {
    .dashboard {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "line-chart pie-chart"
            "bar-chart member-utilization"
            "heatmap stacked-bar-chart"
            "activity-word-cloud activity-word-cloud"
            "unit-word-cloud unit-word-cloud";
    }
}

@media (max-width: 767px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "line-chart"
            "pie-chart"
            "bar-chart"
            "member-utilization"
            "heatmap"
            "stacked-bar-chart"
            "activity-word-cloud"
            "unit-word-cloud";
    }
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    form {
        padding: 20px;
    }
    
    button {
        width: 100%;
    }

    table, th, td {
        display: block;
        width: 100%;
    }

    th {
        background-color: #007BFF;
        color: #fff;
    }

    td {
        background-color: #fff;
        border: none;
        border-bottom: 1px solid #ddd;
        position: relative;
        padding-left: 50%;
        text-align: left;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        white-space: nowrap;
        font-weight: bold;
        color: #333;
    }

    tr {
        margin-bottom: 15px;
    }

    th {
        cursor: pointer;
        position: relative;
        padding-right: 20px; /* Space for the indicator */
    }
    
    .sort-indicator {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.8em;
    }
}
