/* General body styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7fc;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Header styles */
header {
    background-color: #B12459;
    color: #fff;
    display: flex;
    align-items: center; /* Align items vertically */
    justify-content: space-between; /* Space between logo and right section */
    padding: 10px 20px;
    box-sizing: border-box;
    flex-wrap: wrap; /* Allow items to wrap */
    z-index: 10; /* Ensure the header stays on top of the sidebar */
    position: fixed; /* Make header fixed to the top */
    top: 0; /* Position it at the top */
    left: 0; /* Make sure it starts at the left edge */
    width: 100%; /* Ensure it spans the entire width */
    padding-top: 10px; /* Adjust padding to compensate for fixed position */
}

/* Logo section */
.logo {
    flex: 0 0 auto; /* Keep logo fixed on the left */
}

.logo img {
    height: 50px;
}

/* User details and logout button */
.nav-right {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: flex-end; /* Align to the right */
    gap: 5px; /* Space between user info and logout button */
}

/* User info section */
.user-info {
    display: flex;
    flex-direction: column; /* Stack welcome message and role vertically */
    align-items: flex-end; /* Align text to the right */
}

.welcome-message {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}

.role {
    font-size: 12px;
    color: #ddd;
    margin: 0;
}

/* Logout button */
.logout-button {
    background-color: #fff;
    color: #B12459;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
}

.logout-button:hover {
    background-color: #B12459;
    color: #fff;
}

/* Footer styles */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 10px;
    z-index: 10; /* Ensure footer stays below sidebar */
}


/* Sidebar Styles */
.sidebar {
    height: 100vh;
    width: 250px;
    position: fixed;
    top: 60px; /* Push below the header */
    left: -250px; /* Initially hidden */
    background-color: #B12459;
    color: #fff;
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out; /* Smooth transitions */
    z-index: 9; /* Ensure it sits below the header */
}

/* Sidebar when open */
.sidebar.open {
    left: 0;
    width: 80%;
}

/* Sidebar Content */
.sidebar ul {
    list-style-type: none;
    padding: 0;
    cursor: pointer; 
}

.menu-header {
    font-size: 16px;
    font-weight: bold;
    margin: 20px 0 10px;
}

.submenu li {
    margin: 10px 0;
    cursor: pointer; 
}

/* Close button (rotates when sidebar toggles) */
.close-btn {
    background-color: #B12459;
    color: #fff;
    font-size: 18px;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 11; /* Ensure above sidebar content */
    transition: transform 0.3s ease-in-out; /* Smooth rotation */
}

/* Rotation for the close button */
.close-btn.rotate {
    transform: rotate(90deg); /* Rotate 90 degrees */
}

.close-btn:hover {
    background-color: #fff;
    color: #B12459;
}

/* Main Content Area */
.main-content {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    justify-content: center;
}

/* Collapsible Button */
.open-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #B12459;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 11; /* Ensure it's above the header */
}

.open-btn:hover {
    background-color: #fff;
    color: #B12459;
}

/* Responsive - Mobile view */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .main-content {
        margin-left: 60px;
        margin-top: 100px;
        margin-bottom: 100px;
        margin-right: 5px;
    }

    .logo {
        flex: 1;
    }

    .nav-right {
        flex: 2; /* Give nav-right more space */
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Align content to the right */
        text-align: right;
        width: 100%;
    }

    .user-info {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
        width: 100%;
    }

    .welcome-message {
        display: flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap; /* Prevents breaking into two lines */
        font-size: 14px;
        width: 100%;
    }

    .status-indicator {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: green; /* Adjust status color */
    }

    .role {
        font-size: 12px;
        font-weight: bold;
    }

    .logout-button {
        width: auto;
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Small screen (mobile portrait) */
@media (max-width: 480px) {
    .nav-right {
        width: 100%;
        align-items: flex-end;
    }

    .welcome-message {
        font-size: 12px;
        width: auto;
    }

    .logout-button {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Dropdown Styling */
select {
    background-color: #fff;
    border: 2px solid #B12459;
    color: #333;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 12px;
    width: 100%; /* Make dropdowns full-width */
    box-sizing: border-box; /* Include padding and border in width */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #B12459; /* Border color stays the same */
    box-shadow: 0 0 5px rgba(178, 36, 89, 0.5); /* Add subtle focus shadow */
}

select option {
    padding: 8px;
    font-size: 14px;
}

/* Button Styling */
button {
    background-color: #B12459;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-block; /* Ensure button aligns well */
    margin-top: 10px; /* Give some space between button and content */
}

button:hover {
    background-color: #8d1a3d; /* Darken the button color on hover */
    transform: translateY(-2px); /* Subtle button lift effect */
}

button:active {
    transform: translateY(1px); /* Button presses down when clicked */
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Label Styling */
label {
    font-weight: bold;
    font-size: 12px;
    color: #ffffff;
    margin-bottom: 5px;
}

/* Submenu Styling for dropdowns and buttons */
.submenu-detail li {
    font-size: 12px;
    margin-bottom: 10px;
}

.submenu-detail li select,
.submenu-detail li button {
    width: 80%; /* Ensure form elements align properly */
    padding: 5px 8px;
}

/* Ensure there's space between elements */
.submenu-header {
    font-size: 14px;
    color: #ffffff;
    margin: 20px 0 10px;
}

/* Styling for date input fields */
ul.submenu-detail li input[type="date"] {
    width: 80%; /* Full width */
    padding: 6px; /* Inner padding for better usability */
    border: 1px solid #ccc; /* Light border */
    border-radius: 5px; /* Rounded corners */
    background-color: #f9f9f9; /* Slight background color */
    font-size: 12px; /* Font size */
    color: #333; /* Text color */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); /* Subtle inner shadow */
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Focus state for inputs */
ul.submenu-detail li input[type="date"]:focus {
    border-color: #007BFF; /* Blue border on focus */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Soft glow */
    outline: none; /* Remove default outline */
    background-color: #fff; /* Brighten background */
}

/* Add spacing between the date fields */
ul.submenu-detail li input[type="date"]:not(:last-child) {
    margin-bottom: 15px; /* Space below the first field */
}

.submenu-header a {
    font-size: 14px;
    color: #ffffff;
    margin: 20px 0 10px;
    text-decoration: none; /* Removes underline */
}

.main-content {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    justify-content: center;
}

/* Dashboard Container */
.dashboard-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Programme Box */
.programme-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 2fr; /* Two-column grid */
    grid-template-rows: auto auto auto; /* Stack rows on top of each other */
    gap: 15px;
    align-items: start;
    justify-content: space-between;
    text-align: left;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    margin-bottom: 15px;
}

/* Programme Name */
.programme-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 300px;
}

/* Status Summary (Offered, Confirmed, Complete in one row) */
.status-summary {
    display: flex;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

/* Total Sessions and Completed Below Programme Title */
.total-sessions {
    font-size: 16px;
    font-weight: 500;
    color: #7f8c8d;
    width: 250px;
}

/* Progress Percentage - Below the Status Summary */
.progress {
    font-size: 18px;
    font-weight: bold;
    color: #636363;
    text-align: left; /* Center progress below the status summary */
    margin-top: 10px; /* Slight space between status summary and progress */
}

/* Responsive Design */
@media (max-width: 768px) {
    .programme-box {
        grid-template-columns: 1fr; /* Stack elements on mobile */
        text-align: center;
        padding: 15px;
    }

    .total-sessions {
        text-align: left; /* Align total sessions to left */
    }

    .status-summary {
        justify-content: center;
        gap: 10px;
    }

    .progress {
        text-align: center; /* Center progress on mobile */
    }

    .programme-title {
        text-align: center;
        white-space: normal;
    }
}

.tooltip {
    position: relative;
    cursor: pointer;
    color: #555;
}

.school-list {
    margin-left: 5px;
    display: none;
    position: absolute;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    white-space: nowrap;
    font-size: 12px;
    list-style-type: none;
    padding-left: 5;
}

.tooltip:hover .school-list {
    display: block;
}

.school-list div {
    padding: 5px 0;
}

.progress-container {
    display: flex;
    align-items: center; /* Align items vertically */
    gap: 10px; /* Add space between the title and the progress */
    width: 250px;
}

.progress-title {
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.progress {
    font-size: 18px;
    font-weight: bold;
    color: #636363;
}

.dashboard-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px; /* Add space below the title */
    text-align: center;
}

.live-indicator {
    display: inline-block;
    width: 10px;  /* Adjust size */
    height: 10px; /* Adjust size */
    background-color: green;
    border-radius: 50%; /* Makes it a circle */
    margin-right: 8px; /* Spacing between circle and text */
    vertical-align: middle; /* Aligns with text */
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between bar and percentage */
}

.progress-bar {
    margin-top: 10px;
    width: 100px;  /* Adjust width as needed */
    height: 10px;
    background-color: #ff4d4d; /* Red for remaining */
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #4caf50; /* Green for completed */
    transition: width 0.5s ease-in-out;
}

.progress {
    font-size: 14px;
    font-weight: bold;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: rgb(0, 175, 0);
    border-radius: 50%;
    margin-right: 8px; /* Space between circle and text */
    box-shadow: 0 0 5px rgba(0, 128, 0, 0.8); /* Initial glow */
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 5px rgba(0, 128, 0, 0.8);
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
        box-shadow: 0 0 10px rgba(0, 128, 0, 1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 5px rgba(0, 128, 0, 0.8);
    }
}


.menu-header a {
    color: inherit; /* Inherit color from parent element (white in this case) */
    text-decoration: none; /* Remove the default underline */
}

/* Optional: Add hover effect to the link for better user experience */
.menu-header a:hover {
    color: white; /* Make sure the text stays white when hovered */
}

/* Styling for the glowing badge */
.badge-glow {
    background-color: #ffffff;
    color: black;
    font-weight: bold;
    border-radius: 12px;
    padding: 2px 8px;
    margin-left: 8px;
    font-size: 0.8rem;
    animation: glowPulse 1.5s infinite;
    box-shadow: 0 0 5px white, 0 0 10px white;
}

@keyframes glowPulse {
    0% { box-shadow: 0 0 5px white, 0 0 10px white; }
    50% { box-shadow: 0 0 10px white, 0 0 20px white; }
    100% { box-shadow: 0 0 5px white, 0 0 10px white; }
}

.mean-utilisation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 400px;
  }
  
  .rag-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: transparent;
    box-shadow: none;
    transition: all 0.3s ease;
  }
  
  .rag-dot.green {
    background-color: #4ac96a;
    box-shadow: 0 0 8px 2px rgba(74, 201, 106, 0.6);
  }
  
  .rag-dot.red {
    background-color: #c94a72;
    box-shadow: 0 0 8px 2px rgba(201, 74, 114, 0.6);
  }
  
  .rag-dot.blue {
    background-color: #2596be;
    box-shadow: 0 0 8px 2px rgba(37, 150, 190, 0.6);
  }
  
  .rag-dot.white {
    background-color: white;
    box-shadow: none;
  }


.trademark {
    font-size: 0.8em;  /* Slightly smaller size for the trademark */
    margin-left: 5px;  /* Space between text and TM symbol */
}

.popup {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); /* Slightly darker background for better contrast */
    z-index: 1000; 
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease; /* Smooth fade-in effect */
}

/* Popup content box */
.popup-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    max-width: 450px;
    width: 100%;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.1); /* Subtle shadow effect */
    transition: transform 0.3s ease-out;
}

/* Close button */
.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000000; /* Change to red on hover */
}

/* Popup message styling */
.popup p {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Optional: Add a badge or icon for the success message */
.popup p::before {
    content: "✔"; /* Checkmark symbol */
    font-size: 28px;
    margin-right: 10px;
    color: #2ecc71; /* Green color for success */
}

/* Add a fade-in effect when the popup shows */
.popup.show {
    opacity: 1;
    transform: scale(1.05); /* Slight scale-up effect on show */
}

/* Make the popup fade out when it closes */
.popup.hide {
    opacity: 0;
    transform: scale(0.95); /* Slight shrink effect on hide */
}