/* --- CSS: STYLES (assessment-styles.css) V10.9 (Full Color Buttons) --- */

#relationship-assessment-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
}

h2 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
}

/* --- BUTTON STYLING (General) --- */
button, .btn-primary, .btn-secondary, .btn-nav, .btn-share, .btn-review, .btn-back {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #007bff; /* Blue */
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d; /* Gray */
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-nav {
    background-color: #f8f9fa; /* Light Gray */
    color: #333;
    border: 1px solid #ced4da;
    width: 48%;
}

.btn-nav:hover:not([disabled]) {
    background-color: #e2e6ea;
}

.btn-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-review {
    background-color: #28a745; /* Green */
    color: white;
    margin-top: 15px;
    float: right;
}
.btn-review:hover {
    background-color: #1e7e34;
}

.btn-share {
    background-color: #ffc107; /* Yellow/Orange */
    color: #333;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-share:hover {
    background-color: #e0a800;
}

.btn-status {
    padding: 8px 15px;
    font-size: 0.9em;
    cursor: default !important;
    opacity: 1 !important;
}

.btn-scored {
    background-color: #007bff;
    color: white;
}

.btn-shared {
    background-color: #ffc107;
    color: #333;
}

.btn-back {
    background-color: transparent;
    color: #6c757d;
    text-align: center;
    border: 1px solid #ced4da;
    margin-top: 20px;
    padding: 8px 15px;
    font-weight: normal;
}

/* --- INITIAL OPTIONS & ENTRY SELECTION --- */
#initial-options, #entry-selection {
    text-align: center;
    padding: 30px;
}

.initial-button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
}

.initial-button-group button, .initial-button-group a {
    width: 45%;
    max-width: 350px;
}

.login-prompt-text {
    font-size: 0.9em;
    color: #dc3545;
    margin-top: 15px;
}

#coupleIdInput {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 300px;
    margin-right: 10px;
    text-align: center;
    font-size: 1.1em;
}

.id-confirmation {
    padding: 15px;
    border-radius: 6px;
    margin: 20px auto;
    max-width: 450px;
    text-align: left;
    font-size: 0.95em;
}

.id-confirmation p {
    display: flex; /* Enable flex for ID and Button alignment */
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

/* --- Styles for Copy ID Feature --- */
.couple-id-code {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
    margin-right: 10px;
}

.btn-copy {
    background-color: #00bcd4; /* Cyan/Teal */
    color: white;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: normal;
    transition: background-color 0.3s;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.btn-copy:hover {
    background-color: #0097a7;
}

.btn-copied {
    background-color: #28a745 !important; /* Green when copied */
    color: white !important;
}
/* --- End Styles for Copy ID Feature --- */


.id-confirmation.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.id-confirmation.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.role-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

.btn-role {
    background-color: #007bff;
    color: white;
    width: 150px;
}

.btn-role:hover {
    background-color: #0056b3;
}


/* --- ASSESSMENT UI --- */
.assessment-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
    overflow: auto; /* Contains floats */
}

.assessment-header p {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 5px;
    float: left;
}

.assessment-header h2 {
    text-align: left;
    border-bottom: none;
    margin: 0;
    float: left;
}

/* --- CATEGORY NAVIGATION --- */
#category-navigation {
    width: 100%;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

#category-navigation h4 {
    margin-top: 0;
    color: #333;
}

.overall-progress-bar-container {
    height: 25px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.overall-progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 25px;
    font-size: 0.9em;
    font-weight: bold;
    color: #333;
    z-index: 2;
    margin: 0;
}

.progress-bar-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.4s ease-in-out;
    border-radius: 4px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.category-list li {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    font-size: 0.95em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-list li:hover {
    background-color: #f1f1f1;
}

.category-list li.active {
    border-color: #007bff;
    background-color: #e9f5ff;
}

.category-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.category-progress {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 5px;
}

.category-share {
    margin-top: 5px;
}

.status-pending { border-left: 5px solid #ffc107; }
.status-complete { border-left: 5px solid #17a2b8; }
.status-shared-locked { border-left: 5px solid #6c757d; }
.status-fully-shared { border-left: 5px solid #28a745; }


/* --- STATEMENT AREA --- */
#statement-area {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
}

.category-title h3 {
    margin-top: 0;
    color: #007bff;
}

.statement-box {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.statement-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 0;
    word-wrap: break-word; /* Ensure long statements wrap */
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
}
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* --- RESPONSE STATUS (Response Text Colors) --- */
.response-status {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 25px 0;
    text-align: center;
}

.status-box {
    flex: 1;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.response-display {
    padding: 10px 0;
    font-size: 1.1em;
}

.response-display .pending {
    color: #6c757d;
}

/* V10.2: Response Display Text Color Fix */
.response-status .self-response .true,
.response-status .partner-response .true {
    color: #28a745; /* Green for True */
    font-weight: bold;
}

.response-status .self-response .false,
.response-status .partner-response .false { 
    color: #dc3545; /* Red for False */
    font-weight: bold;
}

.response-status .partner-shared-wait {
    color: #ffc107; /* Yellow/Orange */
    font-style: italic;
    font-size: 0.9em;
}

.response-status .partner-locked {
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

/* --- RESPONSE OPTIONS (BUTTON STYLING) --- (V10.9: Default Colored Buttons) */
.response-options {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.response-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 1.1em;
    font-weight: bold;
    
    /* Base text color for all options (defaulting to white for contrast) */
    color: white; 
    border: 1px solid transparent; /* Remove conflicting default border */
}

.response-options input[type="radio"] {
    display: none;
}

/* ------------------------------------------- */
/* V10.9 COLORS: DEFAULT GREEN/RED BUTTONS     */
/* ------------------------------------------- */

/* Default Button Color (Applied to the LABEL container) */
.response-options .response-true {
    background-color: #28a745; /* DEFAULT GREEN */
    border-color: #28a745;
}
.response-options .response-false {
    background-color: #dc3545; /* DEFAULT RED */
    border-color: #dc3545;
}

/* Hover State (Applied to the LABEL) - Provides visual feedback by darkening */
.response-options .response-true:hover:not(:has(input[disabled])) {
    background-color: #1e7e34; /* Darker Green */
    border-color: #1e7e34;
}
.response-options .response-false:hover:not(:has(input[disabled])) {
    background-color: #c82333; /* Darker Red */
    border-color: #c82333;
}

/* Selected/Checked State (Applied to the inner SPAN to override the LABEL background) */
.response-options .response-true input:checked + .radio-label {
    /* Use !important to override the LABEL's background for the checked span */
    background-color: #1e7e34 !important; /* Darker Green (Checked Feedback) */
}
.response-options .response-false input:checked + .radio-label {
    background-color: #c82333 !important; /* Darker Red (Checked Feedback) */
}

/* Disabled state styling (locked category) */
/* Apply desaturation to the inner span to show it's disabled */
.response-options .response-true input[disabled] + .radio-label,
.response-options .response-false input[disabled] + .radio-label {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #eee !important;
    color: #999 !important;
    border-color: #ccc !important;
}


/* --- NAVIGATION BUTTONS --- */
#navigation-buttons {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

/* --- RESULTS UI --- */
#results-ui {
    text-align: center;
    padding: 30px;
}

.results-title {
    color: #007bff;
    margin-bottom: 20px;
}

.final-score-box {
    background-color: #e9f5ff;
    border: 2px solid #007bff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

.final-score-box h3 {
    font-size: 2.5em;
    color: #007bff;
    margin: 10px 0;
}

.score-interpretation {
    text-align: left;
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border: 1px dashed #ced4da;
    border-radius: 8px;
}

.score-interpretation h4 {
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 0;
}

.score-list {
    list-style: none;
    padding-left: 0;
}

.score-list li {
    margin-bottom: 8px;
    color: #333;
}

.score-list li::before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.results-table {
    width: 100%;
    margin: 25px auto;
    border-collapse: collapse;
    max-width: 700px;
    font-size: 0.95em;
}

.results-table th, .results-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.results-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.results-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 20px;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 20px auto;
    max-width: 600px;
}

.loading-screen {
    text-align: center;
    padding: 50px;
}

/* ========================================================== */
/* MEDIA QUERIES FOR MOBILE (<= 600px)          */
/* ========================================================== */

@media (max-width: 600px) {
    
    #relationship-assessment-container {
        padding: 10px; /* Reduce container padding */
        margin: 10px auto;
    }

    /* 1. Initial Options/Entry Selection (Force vertical stacking) */
    .initial-button-group {
        flex-direction: column;
        gap: 15px;
    }

    .initial-button-group button, 
    .initial-button-group a {
        width: 100%; /* Full width buttons */
        max-width: 100%;
    }
    
    #coupleIdInput {
        width: 90%; /* Adjust input size */
        margin: 10px 0;
        display: block;
    }
    
    #couple-id-form input[type="submit"] {
        width: 90%; /* Adjust submit button size */
        margin-top: 10px;
    }
    
    .role-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .btn-role {
        width: 80%; /* Make role buttons narrower */
    }

    /* V10.4: Copy ID Button Mobile Fix */
    .id-confirmation p {
        flex-direction: column; /* Stack ID and Copy button vertically */
        align-items: center;
        text-align: center;
    }

    .couple-id-code {
        margin-right: 0;
        margin-bottom: 8px;
        display: block;
    }
    
    .btn-copy {
        width: 80%;
        margin-top: 5px;
    }
    /* End V10.4 Copy ID Mobile Fix */


    /* 2. Assessment Header & Navigation */
    .assessment-header h2,
    .assessment-header p,
    .btn-review {
        float: none; /* Remove floating */
        text-align: center;
        margin: 5px 0;
        width: 100%; /* Full width */
    }
    
    .btn-review {
        margin-top: 15px;
    }

    /* 3. Category Navigation (Force single column for better readability) */
    .category-list {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 8px;
    }
    
    .category-list li {
        font-size: 1em; /* Slight increase for touch targets */
        padding: 10px;
    }

    /* 4. Statement and Response Area */
    .statement-text {
        font-size: 1.05em; /* Smaller font for long statements */
    }
    
    .response-options {
        flex-direction: column; /* Stack True/False buttons vertically */
        gap: 10px;
    }
    
    .response-options label {
        width: 90%; /* Center and widen buttons */
        margin: 0 auto;
        justify-content: center;
    }
    
    .response-status {
        flex-direction: column; /* Stack status boxes vertically */
        gap: 15px;
    }
    
    .status-box {
        padding: 10px;
    }

    /* 5. Navigation Buttons (Force full width stacking) */
    #navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-nav {
        width: 100%;
    }
    
    /* 6. Results Table (Adjust for narrow screens) */
    .results-table th, .results-table td {
        padding: 8px 5px; /* Less padding in table */
        font-size: 0.85em;
    }
}