* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8f9fb;
    position: relative;
}
.header {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.chat-container {
    display: flex;
    flex-direction: column;
    max-width: 450px;
    width: 100%;
    height: 600px;
    margin: 2rem auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    max-width: 80%;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.bot-message {
    background-color: #f1f5fd;
    color: #333;
    border-top-left-radius: 0.25rem;
    align-self: flex-start;
}
.user-message {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    border-top-right-radius: 0.25rem;
    align-self: flex-end;
    margin-left: auto;
}
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.option-button {
    padding: 0.75rem 1rem;
    border: none;
    background-color: white;
    color: #3a7bd5;
    border-radius: 1rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    width: 100%;
}
.option-button:hover {
    background-color: #f1f5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.option-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f1f1;
    color: #999;
}
.option-button.disabled:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.input-container {
    display: flex;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background-color: white;
    position: relative;
}
#user-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 1.5rem;
    outline: none;
    font-size: 0.95rem;
    transition: border 0.3s;
}
#user-input:focus {
    border-color: #3a7bd5;
    box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.1);
}
#send-button {
    background: linear-gradient(135deg, #3a7bd5, #00d2ff);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
#send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
#send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.form-input {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
    width: 100%;
}
.complaint-template {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}
.complaint-template table {
    width: 100%;
    border-collapse: collapse;
}
.complaint-template td {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
}
.complaint-template td:first-child {
    font-weight: bold;
    width: 40%;
}
.note {
    font-style: italic;
    font-size: 0.875rem;
    margin-top: 1rem;
    color: #666;
}
.typing-animation {
    display: inline;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #333;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

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

/* Responsive design */
@media (max-width: 500px) {
    body {
        margin: 0;
        padding: 0;
        /* Remove overflow: hidden to allow scrolling */
        position: relative;
    }
    
    .header {
        padding: 0.75rem;
        position: sticky;
        top: 0;
        z-index: 100;
        width: 100%;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .chat-container {
        height: auto;
        min-height: calc(100vh - 60px); /* Adjust based on header height */
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        padding-bottom: 70px; /* Make space for the fixed input container */
    }
    
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 1rem;
    }
    
    .input-container {
        position: fixed;
        padding: 0.75rem;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: white;
        z-index: 10;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }
    
    #user-input {
        height: 2.5rem;
        font-size: 0.9rem;
    }
    
    #send-button {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem; /* Ensure button doesn't shrink */
    }
    
    .message {
        max-width: 85%;
    }
}

@media (min-width: 501px) {
    body {
        height: 100vh;
    }
    
    .chat-container {
        height: calc(100vh - 120px); /* Adjust for desktop */
        margin: 1rem auto;
    }
}
