/* General Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 230px; /* Sidebar width */
    background-color: #2c3e50; /* Dark blue-grey */
    color: #ecf0f1; /* Light grey/off-white */
    padding: 0; /* Remove padding to allow header/nav to span full width */
    position: fixed; /* Fixed position */
    left: 0;
    top: 0;
    height: 100vh; /* Full viewport height */
    overflow-y: auto; /* Scroll if content exceeds height */
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000; /* Ensure sidebar stays on top */
}

.sidebar-header {
    padding: 20px 15px;
    text-align: center;
    background-color: #1a252f; /* Slightly darker for header */
}

.sidebar-header h2 {
    margin: 0;
    color: #ecf0f1;
    font-size: 1.5em;
    border-bottom: none; /* Remove general h2 border for sidebar header */
}

.sidebar-nav ul {
    list-style-type: none;
    padding: 15px 0; /* Padding around the links block */
    margin: 0;
}

.sidebar-nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    display: block; /* Make links take full width for clickability */
    padding: 12px 20px; /* Padding for links */
    border-radius: 0; /* No radius for sidebar items, or small if preferred */
    transition: background-color 0.3s ease, padding-left 0.3s ease;
    font-size: 1.05em;
    border-left: 3px solid transparent; /* For active/hover indicator */
}

.sidebar-nav ul li a:hover {
    background-color: #34495e; /* Slightly lighter dark blue for hover */
    padding-left: 25px; /* Indent on hover */
    border-left-color: #3498db; /* Blue indicator */
}

.sidebar-nav ul li a.active {
    background-color: #3498db; /* Bright blue for active link */
    color: #fff;
    font-weight: bold;
    border-left-color: #fff; /* White indicator for active */
}

/* Main Content Area */
.main-content {
    flex-grow: 1; /* Takes remaining space */
    padding: 20px;
    margin-left: 230px; /* Same as sidebar width */
    /* overflow-y: auto; --- Already on body, might not be needed here */
}

/* Main Content Sections */
section {
    padding: 25px;
    margin: 0 0 25px 0; /* Margin only at the bottom */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.07);
    /* max-width: 90%; --- Not needed if main-content controls width */
    overflow-x: auto; /* Ensures tables don't break layout on small screens */
}

/* Headings (adjustments for main content) */
h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5 {
    color: #2c3e50;
    margin-top: 0;
}

.main-content h2 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.main-content h3 {
    color: #34495e;
    margin-bottom: 20px;
}

/* Form Elements Styling (largely unchanged, but ensure they fit new layout) */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

select, input[type="number"], input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.4-5.4-13z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: .7em auto;
    padding-right: 2.8em;
}

/* Limit width for general inputs, but allow KPI form inputs to be wider if needed */
.main-content > section > select,
.main-content > section > input[type="number"],
.main-content > section > input[type="text"],
.main-content > section > textarea {
    max-width: 450px;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
    outline: none;
}

/* Buttons (padding and margin adjustments might be needed) */
button {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0px);
}

/* Specific Button Styles (colors remain, adjust if needed) */
#calculate-button,
#save-settings-button,
button[id^="save-all-kpis-for-role-"],
button[id^="kpi-form-"][id$="-save-button"] {
    background-color: #2ecc71;
}
#calculate-button:hover,
#save-settings-button:hover,
button[id^="save-all-kpis-for-role-"]:hover,
button[id^="kpi-form-"][id$="-save-button"]:hover {
    background-color: #27ae60;
}

button.delete-role-button,
button.delete-single-kpi-button {
    background-color: #e74c3c;
}
button.delete-role-button:hover,
button.delete-single-kpi-button:hover {
    background-color: #c0392b;
}

button[id^="cancel-kpi-edit-button"],
button[id^="back-to-role-list-button"] {
    background-color: #95a5a6;
}
button[id^="cancel-kpi-edit-button"]:hover,
button[id^="back-to-role-list-button"]:hover {
    background-color: #7f8c8d;
}

/* KPI Calculator Table Styling */
#kpi-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

#kpi-table-container th,
#kpi-table-container td {
    border: 1px solid #e0e0e0; /* Slightly softer borders */
    padding: 10px; /* Reduced padding */
    text-align: left;
    font-size: 0.9em; /* Reduced font size */
}

/* Specific styling for the Remarks column to handle potentially long text */
#kpi-table-container td:nth-child(2) { /* Assuming Remarks is the second column */
    /* max-width: 250px; /* Optional: Set a max-width */
    /* white-space: normal; /* Ensure text wraps */ 
    /* word-break: break-word; /* Break long words if necessary */
    /* Consider truncation with ellipsis and tooltip for very long content later */
}

#kpi-table-container th {
    background-color: #34495e;
    color: #ecf0f1;
    font-weight: 600; /* Semibold */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#kpi-table-container tbody tr:nth-child(even) {
    background-color: #f8f9fa; /* Lighter zebra striping */
}

#kpi-table-container tbody tr:hover {
    background-color: #e9ecef; /* Slightly darker hover for rows */
}

#kpi-table-container .actual-result {
    width: 110px;
    padding: 10px;
    margin-bottom: 0;
    text-align: right;
    font-weight: bold;
}

#kpi-table-container td {
    vertical-align: middle;
}

/* Styling for the new remarks row */
.kpi-remarks-row td.kpi-remarks-cell {
    padding: 10px 15px; /* Adjust padding as needed */
    background-color: #fdfdfd; /* A very light grey, or choose another subtle color */
    font-size: 0.82em; /* Further reduced font size for remarks */
    color: #777; /* Lighter grey for remarks text */
    border-bottom: 1px solid #e0e0e0; /* Bottom border for separation */
    /* If you have zebra striping, this explicit background might override it or look odd.
       Alternatively, make it transparent and just adjust text/padding.
       Or ensure it fits the zebra pattern if remarks row is considered for nth-child. */
}

.kpi-remarks-row td.kpi-remarks-cell strong {
    color: #333; /* Darker color for the "Remarks:" label */
}

/* Results Container Styling */
#results-container {
    margin-top: 30px;
    padding: 25px;
    background-color: #eaf6ff;
    border-left: 6px solid #3498db;
    border-radius: 6px;
}

#results-container h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

#results-container p {
    font-size: 1.15em;
    margin: 10px 0;
}

/* Settings Page Specifics (ensure consistency) */
#settings-section #setting-type-select,
#settings-section #settings-role-select {
    max-width: 450px;
    margin-bottom: 25px;
}

.kpi-settings-block {
    border: 1px solid #dadce0;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.band-edit-item input[type="number"] {
    width: 85px;
    margin-right: 8px;
}

/* Role Setup List Styling */
#existing-roles-list li {
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

#existing-roles-list li strong {
    font-size: 1.15em;
    color: #202124;
}

#existing-roles-list li .role-actions {
    margin-top: 12px;
}

/* KPI Add/Edit Form Field Styling (within Role Setup) */
.kpi-form-field {
    margin-bottom: 18px;
}

.kpi-form-field label {
    font-weight: 500; /* Medium weight */
    color: #3c4043;
}

.kpi-form-field input[type="text"],
.kpi-form-field input[type="number"],
.kpi-form-field textarea,
.kpi-form-field select {
    width: 100%;
    max-width: none; /* Let them fill their container in this specific form */
}

.kpi-form-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

/* Remove old top-nav specific styles if they existed */
/* nav (old top bar) and nav ul (old top bar) styles are implicitly replaced by .sidebar and .sidebar-nav ul */

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 100%; /* Full width for small screens */
        height: auto; /* Auto height */
        position: relative; /* Back to normal flow */
        box-shadow: none;
        z-index: auto;
    }
    .sidebar-header h2 {
        font-size: 1.2em;
    }
    .sidebar-nav ul {
        display: flex; /* Horizontal layout for links */
        flex-wrap: wrap; /* Allow wrapping */
        justify-content: center;
        padding: 10px 0;
    }
    .sidebar-nav ul li a {
        padding: 10px 12px;
        border-left: none; /* Remove side border */
        border-bottom: 2px solid transparent; /* For bottom active indicator */
        margin: 5px;
        border-radius: 4px; /* Add some radius back */
    }
    .sidebar-nav ul li a:hover {
        padding-left: 12px; /* Reset indent */
        border-left-color: transparent;
        background-color: #34495e;
        border-bottom-color: #3498db;
    }
    .sidebar-nav ul li a.active {
        border-left-color: transparent;
        border-bottom-color: #fff;
    }

    .main-content {
        margin-left: 0; /* No margin when sidebar is on top */
        padding: 15px;
    }
    section {
        max-width: 100%;
        padding: 20px;
    }
    input[type="number"], input[type="text"], textarea, select {
        max-width: 100%;
    }
    #kpi-table-container th,
    #kpi-table-container td {
        padding: 8px; /* Keep padding slightly smaller for mobile */
        font-size: 0.85em; /* Further reduce font size for mobile */
    }
    #kpi-table-container .actual-result {
        width: 90px;
    }
}

/* Orb Display Styles - Add to style.css */
.competency-category-constellation {
    position: relative; 
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid #4a4a6a; 
    border-radius: 8px;
    background-color: #2c2c3e; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.constellation-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Will be overridden by JS, but good default */
    height: 100%;/* Will be overridden by JS, but good default */
    z-index: 0; /* Lines BEHIND orbs */
    pointer-events: none; /* SVG doesn't interfere with mouse events on orbs */
}

.orbs-wrapper {
    position: relative; 
    z-index: 1;        
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; /* This centers orbs within the wrapper */
    gap: 20px; 
    padding-top: 10px; 
    /* max-width: 100%; /* Ensure it can take up space if needed */
}

.competency-orb {
    position: relative; /* Not strictly necessary if in .orbs-wrapper with z-index, but good practice */
    z-index: 1;         /* Reinforce orbs are on top */
    width: 85px;  
    height: 85px;
    background-image: radial-gradient(circle, #a7d1ff 0%, #4e95ff 40%, #0056b3 100%); 
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    box-shadow: 0 0 10px rgba(125, 249, 255, 0.5), 0 0 20px rgba(125, 249, 255, 0.3), inset 0 0 5px rgba(255,255,255,0.3);
    cursor: help; 
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 2px solid #7df9ff; 
    padding: 5px; 
    box-sizing: border-box; 
}

.competency-orb:hover {
    transform: scale(1.05); 
    box-shadow: 0 0 15px #7df9ff, 0 0 30px #7df9ff, 0 0 45px #adffff, inset 0 0 8px rgba(255,255,255,0.5);
}

.orb-level {
    font-size: 26px !important; 
    font-weight: bold !important;
    line-height: 1 !important;
    font-size: 26px !important; 
    font-weight: bold !important;
    line-height: 1 !important;
    color: #ffffff !important; /* Ensure text color is white for the dark orb */
}

.orb-name {
    font-size: 10px !important; 
    margin-top: 4px !important;
    word-break: break-word !important; 
    max-width: 90% !important;
    line-height: 1.1 !important; 
    font-size: 10px !important; 
    margin-top: 4px !important;
    word-break: break-word !important; 
    max-width: 90% !important;
    line-height: 1.1 !important; 
    color: #ffffff !important; /* Ensure text color is white */
}

/* Styling for the assessment form area below the orbs (if not already styled) */
#competency-assessment-form-area {
    background-color: #ffffff; 
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 20px; /* Ensure spacing from orbs if orbs are present */
}

.constellation-title {
    color: #F0F8FF; /* AliceBlue - a very light, almost white blue, good for glowing effects */
    font-weight: bold; 
    font-family: 'Arial Black', 'Impact', sans-serif; /* More impactful font */
    margin-top: 0;
    margin-bottom: 20px; 
    text-align: center;
    font-size: 1.7em; /* Slightly larger for more presence */
    padding-bottom: 10px; 
    /* --- Enhanced Text Shadow for a brighter, more defined glow --- */
    text-shadow: 
        0 0 5px rgba(200, 230, 255, 0.9), /* Inner, brighter, slightly blueish-white glow */
        0 0 10px rgba(125, 249, 255, 0.7), /* Existing cyan glow, slightly more opaque */
        0 0 15px rgba(125, 249, 255, 0.5); /* Wider, softer cyan glow */
    width: 100%; 
    box-sizing: border-box; 
    /* border-bottom: 1px solid #5a6a7a; /* Optional: A slightly lighter border if needed */
}

/* Login Screen Styles */
html, body {
    height: 100%;
    margin: 0;
}
  
#login-screen {
    background: url('https://i.imgur.com/FQeMgMd.png') no-repeat center center / cover;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
  }
  
  .login-container {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    gap: 20px;
  }

  #login-button {
    padding: 12px 25px;
    font-size: 1.1em;
    background-color: #4285F4; /* Google blue example */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#login-button:hover {
    background-color: #357ae8;
}
  