:root {
    --primary: #0066cc;
    --primary-light: #e6f0ff;
    --bg: #f9f9f9;
    --card-bg: #fff;
    --muted: #666;
    --success: #4CAF50;
    --danger: #F44336;
    --radius: 12px;
}

/* General Body and Font Styles */
html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background: #fff;
    color: #333;
    margin: 0;
    padding: 18px;
}

/* Calculator Wrapper - More compact layout */
.pcm-calculator-wrapper {
    max-width: 420px; /* More compact, adjusted from 400px to allow for some padding */
    margin: 12px auto;
    background: var(--bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

/* Unified Calculator Card */
.pcm-unified-calculator-card {
    background: var(--card-bg);
    padding: 20px; /* Adjusted */
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: grid;
    gap: 16px; /* Adjusted */
}

/* Card Title */
.pcm-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-align: center; /* Centered */
    margin: 0;
}

.pcm-description {
    font-size: 13px;
    color: #555;
    margin-top: 4px;
    text-align: center; /* Centered */
}

/* Main Tabs (Time Based / Output Based) */
.pcm-main-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.pcm-main-tab-button {
    flex: 1;
    background: #f0f0f0;
    border: 1px solid #e6e6e6;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pcm-main-tab-button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.12);
}
.pcm-main-tab-button:hover:not(.active) {
    background-color: #dcdcdc;
    color: #333;
}

/* Inner Tabs (Individual / Group) */
.pcm-tabs {
    display: flex;
    justify-content: center;
    margin-top: 6px;
    margin-bottom: 12px; /* Added */
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    gap: 8px;
}

.pcm-tab-button {
    background: #e6e6e6; /* Adjusted */
    color: #555; /* Adjusted */
    border: none; /* Adjusted */
    padding: 8px 15px; /* Adjusted */
    border-radius: 6px; /* Adjusted */
    font-size: 14px;
    cursor: pointer;
    font-weight: 500; /* Adjusted */
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-grow: 1;
    max-width: 120px;
}

.pcm-tab-button:hover {
    background-color: #dcdcdc;
    color: #333;
}
.pcm-tab-button.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
    border: none;
}

/* Input Grid and Fields */
.pcm-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    align-items: end;
}

.pcm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label.pcm-label {
    font-size: 13px;
    color: #444;
}

input.pcm-input,
select.pcm-input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    font-size: 14px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="time"].pcm-input {
    padding-right: 36px;
}

.time-input {
    position: relative;
}

.time-input .clock-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--primary);
}

input.pcm-input:focus,
select.pcm-input:focus {
    box-shadow: 0 6px 18px rgba(0, 102, 204, 0.08);
    border-color: var(--primary);
}

/* Button Group */
.pcm-button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 8px;
    justify-content: flex-start;
}

.pcm-button {
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.pcm-button-primary {
    background: var(--primary);
    color: #fff;
}
.pcm-button-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 102, 204, 0.2);
}

.pcm-button-secondary {
    background: #fff;
    border: 1px solid #e6e6e6;
    color: #333;
}
.pcm-button-secondary:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.muted-sm {
    font-size: 12px;
    color: #777;
}

.error-inline {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

/* Member Card for Group Calculator */
.member-card {
    border: 1px solid #ececec;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
    background: #fff;
}
.member-card h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 15px;
}


/* Results Block */
.pcm-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #fbfbfb;
    border-radius: 10px;
    min-height: 120px;
}

.pcm-percentage-display {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 2.8em;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
    margin: 0;
}

#pcm-productivity-percentage {
    line-height: 1;
}

.pcm-status-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    display: none;
    white-space: nowrap;
}

.pcm-status-badge.efficient {
    background: var(--success);
}

.pcm-status-badge.needs-improvement {
    background: var(--danger);
}
/* New status for neutral calculations/goals */
.pcm-status-badge.info {
    background: #607d8b; /* A neutral, informative color */
    color: #fff;
}


.pcm-summary-text {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-top: 6px;
    line-height: 1.4;
}

/* Chart */
.pcm-chart-wrap {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 6px auto;
}

canvas#pcm-productivity-chart {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Team Member Results List */
.pcm-team-results {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    width: 100%;
}
.pcm-team-results h4 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 16px;
}
#group-member-productivity-list {
    list-style: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
    margin: 0;
}
#group-member-productivity-list li {
    background: var(--primary-light);
    padding: 7px 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #333;
}
#group-member-productivity-list li span {
    font-weight: 600;
    color: #0056b3;
}


/* Radio Group Styling */
.pcm-radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.pcm-radio-group input[type="radio"] {
    margin-right: 5px;
}
.pcm-radio-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    .pcm-calculator-wrapper {
        max-width: 95%;
        margin: 15px auto;
        padding: 10px;
    }
    .pcm-unified-calculator-card {
        padding: 15px;
        gap: 12px;
    }
    .pcm-card-title {
        font-size: 18px;
    }

    .pcm-input-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    label.pcm-label {
        font-size: 12px;
    }
    input.pcm-input,
    select.pcm-input {
        padding: 8px;
        font-size: 13px;
    }

    .pcm-button-group {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 10px;
    }
    .pcm-button {
        padding: 8px 10px;
        font-size: 14px;
    }

    .pcm-results {
        padding: 10px;
    }
    .pcm-percentage-display {
        font-size: 2.5em;
        gap: 6px;
    }
    .pcm-chart-wrap {
        width: 100px;
        height: 100px;
    }
    .pcm-summary-text {
        font-size: 13px;
    }
    #group-member-productivity-list {
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .pcm-button-group {
        grid-template-columns: 1fr;
    }
    .pcm-radio-group {
        flex-direction: column;
        gap: 8px;
    }
}
