/* --- CSS: STYLES (assessment-styles.css) V11.0 (Modernized Card UI) --- */

/* --- COLOR PALETTE --- */
:root {
    --primary-color: #007bff; /* Blue for primary actions */
    --secondary-color: #6c757d; /* Gray for secondary actions */
    --success-color: #28a745; /* Green for True/Success/Share */
    --danger-color: #dc3545; /* Red for False/Warning */
    --info-color: #17a2b8; /* Light blue for info/progress */
    --background-light: #f8f9fa; /* Light gray background */
    --card-background: #ffffff; /* White card background */
    --border-color: #e9ecef; /* Light border */
}

#relationship-assessment-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h2 {
    color: #333;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 300;
}

h3, h4 {
    color: #444;
}

p.description-text, p.logout-link-text {
    text-align: center;
    color: var(--secondary-color);
    margin: 10px 0 20px 0;
}

/* --- BUTTON STYLING (General) --- */
button, .btn-primary, .btn-secondary, .btn-nav, .btn-share, .btn-review, .btn-back, a.account-link button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px; /* Slightly more rounded */
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:active, .btn-primary:active, .btn-secondary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}
.btn-success:hover {
    background-color: #1e7e34;
}

.btn-review {
    background-color: var(--info-color);
    color: white;
}
.btn-review:hover {
    background-color: #117a8b;
}

.btn-back {
    background-color: var(--background-light);
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    box-shadow: none;
}
.btn-back:hover {
    background-color: #e9ecef;
}

.btn-share {
    background-color: var(--success-color);
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
    box-shadow: none;
}
.btn-share:hover {
    background-color: #1e7e34;
}

.btn-copy {
    background: var(--info-color);
    color: white;
    padding: 6px 12px;
    font-size: 0.8em;
    border-radius: 4px;
    margin-left: 10px;
    box-shadow: none;
}
.btn-copy:hover {
    background-color: #117a8b;
}
.btn-copy.btn-copied {
    background-color: var(--success-color);
}

/* --- CARD UI (MODERN) --- */
.card-ui {
    background: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.initial-button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 20px auto;
}

.role-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}
.btn-role {
    flex-grow: 1;
    max-width: 200px;
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
}
.btn-role:hover {
    background-color: #0056b3;
}

.id-confirmation {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
}
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.couple-id-code {
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1em;
    user-select: all;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px dashed #ced4da;
}

/* --- OVERALL PROGRESS BAR --- */
.overall-progress-bar-container {
    background-color: var(--border-color);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.overall-progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 25px; /* Match height of fill */
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    z-index: 2;
    margin: 0;
    padding: 4px 0;
}
.progress-bar-fill {
    height: 35px;
    background-color: var(--primary-color);
    transition: width 0.5s ease-out;
    border-radius: 10px;
    opacity: 0.8;
}

/* --- CATEGORY NAVIGATION GRID --- */
.category-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 15px;
    margin: 25px 0;
}
.category-list li {
    background-color: var(--card-background);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    border-left: 5px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.category-list li:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.category-list li.active {
    border: 2px solid var(--primary-color);
    border-left: 5px solid var(--primary-color);
    background-color: #f0f7ff;
}

.category-name {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 5px;
}
.category-progress {
    font-size: 0.9em;
    color: var(--secondary-color);
}
.category-share {
    margin-top: 10px;
    text-align: right;
}

/* Status Colors */
.status-pending { border-left-color: var(--secondary-color) !important; }
.status-complete { border-left-color: var(--info-color) !important; }
.status-shared-locked { border-left-color: orange !important; }
.status-fully-shared { border-left-color: var(--success-color) !important; }


/* --- STATEMENT CARD --- */
.statement-card {
    background: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}
.category-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.category-title-bar h3 {
    margin: 0;
    font-size: 1.2em;
}
.statement-count {
    background: var(--info-color);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.85em;
}
.statement-text {
    font-size: 1.25em;
    line-height: 1.6;
    color: #333;
    font-weight: 500;
    margin: 0;
}

/* --- RESPONSE STATUS BOXES (MODERN) --- */
.response-status-modern {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
}
.status-box-modern {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fbfbfb;
    text-align: center;
}
.status-box-modern strong {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9em;
}
.current-answer-pill, .response-pill {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s;
}
.current-answer-pill.true, .response-pill.true {
    background-color: var(--success-color);
    color: white;
}
.current-answer-pill.false, .response-pill.false {
    background-color: var(--danger-color);
    color: white;
}
.current-answer-pill.pending, .response-pill.pending {
    background-color: var(--secondary-color);
    color: white;
}
.partner-locked, .partner-shared-wait {
    color: #777;
    font-style: italic;
    display: block;
    padding: 8px 15px;
}

/* --- TRUE/FALSE TOGGLE SWITCH (MODERN UI) --- */
.response-options-modern {
    text-align: center;
    padding: 20px 0;
}
.toggle-switch-container {
    display: inline-flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
}
.toggle-input {
    display: none;
}
.toggle-label {
    padding: 15px 30px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--secondary-color);
    background-color: var(--card-background);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle-label i {
    font-size: 1.2em;
}

/* Checked State */
.toggle-input:checked + .toggle-label {
    color: white;
    background-color: var(--success-color);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}
.toggle-input#response-true:checked + .toggle-true {
    background-color: var(--success-color);
}
.toggle-input#response-false:checked + .toggle-false {
    background-color: var(--danger-color);
}

/* Disabled State */
.toggle-input:disabled + .toggle-label, .toggle-label.disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: #eee;
    color: #aaa;
}
.toggle-input:disabled:checked + .toggle-label {
    opacity: 1; 
}

/* --- NAVIGATION BUTTONS --- */
#navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}
.btn-nav {
    flex: 1;
    margin: 0 10px;
    padding: 15px;
}
.btn-nav[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- RESULTS SCREEN --- */
.results-title h2 {
    color: var(--success-color);
}
.final-score-box {
    text-align: center;
    background: #f0fdf4;
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 30px;
    margin: 25px auto;
    max-width: 500px;
}
.final-score-box h3 {
    font-size: 3em;
    color: var(--success-color);
    margin: 10px 0;
}
.score-interpretation {
    padding: 20px;
    border-top: 1px dashed var(--border-color);
    margin-top: 20px;
}
.score-list {
    list-style: disc;
    padding-left: 20px;
    font-size: 1.1em;
    line-height: 1.8;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {
    #relationship-assessment-container {
        margin: 10px auto;
        padding: 15px;
    }
    
    .initial-button-group {
        max-width: 90%;
    }
    
    .role-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .category-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .statement-text {
        font-size: 1.15em;
    }
    
    .response-status-modern {
        flex-direction: column;
        gap: 15px;
    }
    
    .status-box-modern {
        padding: 12px;
    }

    .toggle-switch-container {
        width: 100%;
        display: flex;
    }
    .toggle-label {
        flex-grow: 1;
        justify-content: center;
        padding: 15px 10px;
    }
    
    #navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .btn-nav {
        margin: 0;
    }
}

/* --- CSS: STYLES (assessment-styles.css) V11.5 (Comments Feature Styling) --- */

/* ... (Keep all existing styles above this line) ... */

/* New Comment Section Styles */
.comment-section {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.self-comment-box, .partner-comment-box {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.self-comment-box {
    background-color: #f7f7ff; /* Light blue/lilac for self-notes */
    border: 1px solid var(--info-color);
}

.partner-comment-box {
    background-color: #f0fff0; /* Light green/mint for partner-notes */
    border: 1px solid var(--success-color);
}

.comment-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: bold;
    color: #444;
}

#self-comment-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
    resize: vertical;
    font-size: 0.9em;
    min-height: 80px;
}

#self-comment-textarea:disabled {
    background-color: #eee;
    cursor: not-allowed;
}

.comment-saving-status {
    margin-top: 5px;
    font-size: 0.8em;
    color: var(--info-color);
}

.partner-comment-box p {
    margin: 0;
    font-style: italic;
    white-space: pre-wrap; /* Allows line breaks from textarea to show */
    color: #333;
}

.partner-comment-box.no-comment {
    opacity: 0.8;
    background-color: #f0f0f0;
    border-color: #ccc;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .comment-section {
        flex-direction: column;
    }
}

/** * CSS to fix navigation buttons on mobile view.
 * Add this to your main stylesheet (e.g., style.css or your plugin's enqueue style).
 */
/**
 * CSS Mobile Optimizations (v11.7 - Robust Fix)
 * 1. Ensures bottom comments are not hidden by sticky navigation.
 * 2. Forces response boxes side-by-side on mobile to save vertical space.
 */
@media (max-width: 768px) {
    
    /* 1. Sticky Navigation Positioning */
    #statement-view #navigation-buttons {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        
        background-color: #ffffff; 
        border-top: 1px solid #e0e0e0; 
        padding: 10px 15px;
        box-sizing: border-box; 
        z-index: 10000; /* Increased z-index to ensure it is on top */
        
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }
    
    #statement-view #navigation-buttons .btn-nav {
        flex-grow: 1;
        margin: 0 !important;
    }

    /* 2. Content Padding Fix (Prevents comments from being hidden) */
    /* Increased padding to 90px to be absolutely certain the last line of content clears the 
       fixed navigation bar. */
    #statement-view {
        padding-bottom: 120px !important; 
    }
    
    /* 3. Response Boxes Side-by-Side Fix */
    #statement-view .response-status-modern {
        display: flex;
        flex-direction: row; 
        justify-content: space-between;
        gap: 8px; 
        margin-bottom: 15px;
        margin-top: 15px;
    }
    
    /* Ensuring both status boxes share space evenly */
    #statement-view .status-box-modern {
        flex: 1 1 49%; /* Slightly more robust width distribution */
        padding: 8px !important; 
        font-size: 0.9em; 
        text-align: center;
        /* Force minimum width to prevent collapse, but allow flexibility */
        min-width: 0; 
    }
    
    /* Adjust text size within boxes */
    #statement-view .status-box-modern strong {
        display: block;
        font-size: 0.75em; 
        line-height: 1.2;
    }

    /* Ensure the response pills are responsive */
    #statement-view .status-box-modern .current-answer-pill,
    #statement-view .status-box-modern .response-pill {
        display: block;
        margin-top: 5px;
        white-space: normal;
        font-size: 0.9em;
    }
}