/* kinkkalc-styles.css v5.1.0 */
/* Updated for V5 Schema, Safeword IDs, and Comparator Matrix */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@700&family=Lato:wght@400;700&display=swap');

/* --- CSS Variables (Theming) --- */
:root {
    --kk-primary: #9370db;
    /* Medium Purple */
    --kk-secondary: #E5E7EB;
    /* Light Grey */
    --kk-success: #8fbc8f;
    /* Dark Sea Green */
    --kk-success-hover: #7aac7a;
    --kk-danger: #e62020;
    /* Red */
    --kk-danger-hover: #c81c1c;
    --kk-text: #333;
    --kk-border-radius: 8px;
    --kk-spacing: 15px;
    --kk-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body {
    -webkit-overflow-scrolling: touch !important;
    overflow: auto !important;
}

/* --- Containers & General Layout --- */
.form-section,
.results-output-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 25px;
    padding: 15px 20px;
}

/* --- Category Toggles (Pillbox Style) --- */
.kinkkalc-activities-widget #kk-category-toggles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

/* Inactive Filter Button Style */
.kinkkalc-activities-widget #kk-category-toggles-container button {
    background-color: #E5E7EB;
    /* Light Grey */
    border: 1px solid #D1D5DB;
    /* Slightly darker border for grey */
    color: #374151;
    /* Dark grey text */
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: normal;
    text-decoration: none;
    white-space: nowrap;
    line-height: normal;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Active Filter Button Style */
.kinkkalc-activities-widget #kk-category-toggles-container button.active {
    background-color: #9370db;
    /* Medium Purple */
    color: #fff;
    border-color: #9370db;
    /* Match background */
    font-weight: bold;
}

/* Hover for Inactive Filter Button */
.kinkkalc-activities-widget #kk-category-toggles-container button:not(.active):hover {
    background-color: #D1D5DB;
    /* Darken grey on hover */
    border-color: #9CA3AF;
    color: #1F2937;
}

/* --- Other KinkCalc Buttons (using specific IDs) --- */
/* --- Action Buttons (Refactored) --- */

/* Base Button Style */
.kk-btn,
#kk-load-from-code-button,
#kk-load-button,
#kk-generate-button,
#kk-generate-share-code-button,
#kk-save-button,
#kk-copy-share-code-button,
#kk-clear-account-button,
#kk-reset-form-button,
#kk-save-safeword-submit,
#kk-save-safeword-cancel {
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    font-size: 1em;
    margin: 5px;
    line-height: normal;
    text-decoration: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #fff;
}

/* Primary (Green) Buttons */
.kk-btn-primary,
#kk-load-from-code-button,
#kk-load-button,
#kk-generate-button,
#kk-generate-share-code-button,
#kk-save-button,
#kk-save-safeword-submit,
#kk-copy-share-code-button {
    background-color: var(--kk-success);
    border: 1px solid var(--kk-success-hover);
}

.kk-btn-primary:hover,
#kk-load-from-code-button:hover,
#kk-load-button:hover,
#kk-generate-button:hover,
#kk-generate-share-code-button:hover,
#kk-save-button:hover,
#kk-save-safeword-submit:hover,
#kk-copy-share-code-button:hover {
    background-color: var(--kk-success-hover);
    border-color: #689d68;
}

/* Danger (Red) Buttons */
.kk-btn-danger,
#kk-clear-account-button,
#kk-reset-form-button,
#kk-save-safeword-cancel {
    background-color: var(--kk-danger);
    border: 1px solid var(--kk-danger-hover);
}

.kk-btn-danger:hover,
#kk-clear-account-button:hover,
#kk-reset-form-button:hover,
#kk-save-safeword-cancel:hover {
    background-color: var(--kk-danger-hover);
    border-color: #ad1818;
}


/* --- Other Interactive Elements --- */
.results-output-container textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px;
    margin-top: 10px;
    resize: vertical;
}

.completion-percentage {
    border-radius: 8px;
    margin-bottom: 25px;
    padding: 10px 20px;
    text-align: left;
    font-size: 1em;
    font-weight: normal;
    color: #555;
}

/* --- Comparison, Activity & Note Styling --- */
.comparison-input-group {
    display: flex;
    gap: 20px;
}

.comparison-input-group input[type="text"] {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px;
}

.note-input,
.address-container input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* --- Slider & Voyeur Pill Layout --- */
.kk-slider-flex-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.kk-slider-container {
    flex-grow: 1;
}

/* Vibe Control Strings */
.kk-vibe-control-header {
    font-weight: bold;
    margin-bottom: 10px;
    cursor: pointer;
    color: var(--kk-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--kk-border-radius);
    border: 1px solid #eee;
}

.kk-vibe-container {
    background: #fff;
    padding: 15px;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 var(--kk-border-radius) var(--kk-border-radius);
    margin-bottom: 20px;
    display: none;
    /* Hidden by default */
}

.kk-vibe-container.open {
    display: block;
}

.kk-vibe-slider-wrapper {
    margin-bottom: 15px;
}

.kk-vibe-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.kk-vibe-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    padding: 0;
    margin: 0;
}

.kk-vibe-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--kk-success);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kk-vibe-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--kk-success);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}



/* --- Partner Indicator Styling --- */
/* .partner-indicator-a, .partner-indicator-b { ... } */

/* --- Results Page Styling --- */
.kk-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* --- Card Styles (Refactored) --- */
.kk-card,
.kk-person-card,
.kk-product-card,
.kk-participant-summ-card,
.form-section,
.results-output-container {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: var(--kk-border-radius);
    overflow: hidden;
    box-shadow: var(--kk-shadow);
    margin-bottom: 25px;
}

.kk-card-header {
    background-color: var(--kk-secondary);
    /* Refactored to use variable */
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.kk-card-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0;
}

.kk-progress-bar-container {
    width: 100px;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.kk-progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0;
    transition: width 0.5s ease-in-out;
}

.kk-card-body {
    padding: 15px 20px;
}

.kk-pagination {
    text-align: center;
    margin-top: 20px;
}

.kk-no-results {
    text-align: center;
    margin-top: 40px;
}

/* Skeleton Loading Styles */
.kk-skeleton-card {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    height: 200px;
    position: relative;
}

.kk-skeleton-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* --- PRINT STYLES --- */
@media print {
    body {
        background-color: white;
        color: black;
        font-family: sans-serif;
    }

    .kinkkalc-activities-widget,
    .kinkkalc-address-widget,
    .kinkkalc-manage-kinkkode-widget,
    .kinkkalc-submit-buttons-widget,
    #wpadminbar,
    .campaign-bar,
    .site-header {
        display: none !important;
    }

    /* Add other print-specific rules if needed */
}

/* --- Locked Form State --- */
#form-content-wrapper.locked {
    opacity: 0.2;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

/* --- Notification Styles --- */
#kk-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    width: 300px;
}

.kk-notification {
    background-color: #fff;
    color: var(--kk-text);
    border: 1px solid #ccc;
    border-radius: var(--kk-border-radius);
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
}

.kk-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.kk-notification.success {
    border-left: 5px solid #27ae60;
}

.kk-notification.error {
    border-left: 5px solid #c0392b;
}

.kk-notification.info {
    border-left: 5px solid #2980b9;
}

.kk-notification .kk-notification-close {
    float: right;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    color: #aaa;
}

.kk-notification .kk-notification-close:hover {
    color: #333;
}

/* --- Confirmation Dialog Styles --- */
#kk-confirmation-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

#kk-confirmation-dialog.show {
    display: flex;
}

.kk-confirmation-content {
    background-color: #fff;
    padding: 25px;
    border-radius: var(--kk-border-radius);
    text-align: center;
    box-shadow: var(--kk-shadow);
}

.kk-confirmation-buttons {
    margin-top: 20px;
}

/* Style confirmation buttons using general rules */
/* Confirmation Buttons - Explicit Styles */
#kk-confirmation-yes {
    background-color: #8fbc8f;
    /* Dark Sea Green */
    border: 1px solid #7aac7a;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

#kk-confirmation-yes:hover {
    background-color: #7aac7a;
}

#kk-confirmation-no {
    background-color: #e62020;
    /* Red */
    border: 1px solid #c81c1c;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

#kk-confirmation-no:hover {
    background-color: #c81c1c;
}

/* --- Spinner Animation --- */
.kk-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Tooltip Styles --- */
.kk-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
}

.kk-tooltip .kk-tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1010;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
}

.kk-tooltip:hover .kk-tooltip-text {
    visibility: visible;
    opacity: 1;
}

.kk-info-icon {
    display: none;
}

.hidden {
    display: none !important;
}

/* Use !important if needed to override */

/* --- Safeword Prompt Modal (V5 Updated IDs) --- */
.kk-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.kk-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border: 1px solid #ccc;
    width: 80%;
    max-width: 400px;
    border-radius: var(--kk-border-radius);
    box-shadow: var(--kk-shadow);
}

.kk-modal-buttons {
    margin-top: 15px;
    text-align: right;
}

/* Fixed V5 IDs for Modal Buttons */
#kk-save-safeword-submit {
    background-color: #8fbc8f;
    border: 1px solid #7aac7a;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

#kk-save-safeword-cancel {
    background-color: #e62020;
    border: 1px solid #c81c1c;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

#kk-save-safeword-submit:hover {
    background-color: #7aac7a;
}

#kk-save-safeword-cancel:hover {
    background-color: #c81c1c;
}


/* --- Suggested Products Widget --- */
#kk-suggested-products-container {
    margin-top: 40px;
}

.kk-suggested-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.kk-product-card {
    text-align: center;
}

.kk-product-card a {
    text-decoration: none;
    color: inherit;
}

.kk-product-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.kk-product-title {
    font-size: 1em;
    font-weight: 700;
    margin: 10px;
}

.kk-product-price {
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* --- Mobile-Specific Improvements --- */
@media (max-width: 768px) {

    /* Improve Readability and Tap Targets */
    .kinkkalc-activities-widget .activity-main label {
        font-size: 1.2em;
    }

    /* Increase specificity */
    input[type="range"].kk-activity-slider::-webkit-slider-thumb {
        height: 26px;
        width: 26px;
        margin-top: -10px;
    }

    input[type="range"].kk-activity-slider::-moz-range-thumb {
        height: 22px;
        width: 22px;
    }

    /* Ensure category toggles still wrap nicely on mobile */
    .kinkkalc-activities-widget #kk-category-toggles-container {
        /* Flex wrap is already global, maybe adjust gap if needed */
        gap: 8px;
    }

    .kinkkalc-activities-widget #kk-category-toggles-container button {
        padding: 4px 12px;
        font-size: 0.85em;
    }

    /* Make action buttons slightly smaller */
    #kk-load-from-code-button,
    #kk-load-button,
    #kk-clear-account-button,
    #kk-reset-form-button,
    #kk-generate-button,
    #kk-generate-share-code-button,
    #kk-save-button,
    #kk-copy-share-code-button {
        padding: 6px 12px;
        font-size: 0.9em;
        margin: 3px;
    }

    /* Stack load/manage buttons if needed */
    .kk-load-from-code-input-wrapper {
        display: flex;
        flex-wrap: wrap;
        /* Allow buttons to wrap */
        gap: 5px;
        /* Add gap between wrapped buttons */
    }

    .kk-load-from-code-input-wrapper input[type="text"] {
        flex-basis: 100%;
        /* Make input full width */
        margin-bottom: 10px;
    }
}

/* --- V6 PARITY OMISSIONS (Rig Desktop Grid) --- */
.kk-dashboard-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 20px;
}

.kk-dashboard-sidebar {
    background: #fff;
    padding: 10px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kk-card-title {
    font-size: 1.1em;
    font-weight: bold;
    border-bottom: 2px solid var(--kk-primary, #6244bb);
    /* Fallback color */
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* Ensure widgets that might appear alone have some bottom margin */
.kinkkalc-address-widget,
.kinkkalc-manage-kinkkode-widget,
.kinkkalc-activities-widget,
.kinkkalc-submit-buttons-widget {
    margin-bottom: 25px;
}

/* --- Comparator Page Styles --- */
.kk-person-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}


.kk-person-card {
    display: flex;
    flex-direction: column;
}

.kk-person-card .kk-card-header {
    /* Background and border handled by base .kk-card-header */
    gap: 10px;
    align-items: center;
}

.kk-person-name-input,
.kk-person-role-select {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
}

.kk-person-name-input {
    flex-grow: 1;
}

.kk-remove-person-button {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 5px;
}

.kk-remove-person-button:hover {
    color: #e62020;
}

.kk-person-card .kk-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.kk-kinkkode-input {
    width: 100%;
    flex-grow: 1;
    min-height: 100px;
    resize: vertical;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px;
    margin-bottom: 10px;
}

.kk-kinkkode-status {
    font-size: 0.9em;
    font-style: italic;
    min-height: 1.2em;
}

.kk-comparator-actions {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.kk-action-row-primary,
.kk-action-row-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.kk-comparator-button,
.kk-comparator-button-primary {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 1em;
    background-color: #E5E7EB;
    color: #374151;
    transition: all 0.2s ease-in-out;
}

.kk-comparator-button:hover {
    background-color: #D1D5DB;
}

.kk-comparator-button-primary {
    background-color: #8fbc8f;
    color: white;
    border-color: #7aac7a;
}

.kk-comparator-button-primary:hover {
    background-color: #7aac7a;
}

/* --- 1. SEGMENTED CONTROL (Anatomy/Role Pills) --- */

.kk-segmented-control {
    display: flex;
    /* Use a neutral base background for contrast */
    background: #f7f7f7;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #e5e5e5;
}

/* CRITICAL: HIDE THE NATIVE RADIO CIRCLE */
.kk-segmented-control input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Style the Label (The Pill) */
.kk-segment-option {
    flex: 1;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    color: #333;
    user-select: none;
    box-sizing: border-box;
    border: 1px solid transparent;
}

/* Selected State (The Active Pill - High Contrast) */
.kk-segment-option:has(input:checked) {
    background: #333333;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border-color: #333333;
    font-weight: bold;
}

/* --- 2. GLOBAL VOYEUR SWITCH (The Master Toggle) --- */

.kk-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.kk-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.kk-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.kk-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Color change when ON */
.kk-voyeur-group input:checked+.kk-slider {
    background-color: #9b59b6;
    /* Purple/Kink Color */
}

.kk-voyeur-group input:checked+.kk-slider:before {
    transform: translateX(26px);
}

#kk-compare-from-profile-button,
#kk-load-from-profile-button {
    margin: 5px;
}

#kk-compatibility-results-container {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
}

#kk-compatibility-results-container h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.kk-comparison-result {
    font-size: 1.2em;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.kk-comparison-result:last-child {
    border-bottom: none;
}

.kk-comparison-insight {
    font-size: 1.1em;
    font-style: italic;
    margin-bottom: 10px;
    color: #555;
}

/* --- Category Title Styles --- */
.kk-category-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #9370db;
    padding-bottom: 5px;
}

/* --- Kink Card Styles --- */
.kk-kink-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.kk-kink-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.kk-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.kk-card-title {
    font-size: 1.1em;
    font-weight: 700;
    margin: 0;
}

.kk-card-body {
    padding: 20px;
}

.kk-notes-container {
    margin-top: 15px;
}

.note-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.note-input:focus {
    outline: none;
    border-color: #9370db;
    background-color: #fff;
}

@media (max-width: 768px) {
    .kk-card-body {
        padding: 15px;
    }

    .kk-card-title {
        font-size: 1em;
    }

    input[type="range"].kk-activity-slider::-webkit-slider-thumb {
        height: 24px;
        width: 24px;
        margin-top: -8px;
    }

    input[type="range"].kk-activity-slider::-moz-range-thumb {
        height: 20px;
        width: 20px;
    }
}

.kk-category-scores-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.kk-category-score-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.kk-category-score-label {
    width: 150px;
    font-weight: bold;
}

.kk-category-score-bar-container {
    flex-grow: 1;
    height: 20px;
    background-color: #eee;
    border-radius: 5px;
    margin: 0 10px;
}

.kk-category-score-bar {
    height: 100%;
    background-color: #9370db;
    /* Medium Purple */
    border-radius: 5px;
}

.kk-category-score-value {
    width: 50px;
    text-align: right;
    font-weight: bold;
}

/* --- Diverging Bar Chart Styles --- */
.kk-diverging-bar-chart-container {
    margin-top: 20px;
    margin-bottom: 20px;
    font-family: 'Lato', sans-serif;
}

.kk-diverging-bar-chart-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 0 5px;
}

.kk-person-a-label {
    text-align: left;
    flex-grow: 1;
    color: #3498db;
    /* Example color for Person A */
}

.kk-person-b-label {
    text-align: right;
    flex-grow: 1;
    color: #e74c3c;
    /* Example color for Person B */
}

.kk-diverging-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 5px;
    /* Space between bars and label */
}

.kk-diverging-bar-row .kk-bar-personA,
.kk-diverging-bar-row .kk-bar-personB {
    height: 20px;
    background-color: #3498db;
    /* Default color for Person A */
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align text to the right for Person A's bar */
    color: white;
    font-size: 0.8em;
    padding-right: 5px;
    min-width: 20px;
    /* Ensure bar is visible even for small values */
    box-sizing: border-box;
    /* Include padding in width calculation */
}

.kk-diverging-bar-row .kk-bar-personB {
    background-color: #e74c3c;
    /* Default color for Person B */
    justify-content: flex-start;
    /* Align text to the left for Person B's bar */
    padding-left: 5px;
    padding-right: 0;
}

.kk-diverging-bar-row .kk-bar-label {
    flex-shrink: 0;
    /* Prevent label from shrinking */
    width: 150px;
    /* Fixed width for the label */
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    color: #333;
}

/* Adjust flex order for diverging effect */
.kk-diverging-bar-row .kk-bar-personA {
    order: 1;
    flex-direction: row-reverse;
    /* Reverse content for left bar */
}

.kk-diverging-bar-row .kk-bar-label {
    order: 2;
}

.kk-diverging-bar-row .kk-bar-personB {
    order: 3;
}

/* Ensure bars grow correctly */
.kk-diverging-bar-row .kk-bar-personA,
.kk-diverging-bar-row .kk-bar-personB {
    flex-grow: 1;
    max-width: 50%;
    /* Limit individual bar width to half of the available space */
}

/* For the default bar chart, which is now also using kk-diverging-bar-chart-container */
.kk-diverging-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.kk-diverging-bar-chart .kk-diverging-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kk-diverging-bar-chart .kk-bar-label {
    flex-shrink: 0;
    width: 150px;
    text-align: left;
}

.kk-diverging-bar-chart .kk-bar-container {
    flex-grow: 1;
    height: 20px;
    background-color: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.kk-diverging-bar-chart .kk-bar-personA {
    /* Reusing for the single bar */
    background-color: #9370db;
    justify-content: flex-end;
    padding-right: 5px;
    height: 100%;
    width: 0;
    /* Will be set by JS */
    transition: width 0.5s ease-in-out;
}

.kk-diverging-bar-chart .kk-bar-value {
    flex-shrink: 0;
    width: 30px;
    text-align: right;
    font-size: 0.9em;
    font-weight: bold;
}

/* Hide share button by default */
.kk-share-button {
    display: none;
}

/* Show share button only on mobile */
@media (max-width: 768px) {
    .kk-share-button {
        display: inline-block;
        /* Or block, depending on desired layout */
    }
}

/* General styling for the share button */
#kk-share-button {
    background-color: #28a745;
    /* Green */
    border: 1px solid #218838;
    /* Darker green border */
    color: #fff;
    /* White text for contrast */
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    font-size: 1em;
    margin: 5px;
    line-height: normal;
    text-decoration: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#kk-share-button:hover {
    background-color: #218838;
    /* Darken green on hover */
    border-color: #1e7e34;
    color: #fff;
}

/* --- Kink Scene Widget Styling --- */
.kinkkalc-kink-scene-widget {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 25px;
}

.kinkkalc-kink-scene-widget .widget-title {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.kinkkalc-kink-scene-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.kinkkalc-kink-scene-input label {
    font-weight: bold;
    white-space: nowrap;
}

.kinkkalc-kink-scene-input input[type="text"] {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#kinkkalc-kink-scene-container {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
}

#kinkkalc-kink-scene-container h3 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
}

#kinkkalc-kink-scene-container h4 {
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

#kinkkalc-kink-scene-container p {
    line-height: 1.6;
    margin-bottom: 10px;
}

#kinkkalc-kink-scene-container ul {
    list-style: none;
    padding-left: 0;
}

#kinkkalc-kink-scene-container ul li {
    margin-bottom: 5px;
    padding-left: 15px;
    position: relative;
}

#kinkkalc-kink-scene-container ul li::before {
    content: "•";
    color: #9370db;
    /* Accent color */
    position: absolute;
    left: 0;
}

#kinkkalc-kink-scene-container .error {
    color: #c0392b;
    font-weight: bold;
}

/* --- Elementor Compatibility Fix --- */
@media (max-width: 768px) {

    html,
    body,
    .elementor-section,
    .elementor-container,
    .elementor-widget-wrap {
        overflow: visible !important;
        height: auto !important;
    }
}

/* Ensure the pill and slider are inline */
.kk-slider-flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* CRITICAL: Force hide the base checkbox input */
.kk-voyeur-pill-container input[type="checkbox"] {
    display: none !important;
    position: absolute;
}

/* Style the Label as a clean pill button */
.kk-pill-label {
    background-color: #e0e0e0;
    color: #555;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
    border: 1px solid #ccc;
}

/* Checked State - Purple */
.kk-voyeur-pill-container input[type="checkbox"]:checked+.kk-pill-label {
    background-color: #9b59b6;
    color: white;
    border-color: #9b59b6;
}

/* ============================================
   V5 COMPARATOR MATRIX & ENGINE STYLES
   ============================================ */

/* --- Traffic Light Matrix Table --- */
.kk-matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kk-matrix-table th,
.kk-matrix-table td {
    border: 1px solid #ddd;
    padding: 6px 15px;
    /* ADJUSTED: Reduced vertical padding from 12px to 6px */
    text-align: center;
    vertical-align: middle;
}

.kk-matrix-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
}

/* --- Traffic Light Cell States --- */
.kk-matrix-cell-green {
    background-color: #d4edda;
    color: #155724;
    font-weight: bold;
}

.kk-matrix-cell-yellow {
    background-color: #fff3cd;
    color: #856404;
    font-style: italic;
}

.kk-matrix-cell-red {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: bold;
}

/* --- Role Icons (V5 Logic) --- */
/* These classes are toggled by the Comparator Engine */
.kk-role-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-right: 5px;
}

/* --- Activity Column Styling --- */
.kk-activity-col {
    text-align: left !important;
    font-weight: 500;
}

/* Unicode Fallbacks if images fail to load */
.kk-icon-whip::before {
    content: "🪢";
}

/* Top/Dom */
.kk-icon-cuffs::before {
    content: "🔗";
}

/* Bottom/Sub */
.kk-icon-shuffle::before {
    content: "🔄";
}

/* Switch */
.kk-icon-lightning::before {
    content: "⚡";
}

/* Mutual */

/* --- Activity Column Styling (Fix) --- */
.kk-activity-col {
    text-align: left !important;
    font-weight: 500;
}

/* --- Note Discoverability Prompt (High Contrast Fix) --- */
.kk-note-prompt {
    display: block;
    font-size: 0.85em;
    font-style: italic;
    color: #444;
    /* Dark grey for high contrast/readability */
    margin-top: 3px;
}

/* --- Matrix Cell Styling for Click Area --- */
.kk-matrix-cell {
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* --- Final UX: Results Container Transition --- */
#kk-compatibility-results-container {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    padding: 0 5px;
    /* Final alignment fix for content */
}

#kk-compatibility-results-container.show-results {
    opacity: 1;
}

/* Align the row perfectly */
.kk-slider-flex-row {
    display: flex;
    align-items: center;
    /* Vertical Center */
    gap: 10px;
    width: 100%;
}

/* Slider takes all available width */
.kk-slider-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* Icons/Toggles take fixed width */
.kk-action-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    /* Prevent squishing */
}

/* Note Toggle Button */
.kk-note-toggle {
    cursor: pointer;
    opacity: 0.5;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.kk-note-toggle.active {
    opacity: 1;
    color: #2196F3;
}

.kk-input-label {
    font-weight: bold;
}

/* --- Vertical Icon Alignment Fix (v5.1.1) --- */

/* Table Cell - Force Vertical Center */
.kk-matrix-cell {
    vertical-align: middle !important;
    text-align: center;
    height: 100%;
}

/* Icon Wrapper - The Emoji Tamer */
.kk-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    /* Fixed target size */
    height: 30px;
    /* Fixed target size */
    line-height: 1;
    /* Kill text line-height interference */
    font-size: 1.2rem;
    /* Consistent size */
}

/* --- Scene Generator Layout --- */
#kinkkalc-generated-scene-output table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    /* Enforce column widths */
}

/* Category Headers */
.kk-category-header td {
    background-color: #f4f4f4;
    color: #333;
    font-weight: 800;
    text-transform: uppercase;
    padding: 12px 15px;
    letter-spacing: 1px;
    font-size: 0.9em;
}

/* Columns */
#kinkkalc-generated-scene-output th:nth-child(1),
#kinkkalc-generated-scene-output td:nth-child(1) {
    width: 30%;
    vertical-align: top;
    padding: 15px;
}

/* Activity Name */
#kinkkalc-generated-scene-output th:nth-child(2),
#kinkkalc-generated-scene-output td:nth-child(2) {
    width: 60%;
    vertical-align: top;
    padding: 10px;
}

/* Narrative/Notes */
#kinkkalc-generated-scene-output th:nth-child(3),
#kinkkalc-generated-scene-output td:nth-child(3) {
    width: 10%;
    vertical-align: top;
    text-align: center;
    padding: 15px;
}

/* Action */

/* Clean Textarea for Notes */
.kk-generator-note {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    line-height: 1.5;
    border: 1px solid #eee;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95em;
    background: #fafafa;
    transition: all 0.2s;
}

.kk-generator-note:focus {
    background: #fff;
    border-color: #00aec7;
    outline: none;
}

/* Fix "Cylon" Buttons */
#kinkkalc-generated-scene-output .kk-remove-btn {
    width: auto !important;
    background: transparent !important;
    border: none !important;
    font-size: 1.4em;
    color: #ccc;
    cursor: pointer;
    padding: 0 10px;
    box-shadow: none !important;
}

#kinkkalc-generated-scene-output .kk-remove-btn:hover {
    color: #d6004f;
    /* Pink warning */
    transform: scale(1.1);
}

/* Risk Level Semantic Classes */
.kk-risk-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
}

.kk-risk-level-0 {
    background-color: #4CAF50;
}

.kk-risk-level-1 {
    background-color: #8BC34A;
}

.kk-risk-level-2 {
    background-color: #FFEB3B;
    color: #333;
}

.kk-risk-level-3 {
    background-color: #FFC107;
    color: #333;
}

.kk-risk-level-4 {
    background-color: #FF9800;
}

.kk-risk-level-5 {
    background-color: #F44336;
}

/* --- Participant Summary Cards (Generator) --- */
.kk-participant-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}


.kk-participant-summ-card {
    min-width: 150px;
    text-align: center;
}

.kk-summ-header {
    background-color: #f4f4f4;
    padding: 8px 10px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
    color: #333;
}

.kk-summ-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.kk-summ-role-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

.kk-summ-role-badge.dom {
    background-color: #c0392b;
}

/* Red */
.kk-summ-role-badge.sub {
    background-color: #2980b9;
}

/* Blue */
.kk-summ-role-badge.switch {
    background-color: #8e44ad;
}

/* Purple */

.kk-summ-anatomy {
    font-size: 0.85em;
    color: #555;
    margin-top: 5px;
}

/* --- Kink Generator Dashboard (Extracted from Test Rig) --- */  /* Dashboard Grid Layout (2-Column) */  .kk-dashboard-grid  {
          display:  grid;
          grid-template-columns:  320px 1fr;
          gap:  20px;
          margin-top:  20px;
      
}

    /* Sidebar Styles */  .kk-dashboard-sidebar  {
          background:  #fdfdfd;
          padding:  15px;
          border:  1px solid #ddd;
          border-radius:  8px;
          height:  fit-content;
      
}

    .kk-dashboard-sidebar h3,
  .kk-dashboard-sidebar h4  {
          margin-top:  0;
          margin-bottom:  15px;
          color:  #444;
          border-bottom:  2px solid #eee;
          padding-bottom:  8px;
          font-size:  1.1em;
      
}

    /* Main Panel Styles */  .kk-dashboard-main  {
          background:  #fff;
          padding:  20px;
          min-height:  400px;
          border:  1px solid #eee;
          border-radius:  8px;
          box-shadow:  0 4px 12px rgba(0, 0, 0, 0.03);
          position:  relative;
     /* For loader positioning */  
}

    /* Controls Row */  .kk-controls-row  {
          margin-bottom:  12px;
      
}

    .kk-input-group  {
          display:  flex;
          gap:  10px;
          margin-bottom:  10px;
      
}

    #kk-manual-input  {
          flex-grow:  1;
          padding:  8px;
          border:  1px solid #ddd;
          border-radius:  4px;
      
}

    /* Action Buttons (Secondary) */  .kk-btn-secondary  {
          padding:  6px 12px;
          background:  #e2e8f0;
          border:  1px solid #cbd5e1;
          border-radius:  4px;
          cursor:  pointer;
          color:  #334155;
          font-size:  0.9em;
      
}

  .kk-btn-secondary:hover  {
          background:  #cbd5e1;
      
}

    /* Player Card Styles */  .player-card  {
          background:  #fff;
          border:  1px solid #e0e0e0;
          border-radius:  6px;
          padding:  10px;
          margin-bottom:  8px;
          display:  flex;
          justify-content:  space-between;
          align-items:  center;
          box-shadow:  0 1px 3px rgba(0, 0, 0, 0.05);
          transition:  transform 0.1s;
      
}

    .player-card:hover  {
          transform:  translateX(2px);
          border-color:  #cbd5e1;
      
}

    .player-card.dom  {
     border-left:  4px solid #8b5cf6;
     
}

    /* Purple */  .player-card.sub  {
     border-left:  4px solid #ec4899;
     
}

    /* Pink */  .player-card.switch  {
     border-left:  4px solid #10b981;
     
}

 /* Green */    .pc-info  {
          font-size:  0.9em;
          line-height:  1.3;
      
}

  .pc-role  {
          font-size:  0.8em;
          color:  #64748b;
      
}

  .btn-remove  {
          background:  none;
          border:  none;
          color:  #ef4444;
          cursor:  pointer;
          font-size:  1.2em;
          padding:  0 5px;
      
}

    /* Vibe Control Styles */  .vibe-sliders  {
          margin-top:  20px;
          padding-top:  15px;
          border-top:  1px solid #eee;
      
}

  .vibe-control  {
          margin-bottom:  15px;
      
}

  .vibe-control label  {
          display:  flex;
          justify-content:  space-between;
          font-size:  0.85em;
          font-weight:  600;
          color:  #475569;
          margin-bottom:  5px;
      
}

  .vibe-control input[type="range" ]  {
          width:  100%;
          height:  6px;
          background:  #e2e8f0;
          border-radius:  3px;
          -webkit-appearance:  none;
      
}

  /* Slider Thumb Colors */  #vibe-intensity::-webkit-slider-thumb  {
     background:  #ef4444;
     -webkit-appearance:  none;
     width: 16px;
     height: 16px;
     border-radius: 50%;
     
}

  #vibe-romance::-webkit-slider-thumb  {
     background:  #ec4899;
     -webkit-appearance:  none;
     width: 16px;
     height: 16px;
     border-radius: 50%;
     
}

  #vibe-taboo::-webkit-slider-thumb  {
     background:  #8b5cf6;
     -webkit-appearance:  none;
     width: 16px;
     height: 16px;
     border-radius: 50%;
     
}

    /* Scene Output Styling */  .scene-block  {
          margin-bottom:  25px;
          padding-bottom:  15px;
          border-bottom:  1px solid #eee;
      
}

  .scene-time  {
          font-weight:  bold;
          color:  #6366f1;
          font-size:  0.9em;
          text-transform:  uppercase;
          letter-spacing:  0.5px;
          display:  block;
          margin-bottom:  5px;
      
}

  .activity-item  {
          background:  #f8fafc;
          border-left:  3px solid #cbd5e1;
          padding:  10px 15px;
          margin:  8px 0;
          border-radius:  0 4px 4px 0;
      
}

  .act-name  {
          font-weight:  700;
          color:  #1e293b;
          display:  block;
      
}

  .act-desc  {
          font-style:  italic;
          color:  #475569;
          margin-top:  4px;
          display:  block;
          font-size:  0.95em;
      
}

    /* Mobile Responsive */  @media (max-width: 768px)  {
          .kk-dashboard-grid  {
                  grid-template-columns:  1fr;
              
    }

          .kk-dashboard-sidebar  {
                  order:  -1;
         /* Sidebar on top */      
    }

      
}

  


/* --- FIXED SLIDER STYLES (Restoring Legacy Design) --- */

/* 1. Base Setup: Reset appearance and set dimensions */
input[type="range"].kk-activity-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 30px; /* Tall enough to prevent clipping */
    margin: 10px 0;
}

/* 2. The Track (The horizontal bar) */
input[type="range"].kk-activity-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e2e8f0; /* Default Grey (Unanswered) */
    border-radius: 4px;
    border: none;
}

input[type="range"].kk-activity-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 4px;
    border: none;
}

/* 3. The Thumb (The hollow circle handle) */
input[type="range"].kk-activity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #94a3b8; /* Default Grey Border */
    margin-top: -8px; /* Centers thumb on the 8px track */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: border-color 0.2s, transform 0.1s;
}

input[type="range"].kk-activity-slider::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border: 3px solid #94a3b8;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- STATE COLORS (Traffic Light Logic) --- */
/* These classes (hard-no, discuss, yes, favorite) are toggled by JS on the input element */

/* HARD NO (Red) */
input[type="range"].kk-activity-slider.hard-no::-webkit-slider-runnable-track { background: #c0392b; }
input[type="range"].kk-activity-slider.hard-no::-moz-range-track          { background: #c0392b; }
input[type="range"].kk-activity-slider.hard-no::-webkit-slider-thumb      { border-color: #c0392b; }
input[type="range"].kk-activity-slider.hard-no::-moz-range-thumb          { border-color: #c0392b; }

/* DISCUSS (Orange/Gold) */
input[type="range"].kk-activity-slider.discuss::-webkit-slider-runnable-track { background: #f39c12; }
input[type="range"].kk-activity-slider.discuss::-moz-range-track          { background: #f39c12; }
input[type="range"].kk-activity-slider.discuss::-webkit-slider-thumb      { border-color: #f39c12; }
input[type="range"].kk-activity-slider.discuss::-moz-range-thumb          { border-color: #f39c12; }

/* YES (Green) */
input[type="range"].kk-activity-slider.yes::-webkit-slider-runnable-track { background: #27ae60; }
input[type="range"].kk-activity-slider.yes::-moz-range-track          { background: #27ae60; }
input[type="range"].kk-activity-slider.yes::-webkit-slider-thumb      { border-color: #27ae60; }
input[type="range"].kk-activity-slider.yes::-moz-range-thumb          { border-color: #27ae60; }

/* FAVORITE (Purple) */
input[type="range"].kk-activity-slider.favorite::-webkit-slider-runnable-track { background: #8e44ad; }
input[type="range"].kk-activity-slider.favorite::-moz-range-track          { background: #8e44ad; }
input[type="range"].kk-activity-slider.favorite::-webkit-slider-thumb      { border-color: #8e44ad; }
input[type="range"].kk-activity-slider.favorite::-moz-range-thumb          { border-color: #8e44ad; }

/* --- SCENE SLIDER (Green-to-Orange Dynamic) --- */

/* Container to hold the slider + the percentage text */
.kk-scene-slider-wrapper {
    position: relative;
    padding-top: 25px; /* Space for the floating text */
    margin-bottom: 20px;
}

/* 1. The Slider Input */
input[type="range"].kk-scene-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    height: 30px;
}

/* 2. The Track (Dynamic Color Background) */
input[type="range"].kk-scene-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    /* Default to Green, but allow JS to override via --dynamic-color */
    background: var(--dynamic-color, #27ae60);
    border-radius: 4px;
    border: none;
    transition: background 0.1s linear; /* Smooth color transition */
}

input[type="range"].kk-scene-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--dynamic-color, #27ae60);
    border-radius: 4px;
    border: none;
    transition: background 0.1s linear;
}

/* 3. The Thumb (Hollow Style - Matches Activity Slider) */
input[type="range"].kk-scene-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #ffffff;
    /* Border matches the track color */
    border: 3px solid var(--dynamic-color, #27ae60);
    margin-top: -8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: border-color 0.1s linear, transform 0.1s;
}

input[type="range"].kk-scene-slider::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border: 3px solid var(--dynamic-color, #27ae60);
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 4. The Percentage Label (Floating above) */
.kk-scene-percentage-label {
    position: absolute;
    top: 0;
    left: 0; 
    transform: translateX(-50%); /* Center over the thumb */
    font-size: 0.9em;
    font-weight: bold;
    color: var(--dynamic-color, #27ae60);
    pointer-events: none; /* Let clicks pass through to the slider */
    transition: color 0.1s linear, left 0.1s ease-out;
    white-space: nowrap;
}

/* =========================================
   KinkCalc Generator - Presentation Layer
   ========================================= */

/* 1. SURGICAL REMOVAL OF ELEMENTOR DUPLICATES */
.kinkkalc-kink-generator-widget .widget-title,
.kinkkalc-kink-generator-widget #kinkkalc-generator-form {
    display: none !important;
}

/* 2. DASHBOARD CONTAINER */
#kk-dna-dashboard {
    --kk-green: #8fbc8f;
    --kk-green-hover: #7aac7a;
    --kk-text: #333333;
    --kk-border: #dddddd;
    --kk-bg: #ffffff;

    --role-dom: #8b5cf6;
    --role-sub: #ec4899;
    --role-switch: #10b981;
    --stat-orange: #ff9800;

    background-color: var(--kk-bg);
    color: var(--kk-text);
    padding: 25px;
    border-radius: 8px;
    margin-top: 0;
    font-family: 'Lato', 'Inter', sans-serif;
    border: 1px solid var(--kk-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* 3. CONTROLS DECK */
.kk-control-deck {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    align-items: flex-end;
}

#kk-dna-dashboard input[type="text"],
#kk-dna-dashboard input[type="number"],
#kk-dna-dashboard select,
#kk-dna-dashboard button.kk-action-btn {
    height: 42px !important;
    box-sizing: border-box !important;
    vertical-align: middle;
}

#kk-dna-dashboard input,
#kk-dna-dashboard select {
    background: #f9f9f9 !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
    padding: 0 12px !important;
    border-radius: 4px !important;
    outline: none !important;
    font-size: 0.95em;
}

#kk-dna-dashboard input:focus {
    border-color: var(--kk-green) !important;
    background: #fff !important;
}

/* 4. BUTTONS */
.kk-action-btn {
    background: var(--kk-green);
    color: #fff;
    border: 1px solid var(--kk-green-hover);
    border-radius: 50px;
    padding: 0 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    line-height: 40px;
}

.kk-action-btn:hover {
    background: var(--kk-green-hover);
    transform: translateY(-1px);
}

.kk-action-btn.secondary {
    background: #f0f0f0;
    color: #555;
    border-color: #ddd;
}

.kk-action-btn.secondary:hover {
    background: #e5e5e5;
}

/* 5. PLAYMATE CARDS (DATA CHIPS) */
#roster-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.kk-playmate-card {
    width: fit-content;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    border-left-width: 5px;
    border-left-style: solid;
    cursor: pointer;
    position: relative;
}

.kk-playmate-card:hover {
    border-color: #e62020;
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(230, 32, 32, 0.15);
}

.kk-pm-name {
    font-weight: 700;
    font-size: 1em;
    color: #333;
    margin-bottom: 2px;
}

.kk-pm-meta {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kk-pm-stats {
    font-size: 0.85em;
    color: #888;
    display: flex;
    gap: 10px;
}

.role-dom {
    border-left-color: var(--role-dom);
}

.role-sub {
    border-left-color: var(--role-sub);
}

.role-switch {
    border-left-color: var(--role-switch);
}

/* 6. VIBE SLIDERS */
.kk-view-toggle-label {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #666;
    font-size: 0.75em;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

input[type="radio"]:checked+.kk-view-toggle-label {
    background: var(--kk-green);
    color: white;
    border-color: var(--kk-green);
}

.kk-vibe-slider-wrapper {
    margin-bottom: 20px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.kk-vibe-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    /* Matches main app slim track */
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
}

.kk-vibe-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 3px solid var(--track-color);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.kk-vibe-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.kk-vibe-title {
    font-size: 0.8em;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
}

.kk-vibe-val {
    font-size: 0.9em;
    font-weight: 800;
    color: var(--track-color);
}

/* 7. RESULTS TABLE */
.kk-phase-section {
    margin-bottom: 25px;
}

.kk-phase-header {
    background: #f4f4f4;
    border-left: 4px solid #333;
    padding: 10px 15px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.kk-scene-row {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    align-items: stretch;
    transition: background 0.2s;
}

.kk-scene-row:hover {
    background: #fbfbfb;
}

.kk-col-drag {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    cursor: grab;
    border-right: 1px solid #f0f0f0;
}

.kk-col-main {
    flex: 1;
    padding: 12px;
}

/* Transparent action buttons */
.kk-col-action {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #f0f0f0;
}

.btn-row-remove {
    background: transparent !important;
    border: none !important;
    color: #ccc !important;
    font-size: 1.4em !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: auto !important;
    box-shadow: none !important;
}

.btn-row-remove:hover {
    color: #e62020 !important;
}

.kk-item-title {
    color: #333;
    font-weight: 700;
}

.kk-item-note {
    color: #666;
    font-size: 0.9em;
    margin-top: 4px;
    font-style: italic;
}

@media (max-width: 768px) {
    #kk-dna-dashboard {
        padding: 15px;
    }

    .kk-control-deck {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #kk-dna-dashboard input,
    #kk-dna-dashboard select,
    .kk-action-btn {
        width: 100% !important;
    }
}

/* --- RISKOMETER HEADERS --- */
.kk-risk-banner {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 6px solid #ccc;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    gap: 15px;
}

.kk-risk-icon {
    font-size: 2em;
}

.kk-risk-title {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.1em;
    margin-bottom: 4px;
    display: block;
}

.kk-risk-desc {
    font-size: 0.9em;
    opacity: 0.9;
}

/* LEVELS */
.kk-risk-green {
    border-color: #27ae60;
    background: #eafaf1;
    color: #1e8449;
}

.kk-risk-amber {
    border-color: #f39c12;
    background: #fef9e7;
    color: #b7740b;
}

.kk-risk-red {
    border-color: #c0392b;
    background: #fdedec;
    color: #922b21;
}

/* The Safety Warning Text in Cards */
.kk-safety-alert {
    display: block;
    margin-top: 8px;
    padding: 8px;
    background: #fff5f5;
    border: 1px solid #ffcccc;
    color: #cc0000;
    font-size: 0.85em;
    font-weight: bold;
    border-radius: 4px;
}
