:root {
    --message-spacing: 1rem;
    --message-radius: 1rem;
    --chat-max-width: 1000px;
    --custom-green: #639407; /* Green for KinglyTouch.com branding */
    --custom-orange: #f2700a; /* Orange accent for KinglyTouch.com */
    --custom-light-green: #75b009; /* Lighter green for hover states */
    --custom-dark-orange: #d86409; /* Darker orange for contrast */
    --cream-bg: #fdf7f2; /* Cream background for better readability */
    --text-dark: #222222; /* Dark text for better contrast */
    --font-family: 'Open Sans', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: var(--text-dark);
    font-family: var(--font-family);
    line-height: 1.6;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.chat-container {
    max-width: var(--chat-max-width);
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(76,175,80,0.05), rgba(255,165,0,0.05));
    border: 2px solid var(--custom-orange);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(76,175,80,0.1);
}

.messages-container {
    height: 70vh;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: var(--message-spacing);
    background: var(--cream-bg);
    border-radius: var(--message-radius);
    margin-bottom: 1.5rem;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--message-spacing);
    animation: fadeIn 0.3s ease-in;
    max-width: 90%;
}

.message-content {
    padding: 1.25rem;
    border-radius: var(--message-radius);
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 1.1rem;
}

.user-message {
    align-self: flex-end;
    margin-left: auto;
}

.user-message .message-content {
    background: var(--custom-green);
    color: white;
    border-radius: var(--message-radius) 0 var(--message-radius) var(--message-radius);
}

.bot-message {
    align-self: flex-start;
    margin-right: auto;
}

.bot-message .message-content {
    background: var(--custom-orange);
    color: var(--text-dark); /* Darker text for better readability */
    border-radius: 0 var(--message-radius) var(--message-radius) var(--message-radius);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0 1.5rem;
    width: 100%;
}

.quiz-option {
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    border-radius: var(--message-radius);
    background: var(--cream-bg);
    border: 2px solid var(--custom-green);
    transition: all 0.2s ease;
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
}

.quiz-option:hover {
    background: var(--custom-green);
    color: white;
    border-color: var(--custom-orange);
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--custom-green);
    border-color: var(--custom-orange);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--custom-light-green);
    border-color: var(--custom-dark-orange);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Special styling for start button */
#start-quiz {
    border-width: 3px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

#start-quiz:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.5s;
}

#start-quiz:hover:before {
    left: 100%;
}

.btn-outline-primary {
    color: var(--custom-green);
    border-color: var(--custom-green);
}

.btn-outline-primary:hover {
    background-color: var(--custom-green);
    border-color: var(--custom-orange);
    color: white;
}

.progress-bar {
    background-color: var(--custom-green);
}

.input-group {
    background: transparent;
    padding: 1rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 -2px 10px rgba(76,175,80,0.1);
}

#user-input {
    border-radius: var(--message-radius) 0 0 var(--message-radius);
    background: rgba(255,255,255,0.95);
    border: 2px solid var(--custom-orange);
    color: var(--text-dark);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
}

#user-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(76,175,80,0.25);
    border-color: var(--custom-green);
    background: white;
}

#send-button {
    border-radius: 0 var(--message-radius) var(--message-radius) 0;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    background-color: var(--custom-green);
    border-color: var(--custom-orange);
    color: white;
}

.card {
    border: 2px solid var(--custom-orange);
    background: var(--cream-bg);
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
    line-height: 1.6;
}

.alert-info {
    background-color: rgba(76,175,80,0.1);
    border-color: var(--custom-orange);
    color: var(--text-dark);
}

.list-group-item {
    background: var(--cream-bg);
    border-color: var(--custom-green);
    color: var(--text-dark);
    padding: 1rem 1.25rem;
    line-height: 1.5;
    font-size: 1.05rem;
}

/* Styling for resource buttons */
.btn-outline-success {
    color: var(--custom-green);
    border-color: var(--custom-green);
    background-color: rgba(76,175,80,0.05);
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.btn-outline-success:hover {
    background-color: var(--custom-green);
    color: white;
    border-color: var(--custom-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Header styling */
header h1 {
    color: var(--custom-orange);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

header .lead {
    color: var(--text-dark);
    font-size: 1.3rem;
    line-height: 1.5;
}

/* Card styling enhancements */
.card-body {
    padding: 1.5rem;
}

.resource-links h5 {
    color: var(--custom-green);
    font-weight: bold;
    margin-bottom: 0.75rem;
}

/* Success alert customization */
.alert-success {
    background-color: rgba(76,175,80,0.1);
    border-color: var(--custom-orange);
    color: var(--text-dark);
}

.alert-success .alert-heading {
    color: var(--custom-orange);
}

.card-title {
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
}

h4, h5, h6 {
    line-height: 1.4;
    margin-bottom: 1rem;
    letter-spacing: 0.3px;
}

/* Question and answer text styling */
#question-text {
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--custom-dark-orange);
}

#options-container button {
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: left;
    padding: 1rem 1.25rem;
}

p, .card-text, .list-group-item, .alert {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Form label styling */
label {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations for Premium Button and Tab */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(242, 112, 10, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(242, 112, 10, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 112, 10, 0); }
}

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

.pulse-highlight {
    animation: pulse 2s infinite;
    background-color: var(--custom-orange) !important;
    color: white !important;
    border-color: var(--custom-orange) !important;
    font-weight: bold;
    box-shadow: 0 0 0 0 rgba(242, 112, 10, 1);
    transform: scale(1);
}

/* Make the interface more responsive on smaller screens */
@media (max-width: 768px) {
    .chat-container {
        padding: 1rem;
    }

    .messages-container {
        height: 65vh;
    }

    .message {
        max-width: 95%;
    }
    
    h1, .h1 {
        font-size: 1.8rem;
    }
    
    h2, .h2 {
        font-size: 1.6rem;
    }
    
    h3, .h3 {
        font-size: 1.4rem;
    }
    
    h4, .h4 {
        font-size: 1.25rem;
    }
    
    p, .card-text, .list-group-item {
        font-size: 1rem;
    }
    
    #question-text {
        font-size: 1.15rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}
