* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    min-height: 100vh;
}

.header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #25d366, #128c7e);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1rem;
}

.creator-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    border: 1px solid #e5e7eb;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-label {
    font-weight: 500 !important;
    cursor: pointer;
    margin: 0;
}

#includeUser {
    width: auto;
    margin: 0;
}

.user-name-input {
    margin-top: 8px;
}

.user-name-input input {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.generate-btn {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.generate-btn.loading .btn-text {
    opacity: 0.7;
}

.generate-btn.loading .loading-spinner {
    display: inline-block;
}

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

.chat-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: #075e54;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.group-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.group-details p {
    font-size: 0.85rem;
    opacity: 0.8;
}

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

.export-btn,
.new-chat-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover,
.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.messages-container {
    flex: 1;
    padding: 20px;
    min-height: 500px;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f0f0f0' fill-opacity='0.3'%3E%3Cpath d='m0 40l40-40h-40v40zm40 0v-40h-40l40 40z'/%3E%3C/g%3E%3C/svg%3E");
    overflow-y: auto;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.welcome-message h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.message {
    margin-bottom: 16px;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    display: flex;
    justify-content: flex-end;
}

.message.sent .message-bubble {
    background: #dcf8c6;
    border-bottom-right-radius: 4px;
}

.message.sent .shared-image {
    margin-left: auto;
}

.message.received {
    display: flex;
    justify-content: flex-start;
}

.message.received .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.received .shared-image {
    margin-right: auto;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sender-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #25d366;
}

.message-time {
    font-size: 0.75rem;
    color: #667781;
    margin-top: 4px;
    text-align: right;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.system-message {
    text-align: center;
    margin: 20px 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #667781;
    font-style: italic;
}

.date-separator {
    text-align: center;
    margin: 24px 0 16px 0;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    font-size: 0.8rem;
    color: #667781;
    font-weight: 500;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}

.shared-image {
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 250px;
}

.shared-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .creator-panel {
        padding: 20px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .messages-container {
        padding: 15px;
        min-height: 400px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}