:root {
    /* Modern Health Palette - Clean, Trustworthy, Premium */
    --primary: #2563EB;
    /* Royal Blue */
    --primary-light: #EFF6FF;
    --secondary: #10B981;
    /* Success Green */
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --bg-page: #F3F4F6;
    --bg-card: #FFFFFF;
    --danger: #EF4444;
    --warning: #F59E0B;

    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -5px rgba(37, 99, 235, 0.1);
    --radius: 16px;
}

body {
    background: transparent;
    /* Let WP theme handle bg, but our component is self-contained */
}

.wpkc-wrapper {
    font-family: 'Outfit', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 850px;
    margin: 40px auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    color: var(--text-dark);
    border: 1px solid #E5E7EB;
}

/* Header */
.wpkc-header {
    background: white;
    padding: 40px 30px;
    text-align: center;
    border-bottom: 1px solid #F3F4F6;
}

.wpkc-header h2 {
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.wpkc-header p {
    color: var(--text-gray);
    font-size: 16px;
    margin: 0;
}

.wpkc-container {
    padding: 40px;
}

/* Sections */
.wpkc-section {
    margin-bottom: 40px;
}

.wpkc-label-title {
    display: flex;
    align-items: center;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.wpkc-label-title i {
    color: var(--primary);
    margin-right: 8px;
    font-size: 16px;
}

/* Custom Radio Groups (Pills) */
.wpkc-toggle-group {
    background: var(--bg-page);
    padding: 5px;
    border-radius: 12px;
    display: flex;
    gap: 5px;
}

.wpkc-toggle-group input {
    display: none;
}

.wpkc-toggle-group label {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-gray);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wpkc-toggle-group label:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.wpkc-toggle-group input:checked+label {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Activity Grid - The Fix */
.wpkc-activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.wpkc-activity-grid input {
    display: none;
}

.wpkc-activity-card {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    min-height: 120px;
}

.wpkc-activity-card:hover {
    border-color: #BFDBFE;
    transform: translateY(-2px);
}

.wpkc-activity-card i {
    font-size: 24px;
    color: #9CA3AF;
    transition: color 0.2s;
}

.wpkc-activity-card span {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
}

.wpkc-activity-card small {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.2;
}

/* Selected Activity */
.wpkc-activity-grid input:checked+.wpkc-activity-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.wpkc-activity-grid input:checked+.wpkc-activity-card i {
    color: var(--primary);
}

.wpkc-activity-grid input:checked+.wpkc-activity-card span {
    color: var(--primary);
}

/* Inputs */
.wpkc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media(max-width:600px) {
    .wpkc-grid-2 {
        grid-template-columns: 1fr;
    }
}

.wpkc-input-group label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
    color: var(--text-dark);
}

.wpkc-input-group input,
.wpkc-select {
    width: 100%;
    padding: 14px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-page);
    transition: all 0.2s;
    box-sizing: border-box;
}

.wpkc-input-group input:focus,
.wpkc-select:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Slider */
.wpkc-range {
    width: 100%;
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin: 20px 0;
}

.wpkc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
    border: 3px solid white;
}

.wpkc-range-value {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

/* Button */
.wpkc-btn-primary {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wpkc-btn-primary:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.5);
}

/* RESULTS AREA - The big change */
.wpkc-results {
    background: #FAFAFA;
    border-top: 1px solid #E5E7EB;
    padding: 50px 40px;
}

.wpkc-results h3 {
    text-align: center;
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 40px;
}

.wpkc-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}

@media(max-width: 768px) {
    .wpkc-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Stats & Charts */
.wpkc-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.wpkc-stat-box {
    background: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #E5E7EB;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wpkc-stat-box:hover {
    transform: translateY(-3px);
    border-color: #BFDBFE;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
}

.wpkc-stat-box h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpkc-stat-box h4 i {
    color: var(--primary);
    background: var(--primary-light);
    padding: 8px;
    border-radius: 50%;
    font-size: 14px;
}

.wpkc-big-stat {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 5px;
}

.wpkc-stat-desc {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
    /* Green for positive status feeling */
    background: #ECFDF5;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.wpkc-result-card {
    background: white;
    padding: 25px 15px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #F3F4F6;
}

.wpkc-result-card.wpkc-highlight {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    border: none;
    transform: scale(1.05);
}

.wpkc-result-card.wpkc-highlight .wpkc-res-label {
    color: rgba(255, 255, 255, 0.8);
}

.wpkc-result-card.wpkc-highlight .wpkc-res-value {
    color: white;
}

.wpkc-result-card.wpkc-highlight .wpkc-res-unit {
    color: rgba(255, 255, 255, 0.6);
}

.wpkc-res-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9CA3AF;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.wpkc-res-value {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.wpkc-res-unit {
    font-size: 13px;
    color: #9CA3AF;
}

/* EXPLANATION BOX - AS REQUESTED */
.wpkc-result-explanation {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-left: 6px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.wpkc-result-explanation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.wpkc-result-explanation h4 {
    margin-top: 0;
    font-size: 18px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpkc-result-explanation p {
    font-size: 16px;
    line-height: 1.6;
    color: #4B5563;
    margin-bottom: 20px;
}

.wpkc-explanation-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media(max-width: 650px) {
    .wpkc-explanation-list {
        grid-template-columns: 1fr;
    }
}

.wpkc-exp-item {
    background: #F9FAFB;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    text-align: center;
}

.wpkc-exp-item strong {
    display: block;
    font-size: 20px;
    color: var(--text-dark);
    margin: 5px 0;
}

.wpkc-exp-item span {
    font-size: 13px;
    color: var(--text-gray);
}

.wpkc-exp-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

/* Green for Fats (Healthy), Blue for Protein, Orange for Carbs */
.icon-fats {
    background: #ECFDF5;
    color: #10B981;
}

.icon-protein {
    background: #EFF6FF;
    color: #2563EB;
}

.icon-carbs {
    background: #FFF7ED;
    color: #F97316;
}

/* History Section */
.wpkc-history-section {
    margin-top: 50px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
}

.wpkc-history-section h4 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 20px;
    color: var(--text-dark);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.wpkc-history-section h4 i {
    color: var(--primary);
}

.wpkc-btn-secondary {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.wpkc-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.5);
}

.wpkc-btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* History Table Styles */
.wpkc-history-list-wrapper {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #F3F4F6;
}

.wpkc-history-list-wrapper h5 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpkc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.wpkc-table thead th {
    background: #F9FAFB;
    padding: 12px;
    border-bottom: 2px solid #E5E7EB;
    color: var(--text-gray);
    font-weight: 700;
}

.wpkc-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #F3F4F6;
    color: var(--text-dark);
}

.wpkc-table tbody tr:last-child td {
    border-bottom: none;
}

.wpkc-table tbody tr:hover {
    background: #F9FAFB;
}

.wpkc-no-data {
    text-align: center;
    color: #9CA3AF;
    font-style: italic;
    background: #F9FAFB;
    padding: 20px;
    border-radius: 8px;
}

/* Disclaimer */
.wpkc-disclaimer {
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #E5E7EB;
}