body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    font-family: Arial, sans-serif;
}
.container {
    text-align: center;
}

.avatar-container {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 0 0 6px #f0f0f0;
    border: 4px solid #333;
    transition: all 0.3s ease;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* main title */

/* Avatar Detail Panel Styling */
.avatar-detail-panel {
    background-color: #fff;
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), 0 0 0 4px #f0f0f0;
    border: 3px solid #333;
    position: relative;
    overflow: hidden;
}

.avatar-detail-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 5px 5px 0 0;
}

.avatar-option-section {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 10px;
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
}

.avatar-option-section:hover {
    background-color: #f0f8ff;
    border-color: #c7ceea;
    transform: translateY(-2px);
}

.avatar-option-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #444;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.avatar-option-section h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 3px;
}

.avatar-option-section select, 
.avatar-option-section input[type="color"] {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background-color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-option-section select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
}

.avatar-option-section select:hover,
.avatar-option-section input[type="color"]:hover {
    border-color: #c7ceea;
    box-shadow: 0 0 0 3px rgba(199, 206, 234, 0.3);
}

.avatar-option-section select:focus,
.avatar-option-section input[type="color"]:focus {
    outline: none;
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.5);
}

.avatar-option-section input[type="color"] {
    height: 40px;
    padding: 5px;
}

.avatar-container:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2), 0 0 0 8px #f0f0f0;
}

/* Cartoon-style button for confirm-avatar-button */
#confirm-avatar-button {
    padding: 14px 28px;
    background-color: #FF6B6B;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #333, 0 8px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    display: block;
    margin: 20px auto;
}

#confirm-avatar-button:hover {
    background-color: #FF8E8E;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 9px 0 #333, 0 12px 15px rgba(0, 0, 0, 0.25);
}

#confirm-avatar-button:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

#confirm-avatar-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

#confirm-avatar-button:hover::before {
    animation: shine 1.5s ease-in-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translateX(100%) rotate(45deg);
        opacity: 0;
    }
}

/* Questionnaire Styling */
.questionnaire-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
}

.questionnaire-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 5px 5px 0 0;
}

/* Responsive adjustments for questionnaire content */
@media (max-width: 768px) {
    .questionnaire-content {
        padding: 15px;
        margin: 10px;
        border-radius: 15px;
        max-width: 100%;
    }
    
    .questionnaire-content form {
        display: flex;
        flex-direction: column;
    }
    
    .questionnaire-content input[type="text"],
    .questionnaire-content input[type="email"],
    .questionnaire-content input[type="number"],
    .questionnaire-content select,
    .questionnaire-content textarea {
        width: 100%;
        padding: 10px;
        margin-bottom: 15px;
        border: 2px solid #ddd;
        border-radius: 8px;
        font-size: 16px;
    }
    
    .questionnaire-content .likert-scale {
        flex-direction: column;
        gap: 8px;
    }
    
    .questionnaire-content .likert-scale label {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 8px 10px;
        font-size: 14px;
        width: 100%;
    }
    
    .questionnaire-content .likert-scale input[type="radio"] {
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .questionnaire-content button[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .questionnaire-content {
        padding: 12px;
        margin: 5px;
        border-width: 3px;
    }
    
    .questionnaire-content h2 {
        font-size: 20px;
    }
    
    .questionnaire-content label {
        font-size: 14px;
    }
    
    .questionnaire-content input[type="text"],
    .questionnaire-content input[type="email"],
    .questionnaire-content input[type="number"],
    .questionnaire-content select,
    .questionnaire-content textarea {
        padding: 8px;
        font-size: 14px;
    }
}

.questionnaire-content h2 {
    color: #444;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.questionnaire-content h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 3px;
}

.questionnaire-content p {
    margin-bottom: 20px;
    text-align: center;
    color: #555;
}

.question-item {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 10px;
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
}

.question-item p {
    margin-top: 0;
    margin-bottom: 10px;
    color: #444;
    font-weight: bold;
    text-align: left;
}

.question-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.question-item:hover {
    background-color: rgba(207, 248, 178, 0.1);
    border-color: rgba(81, 242, 0, 0.3);
    transform: translateY(-2px);
}

.favorite-question {
    background-color: rgba(207, 248, 178, 0.2);
    box-shadow: 0 0 0 2px rgba(81, 242, 0, 0.5);
    position: relative;
}

.favorite-question::after {
    content: "★ Preferred";
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 12px;
    color: #ff9800;
    font-weight: bold;
}

.likert-scale {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.likert-scale label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.likert-scale label:hover {
    background-color: rgba(199, 206, 234, 0.3);
}

.likert-scale input {
    margin-bottom: 5px;
    cursor: pointer;
}

/* Submit Button Container */
.submit-button-container {
    margin: 20px 0 60px;
    padding: 10px;
    text-align: center;
}

/* Submit Questionnaire Button Styling */
#submit-questionnaire {
    padding: 14px 28px;
    background-color: #4CAF50;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #333, 0 8px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    display: inline-block;
}

#submit-questionnaire:hover {
    background-color: #45a049;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

#submit-questionnaire:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

#submit-questionnaire::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

#submit-questionnaire:hover::before {
    animation: shine 1.5s ease-in-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: translateX(100%) rotate(45deg);
        opacity: 0;
    }
}

/* Main Title Styling */
.main-title {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 20px 0;
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 15px;
    border: 3px solid #333;
    box-shadow: 0 6px 0 #333, 0 8px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
    transform: rotate(-1deg);
    transition: all 0.3s ease;
    line-height: 1.2;
    max-width: 90%;
}

.main-title-primary {
    display: block;
    font-size: 2.8rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.main-title-secondary {
    display: block;
    font-size: 1.8rem;
    font-style: italic;
}

.main-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 30px;
    height: 30px;
    background-color: #FF9AA2;
    border: 3px solid #333;
    border-radius: 50%;
    box-shadow: 0 3px 0 #333;
    z-index: -1;
}

.main-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 25px;
    height: 25px;
    background-color: #C7CEEA;
    border: 3px solid #333;
    border-radius: 50%;
    box-shadow: 0 3px 0 #333;
    z-index: -1;
}

.main-title:hover {
    transform: rotate(1deg) scale(1.03);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

.main-title span {
    display: inline-block;
    animation: bounce 2s infinite alternate;
}

.main-title-primary span:nth-child(2n) {
    animation-delay: 0.2s;
}

.main-title-primary span:nth-child(3n) {
    animation-delay: 0.4s;
}

.main-title-secondary span:nth-child(2n) {
    animation-delay: 0.3s;
}

.main-title-secondary span:nth-child(3n) {
    animation-delay: 0.5s;
}

.main-title-primary span:nth-child(2n) {
    animation-delay: 0.2s;
}

.main-title-primary span:nth-child(3n) {
    animation-delay: 0.4s;
}

.main-title-secondary span:nth-child(2n) {
    animation-delay: 0.3s;
}

.main-title-secondary span:nth-child(3n) {
    animation-delay: 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Communication Preferences Section Styling */
.comm-preferences-section {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 15px;
    background-color: #f0f8ff;
    border: 3px solid #4A90E2;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.comm-preferences-section:hover {
    background-color: #e6f2ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.comm-preferences-section p {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
    text-align: left;
    font-size: 1.1em;
    border-bottom: 2px dotted #4A90E2;
    padding-bottom: 8px;
}

.toggle-buttons {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
}

.toggle-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    border: 3px solid #4A90E2;
    border-radius: 15px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(-5px);
    min-width: 90px;
    box-shadow: 0 9px 0 #4A90E2;
}

.toggle-button:hover {
    transform: translateY(0px);
    box-shadow: 0 4px 0 #4A90E2;
}

.toggle-button input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.toggle-icon {
    font-size: 28px;
    color: #4A90E2;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.toggle-label {
    font-size: 16px;
    font-weight: bold;
    color: #4A90E2;
    transition: all 0.3s ease;
}

/* Checked state styling - Alternative 5: Border Animation */
@keyframes borderPulse {
    0% { border-color: #FF6B6B; }
    50% { border-color: #FF9999; }
    100% { border-color: #FF6B6B; }
}

.toggle-button:has(input:checked) {
    background: linear-gradient(135deg, #FFE0E0, #FFC0C0);
    border-color: #FF6B6B;
    box-shadow: 0 4px 0 #FF6B6B;
    transform: translateY(-3px);
}

.toggle-button input:checked ~ .toggle-icon {
    color: #FF6B6B;
    transform: scale(1.2);
}

.toggle-button input:checked ~ .toggle-label {
    color: #FF6B6B;
}

.toggle-button input:checked ~ .toggle-icon {
    animation: pulse 0.5s ease-in-out;
}

.toggle-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4A90E2;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Additional Info Button Styling */
.additional-info-section {
    margin-top: 25px;
    text-align: center;
}

#open-additional-info {
    padding: 12px 24px;
    background-color: #9B59B6;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 0 #333, 0 7px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#open-additional-info:hover {
    background-color: #A569BD;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

#open-additional-info:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

#open-additional-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

#open-additional-info:hover::before {
    animation: shine 1.5s ease-in-out;
}

.button-icon {
    font-size: 20px;
    display: inline-block;
    transform: rotate(-5deg);
    transition: all 0.3s ease;
}

#open-additional-info:hover .button-icon {
    transform: rotate(5deg) scale(1.2);
}

/* Modal Styling */
.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);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border: 4px solid #333;
    border-radius: 20px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
}

@keyframes modalDrop {
    0% {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(90deg, #9B59B6, #8E44AD);
    color: white;
    padding: 15px 20px;
    position: relative;
    border-bottom: 3px solid #333;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 24px;
    text-align: center;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close-modal:hover {
    transform: rotate(90deg) scale(1.2);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #9B59B6 #f9f9f9;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: #9B59B6;
    border-radius: 10px;
    border: 2px solid #f9f9f9;
}

.modal-footer {
    padding: 15px 20px;
    text-align: center;
    border-top: 2px dashed #ddd;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
}

#save-additional-info {
    padding: 12px 24px;
    background-color: #9B59B6;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 0 #333, 0 7px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    margin: 0 auto;
}

#save-additional-info:hover {
    background-color: #A569BD;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

#save-additional-info:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

.confirmation-message {
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #DFF2BF;
    color: #4F8A10;
    border-radius: 10px;
    border: 2px solid #4F8A10;
    font-weight: bold;
    display: inline-block;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Additional Question Item Styling */
.additional-question-item {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    background-color: #f9f9f9;
    border: 3px solid #333;
    box-shadow: 0 4px 0 #333, 0 6px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.additional-question-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 8px 8px 0 0;
}

.additional-question-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 #333, 0 9px 15px rgba(0, 0, 0, 0.2);
}

.additional-question-item p {
    margin-top: 5px;
    margin-bottom: 12px;
    font-weight: bold;
    color: #333;
    font-size: 16px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
}

.additional-question-item .likert-scale {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.additional-question-item .likert-scale label {
    flex: 1;
    min-width: 80px;
    padding: 8px 5px;
    text-align: center;
    font-size: 13px;
    border-radius: 8px;
    background-color: white;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.additional-question-item .likert-scale label:hover {
    background-color: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.additional-question-item .likert-scale input[type="radio"] {
    margin-right: 5px;
}

/* Animation for additional questions */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    70% {
        opacity: 1;
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

.additional-question-item:nth-child(1) { animation: bounceIn 0.5s ease-out 0.1s both; }
.additional-question-item:nth-child(2) { animation: bounceIn 0.5s ease-out 0.2s both; }
.additional-question-item:nth-child(3) { animation: bounceIn 0.5s ease-out 0.3s both; }
.additional-question-item:nth-child(4) { animation: bounceIn 0.5s ease-out 0.4s both; }
.additional-question-item:nth-child(5) { animation: bounceIn 0.5s ease-out 0.5s both; }

/* Matching Container Styling */
.matching-container {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 500px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 0 0 6px #f0f0f0;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.matching-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 5px 5px 0 0;
}

.matching-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.matching-status h2 {
    color: #444;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 25px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    position: relative;
    display: inline-block;
}

.matching-status h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 4px;
}

/* Loading Animation */
.loading-animation {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    height: 100px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
    z-index: 2;
}

.ripple-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ripple {
    position: absolute;
    border: 2px solid #3498db;
    border-radius: 50%;
    opacity: 0;
    width: 50px;
    height: 50px;
    animation: ripple 2s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}

.ripple2 {
    animation-delay: 0.5s;
}

.ripple3 {
    animation-delay: 1s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Matching Message */
.matching-message {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 18px;
    color: #555;
    margin-top: 20px;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border: 3px dashed #ddd;
    border-radius: 15px;
    display: inline-block;
    position: relative;
    min-height: 24px;
    min-width: 300px;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

/* Avatar animation during matching */
.avatar-container.matching {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1.1);
    }
    50% {
        transform: translateY(-15px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1.1);
    }
}

/* Confetti effect when match is found */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f0f0f0;
    opacity: 0;
    animation: confetti 5s ease-in-out forwards;
    z-index: -1;
}

.confetti:nth-child(1) { background-color: #FF9AA2; top: 10%; left: 10%; animation-delay: 0.1s; }
.confetti:nth-child(2) { background-color: #FFB7B2; top: 20%; left: 20%; animation-delay: 0.2s; }
.confetti:nth-child(3) { background-color: #FFDAC1; top: 30%; left: 30%; animation-delay: 0.3s; }
.confetti:nth-child(4) { background-color: #E2F0CB; top: 40%; left: 40%; animation-delay: 0.4s; }
.confetti:nth-child(5) { background-color: #B5EAD7; top: 50%; left: 50%; animation-delay: 0.5s; }
.confetti:nth-child(6) { background-color: #C7CEEA; top: 60%; left: 60%; animation-delay: 0.6s; }
.confetti:nth-child(7) { background-color: #FF9AA2; top: 70%; left: 70%; animation-delay: 0.7s; }
.confetti:nth-child(8) { background-color: #FFB7B2; top: 80%; left: 80%; animation-delay: 0.8s; }

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Match found animation */
.match-found {
    animation: matchFound 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes matchFound {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Typing effect for matching messages */
.typing::after {
    content: '';
    width: 5px;
    height: 15px;
    background-color: #333;
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 5px;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Chat Room Layout Styling */
.chat-room-active {
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    overflow: hidden;
}

.chat-room-layout {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Chat Columns */
.chat-column {
    padding: 10px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.user-column, .partner-column {
    flex: 1;
    background-color: #f9f9f9;
    border-right: 3px solid #eee;
    max-width: 300px;
    justify-content: center; /* Center vertically */
}

.partner-column {
    border-right: none;
    border-left: 3px solid #eee;
}

.chat-window-column {
    flex: 3;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    min-width: 0; /* Prevents flex items from overflowing */
    /* Removed border */
}

/* Improved responsive adjustments */
@media (max-width: 768px) {
    .chat-room-active {
        overflow-y: auto; /* Allow vertical scrolling on mobile */
        height: auto;
        min-height: 100vh;
    }
    
    .chat-room-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible; /* Allow content to be visible */
    }
    
    .user-column, .partner-column {
        max-width: 100%;
        width: 100%;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 10px;
        border-right: none;
        border-left: none;
    }
    
    .chat-window-column {
        flex: 1;
        min-height: 60vh; /* Ensure chat window has enough height */
        max-height: 60vh; /* Limit height to ensure other elements are visible */
        overflow-y: auto; /* Allow scrolling within the chat window */
    }
    
    .chat-messages {
        max-height: none; /* Remove fixed height constraint */
        flex: 1;
    }
}

@media (max-width: 900px) {
    .user-column, .partner-column {
        max-width: 200px;
    }
    
    .chat-avatar {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .chat-avatar-container {
        padding: 8px;
    }
    
    .chat-avatar {
        width: 45px;
        height: 45px;
    }
    
    .chat-avatar-container h3 {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .user-status, .partner-status {
        padding: 3px 8px;
        font-size: 12px;
    }
    
    .partner-bio {
        font-size: 12px;
        padding: 8px;
        margin-top: 5px;
    }
    
    .chat-header {
        padding: 10px;
    }
    
    .chat-header h2 {
        font-size: 18px;
    }
    
    .chat-messages {
        padding: 10px;
        gap: 10px;
    }
    
    .message {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .chat-input-area {
        padding: 8px;
    }
}

/* Chat entrance animations - adjust for mobile */
@media (max-width: 768px) {
    .user-avatar-entrance {
        animation: slideInFromTop 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
    }
    
    .partner-avatar-entrance {
        animation: slideInFromBottom 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
    }
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Chat Avatar Container */
.chat-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 15px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #333;
    margin-bottom: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.chat-avatar-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.chat-avatar-container h3 {
    margin: 0 0 15px 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    color: #333;
    font-size: 22px;
    position: relative;
    padding-bottom: 8px;
}

.chat-avatar-container h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 3px;
}

.chat-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #333;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.chat-avatar:hover {
    transform: scale(1.05) rotate(5deg);
}

.user-info, .partner-info {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.user-status, .partner-status {
    display: inline-block;
    padding: 5px 12px;
    background-color: #4CAF50;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin: 5px 0;
    border: 2px solid #333;
}

.partner-bio {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 10px;
    border: 2px dashed #4A90E2;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

/* Chat Window Styling */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-bottom: 3px solid #333;
    border-radius: 15px 15px 0 0;
}

.chat-header h2 {
    margin: 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    color: #333;
    font-size: 24px;
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.secondary-button {
    padding: 8px 16px;
    background-color: #f44336;
    color: white;
    border: 2px solid #333;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 3px 0 #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.secondary-button:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #333;
}

.secondary-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 #333;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f9f9f9;
    /* Removed left and right borders */
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: #c7ceea #f9f9f9;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #c7ceea;
    border-radius: 10px;
    border: 2px solid #f9f9f9;
}

.system-message {
    align-self: center;
    background-color: #fff8e1;
    border: 3px solid #ffc107;
    border-radius: 15px;
    padding: 15px 25px;
    margin: 15px 0;
    text-align: center;
    font-size: 16px;
    color: #333;
    max-width: 85%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: pulse 2s infinite;
}

.system-message::before {
    content: "⚠️ IMPORTANT";
    display: block;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
    color: #e65100;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.system-message p {
    margin: 8px 0;
    line-height: 1.5;
}

.system-message p:last-child {
    font-weight: bold;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 193, 7, 0.4);
    }
    100% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
}

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
    margin-bottom: 5px;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid #333;
}

.user-message {
    align-self: flex-end;
    background-color: #E2F0CB;
    border-bottom-right-radius: 5px;
}

.partner-message {
    align-self: flex-start;
    background-color: #C7CEEA;
    border-bottom-left-radius: 5px;
}

.message-sender {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 5px;
    display: block;
    color: #555;
}

.message-text {
    margin: 0;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    color: #777;
    display: block;
    text-align: right;
    margin-top: 5px;
}

.typing-indicator {
    align-self: flex-start;
    background-color: #f0f0f0;
    border-radius: 18px;
    padding: 10px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #ddd;
}

.typing-text {
    font-size: 14px;
    color: #666;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.5s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

.chat-input-area {
    padding: 15px;
    background-color: #fff;
    border-top: 3px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 15px;
    resize: none;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
}

#message-input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.primary-button {
    padding: 12px 20px;
    background-color: #4CAF50;
    color: white;
    border: 2px solid #333;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 0 #333;
    display: flex;
    align-items: center;
    gap: 5px;
    height: fit-content;
}

.primary-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #333;
}

.primary-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #333;
}

/* Debriefing Container Styling */
.debriefing-container {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 0 0 6px #f0f0f0;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
    text-align: center;
    transition: all 0.8s ease-out;
}

.debriefing-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 5px 5px 0 0;
}

.debriefing-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #c7ceea #f9f9f9;
}

.debriefing-content::-webkit-scrollbar {
    width: 8px;
}

.debriefing-content::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 10px;
}

.debriefing-content::-webkit-scrollbar-thumb {
    background-color: #c7ceea;
    border-radius: 10px;
    border: 2px solid #f9f9f9;
}

.debriefing-title {
    color: #444;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    position: relative;
    display: inline-block;
}

.debriefing-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 4px;
}

.debriefing-section {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 15px;
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    text-align: left;
}

.debriefing-section:hover {
    background-color: #f0f8ff;
    border-color: #c7ceea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.debriefing-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #444;
    font-size: 22px;
    font-weight: bold;
    position: relative;
    display: inline-block;
}

.debriefing-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 3px;
}

.debriefing-section p {
    margin: 10px 0;
    line-height: 1.6;
    color: #555;
    font-size: 16px;
}

.debriefing-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

#download-data-button {
    padding: 14px 24px;
    background-color: #4A90E2;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 0 #333, 0 7px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

#download-data-button:hover {
    background-color: #5A9FF2;
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

#download-data-button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

#exit-study-button {
    padding: 14px 24px;
    background-color: #FF6B6B;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 0 #333, 0 7px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

#exit-study-button:hover {
    background-color: #FF8E8E;
    transform: translateY(-3px);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

#exit-study-button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

/* Animation for debriefing sections */
.debriefing-section:nth-child(1) { animation: slideIn 0.5s ease-out 0.1s both; }
.debriefing-section:nth-child(2) { animation: slideIn 0.5s ease-out 0.2s both; }
.debriefing-section:nth-child(3) { animation: slideIn 0.5s ease-out 0.3s both; }
.debriefing-section:nth-child(4) { animation: slideIn 0.5s ease-out 0.4s both; }
.debriefing-section:nth-child(5) { animation: slideIn 0.5s ease-out 0.5s both; }

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* End chat active state */
.end-chat-active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* Responsive adjustments for debriefing */
@media (max-width: 768px) {
    .debriefing-container {
        padding: 20px;
        margin: 10px;
        max-width: 100%;
    }
    
    .debriefing-title {
        font-size: 24px;
    }
    
    .debriefing-section {
        padding: 15px;
    }
    
    .debriefing-section h2 {
        font-size: 18px;
    }
    
    .debriefing-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    #download-data-button, #exit-study-button {
        width: 100%;
    }
}

/* Custom Alert Modal Styling */
.custom-alert .alert-content {
    max-width: 450px;
    border-radius: 8px;
    border-top: 5px solid #ff4d4d;
}

.custom-alert .alert-header {
    background-color: #fff;
    color: #333;
    border-bottom: 1px solid #eee;
}

.custom-alert .alert-icon {
    margin-right: 8px;
}

.custom-alert .alert-body {
    padding: 20px;
    font-size: 16px;
}

.custom-alert .alert-footer {
    border-top: 1px solid #eee;
    padding: 15px;
    text-align: right;
}

.missing-question {
    animation: pulse-error 1.5s infinite;
    border-left: 4px solid #ff4d4d;
    background-color: rgba(255, 77, 77, 0.05);
}

@keyframes pulse-error {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* Logo and Landing Page Styling */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    position: relative;
}

.logo {
    position: relative;
    width: 50vw;
    height: 50vw;
    max-width: 500px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border-radius: 50%;
    transition: all 2s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    overflow: visible;
}

.logo:hover {
    transform: translateY(-8px) scale(1.08) rotate(5deg);
}

.logo:active {
    transform: translateY(3px) scale(0.95);
}

.logo-image {
    width: 100%;
    height: auto;
    z-index: 2;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.2));
    transition: all 2s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: float 6s ease-in-out infinite;
}

.logo:hover .logo-image {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.25)) brightness(1.05);
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(8px) rotate(-2deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199,206,234,0.7) 0%, rgba(199,206,234,0) 70%);
    z-index: 1;
    opacity: 0.7;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* Updated landing instruction styles */
.landing-instruction {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-top: -10px; /* Moved up closer to logo */
    padding: 12px 25px;
    background-color: #C7CEEA; /* Changed to match logo's blue color */
    border: 3px solid #333;
    border-radius: 30px;
    box-shadow: 0 5px 0 #333, 0 8px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    transform: rotate(-2deg);
    transition: all 2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.landing-instruction::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 15px 15px 15px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

.landing-instruction::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 12px 12px 12px;
    border-style: solid;
    border-color: transparent transparent #C7CEEA transparent;
    transition: all 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover + .landing-instruction {
    transform: rotate(2deg) translateY(-3px);
    box-shadow: 0 8px 0 #333, 0 12px 20px rgba(0, 0, 0, 0.2);
}

@keyframes bounce-text {
    0% {
        transform: translateY(0) rotate(-2deg);
    }
    40% {
        transform: translateY(-10px) rotate(-2deg);
    }
    60% {
        transform: translateY(-5px) rotate(-2deg);
    }
    100% {
        transform: translateY(0) rotate(-2deg);
    }
}

.landing-instruction {
    animation: bounce-text 3s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .landing-instruction {
        font-size: 1.2rem;
        padding: 10px 20px;
        margin-top: -5px; /* Less negative margin on smaller screens */
    }
}

@media (max-width: 480px) {
    .landing-instruction {
        font-size: 1rem;
        padding: 8px 16px;
        margin-top: 0; /* No negative margin on very small screens */
    }
}

/* Small logo styling for avatar creation page */
.small-logo {
    width: 20vw;
    height: 20vw;
    max-width: 150px;
    max-height: 150px;
    position: fixed;
    bottom: -20px;  /* Increased from 20px to 30px */
    left: 20px;    /* Increased from 20px to 30px */
    z-index: 100;
    transition: all 0.5s ease;
}

.small-logo .logo-image {
    width: 100%;
    height: auto;
}

.small-logo .logo-pulse {
    width: 100%;
    height: 100%;
}

.avatar-page-logo {
    position: fixed;
    bottom: 30px;  /* Increased from 20px to 30px */
    left: 30px;    /* Increased from 20px to 30px */
    z-index: 100;
    margin: 0;     /* Ensure no margin is affecting position */
    padding: 0;    /* Ensure no padding is affecting position */
}


/* Responsive adjustments for small logo */
@media (min-width: 1200px) {
    .small-logo {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 992px) {
    .small-logo {
        width: 100px;
        height: 100px;
        bottom: 15px;
        left: 15px;
    }
}

/* Hide small logo on mobile devices */
@media (max-width: 768px) {
    .small-logo,
    .avatar-page-logo,
    .instructions-logo {
        display: none !important;
    }
}

/* Animation for avatar creation elements */
.avatar-container {
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#confirm-avatar-button {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Instructions Container Styling */
.instructions-container {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 700px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 0 0 6px #f0f0f0;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.instructions-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 5px 5px 0 0;
}

.instructions-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #c7ceea #f9f9f9;
}

.instructions-content::-webkit-scrollbar {
    width: 8px;
}

.instructions-content::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 10px;
}

.instructions-content::-webkit-scrollbar-thumb {
    background-color: #c7ceea;
    border-radius: 10px;
    border: 2px solid #f9f9f9;
}

.instructions-logo {
    width: auto;
    margin: 0 auto 20px;
    position: relative;
    top: 0;
}

.small-logo {
    width: 120px;
    height: 120px;
    max-width: 120px;
    max-height: 120px;
}

.instructions-title {
    color: #444;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    position: relative;
    display: inline-block;
}

.instructions-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 4px;
}

.instructions-section {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 15px;
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    text-align: left;
}

.instructions-section:hover {
    background-color: #f0f8ff;
    border-color: #c7ceea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.instructions-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #444;
    font-size: 22px;
    font-weight: bold;
    position: relative;
    display: inline-block;
}

.instructions-section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 3px;
}

.instructions-section p {
    margin: 10px 0;
    line-height: 1.6;
    color: #555;
    font-size: 16px;
}

.instructions-section ol, 
.instructions-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.instructions-section li {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #555;
}

.instructions-actions {
    margin-top: 30px;
    text-align: center;
}

#start-experience-button {
    padding: 14px 28px;
    background-color: #4CAF50;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 6px 0 #333, 0 8px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 20px auto;
}

#start-experience-button:hover:not(:disabled) {
    background-color: #5FBF63;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 9px 0 #333, 0 12px 15px rgba(0, 0, 0, 0.25);
}

#start-experience-button:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

/* Disabled state styling */
#start-experience-button:disabled {
    background-color: #cccccc;
    color: #888888;
    border-color: #999999;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 0 #999999, 0 6px 8px rgba(0, 0, 0, 0.1);
    opacity: 0.8;
}

#start-experience-button:disabled::after {
    content: "📄";
    position: absolute;
    right: 15px;
    font-size: 16px;
    opacity: 0.7;
}

/* Add a subtle animation to draw attention to the disabled state */
@keyframes pulseDisabled {
    0% { opacity: 0.8; }
    50% { opacity: 0.6; }
    100% { opacity: 0.8; }
}

#start-experience-button:disabled {
    animation: pulseDisabled 2s infinite ease-in-out;
}

/* Animation for instructions sections */
.instructions-section:nth-child(1) { animation: slideIn 0.5s ease-out 0.1s both; }
.instructions-section:nth-child(2) { animation: slideIn 0.5s ease-out 0.2s both; }
.instructions-section:nth-child(3) { animation: slideIn 0.5s ease-out 0.3s both; }
.instructions-section:nth-child(4) { animation: slideIn 0.5s ease-out 0.4s both; }

/* Responsive adjustments for instructions */
@media (max-width: 768px) {
    .instructions-container {
        padding: 20px;
        margin: 10px;
        max-width: 100%;
    }
    
    .instructions-title {
        font-size: 24px;
    }
    
    .instructions-section {
        padding: 15px;
    }
    
    .small-logo {
        width: 80px;
        height: 80px;
        max-width: 80px;
        max-height: 80px;
    }
    
    #start-experience-button {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Small logo styling for instructions page */
.instructions-logo {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    margin: 0;
    padding: 0;
}

.small-logo {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
    transition: all 0.3s ease;
}

.small-logo .logo-image {
    width: 100%;
    height: auto;
}

.small-logo .logo-pulse {
    width: 100%;
    height: 100%;
}

.small-logo:hover {
    transform: scale(1.1) rotate(5deg);
}
/* Make sure the logo doesn't interfere with content on small screens */
@media (max-width: 768px) {
    .instructions-logo {
        bottom: 10px;
        left: 10px;
    }
    
    .small-logo {
        width: 80px;
        height: 80px;
        max-width: 80px;
        max-height: 80px;
    }
}

@media (max-width: 480px) {
    .instructions-logo {
        bottom: 5px;
        left: 5px;
    }
    
    .small-logo {
        width: 60px;
        height: 60px;
        max-width: 60px;
        max-height: 60px;
    }
}

.toggle-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.disabled-label {
    font-size: 0.7em;
    color: #888;
    display: block;
    margin-top: 2px;
}

.toggle-button.disabled:hover {
    transform: none !important;
    background-color: #f0f0f0 !important;
}

/* Chat Timer Styling */
.chat-timer {
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 15px;
    padding: 5px 12px;
    font-size: 18px;
    font-weight: bold;
    font-family: monospace;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: inline-block;
    transition: all 0.3s ease;
}

.timer-warning {
    background-color: #ffecb3;
    color: #e65100;
    animation: timerPulse 1s infinite alternate;
    border-color: #e65100;
}

@keyframes timerPulse {
    from {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(230, 81, 0, 0.3);
    }
    to {
        transform: scale(1.05);
        box-shadow: 0 2px 10px rgba(230, 81, 0, 0.5);
    }
}

/* Discussion Question Styling */
.discussion-question {
    font-weight: bold;
    color: #333;
    background-color: #f0f8ff;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid #c7ceea;
    margin: 15px 0;
    font-size: 1.1em;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.discussion-question::before {
    content: '💬';
    position: absolute;
    left: -5px;
    top: -10px;
    background: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #c7ceea;
    font-size: 0.9em;
}

/* Response Styling */
.partner-bio, .user-info p, .partner-info p {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #555;
}

.response {
    background-color: #f9f9f9;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #FF9AA2;
    font-size: 0.9em;
    color: #444;
    margin-top: 8px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.response:hover {
    background-color: #f5f5f5;
    transform: translateX(2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Improve user and partner info sections */
.user-info, .partner-info {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #eee;
    width: 100%;
}

/* System Message - Topic Change Styling */
.system-message.topic-change {
    background-color: #e3f2fd;
    border: 3px solid #2196f3;
    animation: topicChangePulse 2s infinite;
}

.system-message.topic-change::before {
    content: "🔄 NEW TOPIC";
    color: #0d47a1;
}

@keyframes topicChangePulse {
    0% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(33, 150, 243, 0.4);
    }
    100% {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Enhanced Timer Styling */
.timer-critical {
    background-color: #ffcdd2;
    color: #d32f2f;
    animation: criticalTimerPulse 0.5s infinite alternate;
    border-color: #d32f2f;
    font-size: 20px;
}

@keyframes criticalTimerPulse {
    from {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(211, 47, 47, 0.3);
    }
    to {
        transform: scale(1.1);
        box-shadow: 0 2px 10px rgba(211, 47, 47, 0.6);
    }
}

/* Halfway Point Indicator */
.halfway-indicator {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff9800;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 2px solid #333;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

/* Post-Chat Questions Styling */
.post-chat-container {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15), 0 0 0 6px #f0f0f0;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
    text-align: center;
    transition: all 0.8s ease-out;
}

.post-chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #FF9AA2, #FFB7B2, #FFDAC1, #E2F0CB, #B5EAD7, #C7CEEA);
    border-radius: 5px 5px 0 0;
}

.post-chat-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #c7ceea #f9f9f9;
}

.post-chat-content::-webkit-scrollbar {
    width: 8px;
}

.post-chat-content::-webkit-scrollbar-track {
    background: #f9f9f9;
    border-radius: 10px;
}

.post-chat-content::-webkit-scrollbar-thumb {
    background-color: #c7ceea;
    border-radius: 10px;
    border: 2px solid #f9f9f9;
}

.post-chat-title {
    color: #444;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    position: relative;
    display: inline-block;
}

.post-chat-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FFB7B2, #FFDAC1);
    border-radius: 4px;
}

.post-chat-instruction {
    font-size: 18px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.5;
}

.post-chat-question {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 15px;
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    text-align: left;
}

.post-chat-question:hover {
    background-color: #f0f8ff;
    border-color: #c7ceea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-chat-question h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #444;
    font-size: 20px;
    font-weight: bold;
}

.post-chat-question .likert-scale {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.post-chat-question .likert-scale label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 5px;
    border-radius: 8px;
    background-color: #fff;
    border: 2px solid #ddd;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.85em;
    flex: 1;
    min-width: 80px;
}

.post-chat-question .likert-scale label:hover {
    background-color: #f0f8ff;
    border-color: #c7ceea;
    transform: translateY(-5px);
}

.post-chat-question .likert-scale input[type="radio"] {
    margin-bottom: 5px;
    cursor: pointer;
}

/* Responsive adjustments for horizontal likert scale */
@media (max-width: 768px) {
    .post-chat-question .likert-scale {
        flex-direction: column;
        gap: 8px;
    }
    
    .post-chat-question .likert-scale label {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .post-chat-question .likert-scale input[type="radio"] {
        margin-right: 10px;
        margin-bottom: 0;
    }
}

.post-chat-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* Animation for post-chat questions */
.post-chat-question:nth-child(1) { animation: slideIn 0.5s ease-out 0.1s both; }
.post-chat-question:nth-child(2) { animation: slideIn 0.5s ease-out 0.2s both; }

/* Responsive adjustments for post-chat questions */
@media (max-width: 768px) {
    .post-chat-container {
        padding: 20px;
        margin: 10px;
        max-width: 100%;
    }
    
    .post-chat-title {
        font-size: 24px;
    }
    
    .post-chat-question {
        padding: 15px;
    }
    
    .post-chat-question h3 {
        font-size: 18px;
    }
    
    .post-chat-question .likert-scale {
        gap: 5px;
    }
    
    .post-chat-question .likert-scale label {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* Study Information Leaflet Modal Styling */
.study-info-modal {
    z-index: 1001; /* Ensure it appears above other modals */
}

.study-leaflet-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border: 4px solid #333;
    border-radius: 20px;
    width: 85%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
}

.study-info-modal .modal-header {
    background: linear-gradient(90deg, #4A90E2, #5A9FF2);
    color: white;
    padding: 15px 20px;
    position: relative;
    border-bottom: 3px solid #333;
}

.study-info-modal .modal-header h2 {
    margin: 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 24px;
    text-align: center;
}

.close-study-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close-study-modal:hover {
    transform: rotate(90deg) scale(1.2);
}

.study-leaflet-content {
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.study-leaflet-content h3 {
    color: #4A90E2;
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.leaflet-section {
    margin-bottom: 25px;
    padding: 15px;
    border-radius: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.leaflet-section:hover {
    background-color: #f0f8ff;
    border-color: #c7ceea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.leaflet-section h4 {
    color: #4A90E2;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.leaflet-section p, 
.leaflet-section ul, 
.leaflet-section ol {
    margin: 10px 0;
    color: #555;
}

.leaflet-section ul, 
.leaflet-section ol {
    padding-left: 25px;
}

.leaflet-section li {
    margin-bottom: 8px;
}

.study-leaflet-confirmation {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background-color: #e8f5e9;
    border: 2px solid #4CAF50;
    text-align: left;
}

.confirmation-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.confirmation-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-text {
    font-weight: bold;
    color: #4CAF50;
}

#confirm-study-leaflet-read {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 0 #333, 0 7px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#confirm-study-leaflet-read:hover:not(:disabled) {
    background-color: #5FBF63;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 0 #333, 0 10px 15px rgba(0, 0, 0, 0.25);
}

#confirm-study-leaflet-read:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #333, 0 4px 5px rgba(0, 0, 0, 0.15);
}

#confirm-study-leaflet-read:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    transform: none;
}

/* Information leaflet section in instructions */
.information-leaflet-section {
    background-color: #e3f2fd;
    border: 2px solid #4A90E2;
    text-align: center; /* Center all content in this section */
}

.information-leaflet-section h2 {
    color: #1565C0;
    text-align: left; /* Keep the heading left-aligned */
}

.information-leaflet-section h2::after {
    background: linear-gradient(90deg, #4A90E2, #5A9FF2);
}

.information-leaflet-section p {
    text-align: left; /* Keep paragraph text left-aligned */
}

#study-information-leaflet-btn {
    padding: 12px 24px;
    background-color: #4A90E2;
    color: white;
    border: 3px solid #333;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 5px 0 #333, 0 7px 10px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 15px auto; /* Center the button with auto margins */
}

/* Consent Statement Styling */
.study-consent-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 10px;
    border-left: 5px solid #4A90E2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.study-consent-section h4 {
    color: #1565C0;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 2px solid #c7ceea;
    padding-bottom: 8px;
}

.consent-items {
    padding-left: 25px;
    margin: 15px 0;
}

.consent-items li {
    margin-bottom: 12px;
    line-height: 1.5;
    position: relative;
    padding-left: 5px;
}

.consent-items li::before {
    content: '✓';
    color: #4CAF50;
    font-weight: bold;
    display: inline-block;
    margin-right: 8px;
}

/* Improve the existing confirmation checkbox */
.study-leaflet-confirmation {
    margin-top: 25px;
    padding: 15px;
    background-color: #e9f0fd;
    border-radius: 8px;
    border: 2px solid #4A90E2;
    transition: all 0.3s ease;
}

.study-leaflet-confirmation:hover {
    background-color: #d4e4fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments for matching container */
@media (max-width: 768px) {
    .matching-container {
        padding: 20px;
        margin: 15px;
        max-width: 100%;
        border-radius: 15px;
    }
    
    .matching-status h2 {
        font-size: 24px;
    }
    
    .matching-message {
        min-width: auto;
        width: 100%;
        font-size: 16px;
        padding: 8px 12px;
    }
    
    .loading-animation {
        margin: 20px auto;
        height: 80px;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
}

@media (max-width: 480px) {
    .matching-container {
        padding: 15px;
        margin: 10px;
    }
    
    .matching-status h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .matching-message {
        font-size: 14px;
    }
    
    .loading-animation {
        height: 60px;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    
    .ripple {
        width: 30px;
        height: 30px;
    }
}

/* LLM-Augmented Section Styling */
.llm-augmented-section {
    margin-top: 25px;
    text-align: center;
}

.llm-augmented-option {
    padding: 20px;
    border-radius: 15px;
    background-color: #f0f8ff;
    border: 3px solid #4A90E2;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.llm-augmented-option:hover {
    background-color: #e6f2ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.llm-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.llm-checkbox-label:hover {
    color: #4A90E2;
    transform: translateX(5px);
}

.llm-checkbox-label input[type="checkbox"] {
    margin-right: 15px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: white;
    border: 3px solid #333;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 0 #333;
}

.llm-checkbox-label input[type="checkbox"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #333;
    background-color: #f0f8ff;
}

.llm-checkbox-label input[type="checkbox"]:checked {
    background-color: #4CAF50;
    border-color: #333;
    transform: translateY(1px);
    box-shadow: 0 2px 0 #333;
}

.llm-checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    animation: checkmarkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkmarkPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.checkbox-custom {
    /* This span is for potential custom checkbox styling if needed */
    display: none;
}

.checkbox-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
}

.llm-checkbox-label:hover .checkbox-text {
    color: #4A90E2;
}

.llm-checkbox-label input[type="checkbox"]:checked ~ .checkbox-text {
    color: #4CAF50;
}

.llm-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    text-align: center;
    font-style: italic;
    margin: 0;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 2px dashed #c7ceea;
    transition: all 0.3s ease;
}

.llm-description:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: #4A90E2;
    transform: translateY(-2px);
}

/* Responsive adjustments for LLM section */
@media (max-width: 768px) {
    .llm-checkbox-label {
        font-size: 16px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .llm-checkbox-label input[type="checkbox"] {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .llm-description {
        font-size: 13px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .llm-augmented-option {
        padding: 15px;
    }
    
    .llm-checkbox-label {
        font-size: 14px;
    }
    
    .llm-checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .llm-description {
        font-size: 12px;
    }
}

/* Message Input Container */
.message-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.input-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    justify-content: flex-end; /* Align send button to the right when LLM button is not present */
}

.input-buttons .secondary-button,
.input-buttons .primary-button {
    white-space: nowrap;
    min-width: auto;
}

/* LLM Assist Button */
.llm-assist {
    background-color: #9B59B6;
    border-color: #333;
}

.llm-assist:hover:not(:disabled) {
    background-color: #A569BD;
}

.llm-assist:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
}

/* LLM Suggestion Container */
.llm-suggestion-container {
    background-color: #f8f9fa;
    border: 3px solid #9B59B6;
    border-radius: 15px;
    padding: 15px;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.llm-suggestion-container.loading {
    border-color: #FFA500;
    background-color: #FFF8DC;
}

.llm-suggestion-container.error {
    border-color: #FF6B6B;
    background-color: #FFE6E6;
}

.llm-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px dashed #ddd;
}

.llm-suggestion-header h4 {
    margin: 0;
    color: #9B59B6;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-size: 16px;
}

.close-suggestion {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-suggestion:hover {
    color: #666;
    transform: rotate(90deg);
}

.llm-suggestion-content {
    margin: 10px 0;
}

.llm-suggestion-content p {
    margin: 0;
    padding: 10px;
    background-color: white;
    border-radius: 8px;
    border: 2px solid #eee;
    line-height: 1.4;
    color: #555;
}

.llm-suggestion-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
    flex-wrap: wrap;
}

.llm-suggestion-actions button {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tertiary-button {
    background-color: #f44336;
    color: white;
    box-shadow: 0 3px 0 #333;
}

.tertiary-button:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #333;
}

.tertiary-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 #333;
}

/* Notification */
.notification {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 8px;
    border: 2px solid #333;
    font-weight: bold;
    text-align: center;
    animation: notificationSlide 0.3s ease-out;
}

.notification-info {
    background-color: #E3F2FD;
    color: #1976D2;
}

.notification-error {
    background-color: #FFEBEE;
    color: #D32F2F;
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .input-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .llm-suggestion-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .llm-suggestion-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* When only send button is present */
.input-buttons:has(button:only-child) {
    justify-content: flex-end;
}

/* When both buttons are present */
.input-buttons:has(button:not(:only-child)) {
    justify-content: space-between;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(button)) {
    .input-buttons {
        justify-content: flex-end;
    }
    
    .input-buttons .llm-assist {
        margin-right: auto;
    }
}

.llm-rationale-section,
.llm-response-section {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
}

.llm-rationale-section {
    border-left: 3px solid #ffd700; /* Gold border for rationale */
}

.llm-response-section {
    border-left: 3px solid #4CAF50; /* Green border for response */
}

.llm-rationale-section h5,
.llm-response-section h5 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
}

.llm-rationale-section p,
.llm-response-section p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

#llm-rationale-text {
    font-style: italic;
    color: #888;
}

#llm-response-text {
    font-weight: 500;
    color: #333;
}

/* Loading and error states */
.llm-suggestion-container.loading .llm-rationale-section {
    display: none;
}

.llm-suggestion-container.error .llm-rationale-section {
    display: none;
}
