@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;700&display=swap');

/* K.N.O.T. C.L.E.A.R. Engine frontend styles */

.wp-site-blocks main {
    margin-top: 0 !important;
}

/* --- CORE ARCHITECTURE --- */
.app-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: 'Comfortaa', system-ui, sans-serif;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.app-container *, 
.app-container *::before, 
.app-container *::after { 
    box-sizing: border-box; 
}

.app-container h1 {
    font-size: 2.4rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1a202c;
    margin: 0 0 10px 0;
}

.app-container .step-subtitle {
    font-size: 1.2rem;
    color: #4a5568;
    margin: 0 auto 30px auto;
    max-width: 750px;
}

#progress-text {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #718096;
}

.progress-bar {
    margin-bottom: 30px;
}

/* --- GRID CONTAINERS (STEPS 1, 2, 3, 4, 5) --- */
.environment-grid,
.character-grid,
.options-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.environment-options-grid {
    gap: 20px;
    max-width: 800px;
    margin-right: auto;
    margin-left: auto;
}

.selection-card input[type="checkbox"],
.selection-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* --- SELECTION CARDS --- */
/* Base style for clickable selection cards */
.selection-card {
    background: #ffffff;
    border: 3px solid #cbd5e0;
    border-radius: 20px;
    padding: 20px; 
    width: 240px; 
    min-height: 360px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Specific Dimension Adapters for Step 1 Environment Selections */
.environment-card {
    min-height: 260px;
    justify-content: center;
}

/* Specific Dimension Adapters for Step 2 Character Selections */
.character-card {
    min-height: 240px;
    width: 200px;
    justify-content: center;
}

.selection-card h3 {
    margin: 12px 0; 
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.2;
}

/* Keeps textual headers bounded within uniform layout limits on database post loops */
.asset-selection-card h3 {
    height: 3rem; 
    overflow: hidden;
    margin: 0 0 12px 0;
}

.selection-card .card-icon {
    user-select: none;
    line-height: 1;
}

.selection-card .card-image {
    width: 100%; 
    height: 160px; 
    background: #ffffff;
    overflow: hidden; 
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.environment-card .card-image span,
.selection-card .card-image span {
    font-size: 3rem;
}

.environment-card .card-image span {
    font-size: 4rem;
}

.environment-card .card-image img {
    max-height: 170px;
    max-width: 92%;
}

.selection-card .card-image img {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain;
}

.selection-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.4;
    max-width: 100%;
}

/* Active Highlight Interaction States */
.selection-card.selected {
    border-color: #1a365d;
    box-shadow: 0 8px 16px rgba(26, 54, 93, 0.12);
    transform: translateY(-4px);
    background-color: #f7fafc;
}

/* --- HOME TOOL GATEWAY --- */
.kc-home-container {
    min-height: 72vh;
    padding-top: 40px;
}

.kc-home-kicker {
    color: #718096;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.kc-home-grid {
    align-items: stretch;
    margin-top: 10px;
}

.kc-home-card {
    color: inherit;
    min-height: 390px;
    text-decoration: none;
    width: 300px;
}

.kc-home-card:hover,
.kc-home-card:focus {
    border-color: #1a365d;
    box-shadow: 0 8px 16px rgba(26, 54, 93, 0.12);
    outline: none;
    transform: translateY(-4px);
}

.kc-home-card h3 {
    min-height: 3rem;
}

.kc-home-card .card-image {
    height: 180px;
}

.kc-home-card-action {
    background: #4a5568;
    border-radius: 30px;
    color: #ffffff;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 700;
    justify-content: center;
    margin-top: 24px;
    padding: 12px 22px;
    width: 100%;
}

/* --- STEP 6: EXCLUSIVE RECOMMENDED TOOL ROW LAYOUT --- */
.recommendations-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

.tool-row-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    padding: 16px 24px;
    background: #ffffff;
    border: 3px solid #cbd5e0;
    border-radius: 20px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tool-row-card .row-image-area {
    width: 65px;
    height: 65px;
    min-width: 65px;
    max-width: 65px;
    margin-right: 24px;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-row-card .row-image-area img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.tool-row-card .row-text-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
    min-width: 0;
}

.tool-row-card .row-text-area h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    color: #2d3748;
    line-height: 1.2;
}

.tool-row-card .row-text-area p {
    margin: 0;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.4;
}

/* Recommended Active Selection Matrix UI Overhaul Styles */
.tool-row-card.selected {
    background-color: #ebf8ff;
    border-color: #2b6cb0;
}

.kc-state-card {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 10px;
    color: #2d3748;
    margin: 0 auto 24px auto;
    max-width: 850px;
    padding: 18px;
    text-align: center;
}

.kc-state-card-label {
    color: #4a5568;
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.kc-state-card strong {
    color: #2b6cb0;
    display: block;
    font-size: 1.45rem;
    line-height: 1.2;
}

.kc-state-card p {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.4;
    margin: 8px auto 0 auto;
    max-width: 620px;
}

.kc-protocols-wrapper {
    margin: 0 auto 24px auto;
    max-width: 850px;
}

.kc-protocol-card {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    color: #2d3748;
    margin-bottom: 18px;
    padding: 18px;
    text-align: left;
}

.kc-protocol-card:last-child {
    margin-bottom: 0;
}

.kc-protocol-label {
    color: #b7791f;
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.kc-protocol-card h2 {
    color: #1a202c;
    font-size: 1.35rem;
    margin: 0 0 10px 0;
    text-transform: none;
}

.kc-protocol-content {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.5;
}

.kc-protocol-content ul,
.kc-protocol-content ol {
    margin-bottom: 0;
}

.kc-protocol-tools-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.kc-protocol-tool-row {
    align-items: center;
    background: #ffffff;
    border: 2px solid #fed7aa;
    border-radius: 10px;
    display: flex;
    padding: 14px 16px;
}

.kc-protocol-tool-image {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    font-size: 2rem;
    height: 58px;
    justify-content: center;
    margin-right: 18px;
    width: 58px;
}

.kc-protocol-tool-image img {
    height: auto;
    max-height: 58px;
    max-width: 58px;
    object-fit: contain;
}

.kc-protocol-tool-text {
    min-width: 0;
}

.kc-protocol-tool-text h3 {
    color: #2d3748;
    font-size: 1.1rem;
    line-height: 1.25;
    margin: 0;
}

.kc-protocol-tool-text p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 4px 0 0 0;
}

.kc-diagnostics-panel {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

#kc-selection-summary {
    margin: 40px auto 0 auto;
    max-width: 850px;
    width: 100%;
}

.kc-diagnostics-panel h4 {
    margin: 0 0 5px 0;
    color: #2b6cb0;
}

.kc-diagnostics-panel p {
    margin: 0;
    font-size: 0.95rem;
    color: #2d3748;
    line-height: 1.4;
}

.kc-diagnostics-panel span {
    text-transform: uppercase;
    font-weight: 700;
    color: #2b6cb0;
}

.kc-diagnostics-evidence {
    color: #2d3748;
    font-size: 0.92rem;
    line-height: 1.5;
    margin-top: 12px;
}

.kc-diagnostics-muted {
    color: #718096;
}

.kc-fallback-note {
    color: #e53e3e;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 5px;
}

.kc-empty-tools-message {
    color: #4a5568;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.live-context-container {
    background: #f7fafc;
    padding: 20px;
    border-radius: 14px;
    margin: 30px auto 10px auto;
    max-width: 850px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.live-context-container label {
    display: block;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.live-context-container input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    font-size: 1rem;
    font-family: inherit;
}

/* --- NAVIGATION BUTTONS & INTERFACES --- */
.button-container { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    margin-top: 30px; 
}

.next-btn, .prev-btn, .submit-btn { 
    padding: 16px 40px; 
    font-size: 1.15rem; 
    font-weight: 700; 
    border-radius: 30px; 
    cursor: pointer; 
    border: none; 
    font-family: inherit;
    transition: background 0.15s ease;
}

.prev-btn { background: #e2e8f0; color: #4a5568; }
.prev-btn:hover { background: #cbd5e0; }
.next-btn { background: #4a5568; color: white; }
.next-btn:hover { background: #2d3748; }
.submit-btn { background: #2b6cb0; color: white; }
.submit-btn:hover { background: #1a365d; }

.tab-toggle-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 24px auto;
}

.tab-toggle-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: 0;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 28px;
}

.tab-toggle-btn.active-tab {
    background: #b7791f;
    color: white;
    box-shadow: 0 4px 10px rgba(183, 121, 31, 0.2);
}

/* Clean Core Visibility Control */
.hidden { 
    display: none !important; 
}
