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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #111b21;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.phone-mockup {
    background-color: #0a1014;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    flex: 0 0 500px;
    max-width: 500px;
}

/* Chat Header */
.chat-header {
    background-color: #202c33;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-arrow {
    flex-shrink: 0;
}

.avatar-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6b7c85;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-input {
    background: none;
    border: none;
    font-size: 20px;
    width: 100%;
    text-align: center;
    cursor: pointer;
}

.header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.name-input {
    background: none;
    border: none;
    color: #e9edef;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    width: 100%;
}

.name-input::placeholder {
    color: #8696a0;
}

.status-input {
    background: none;
    border: none;
    color: #8696a0;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.header-actions {
    display: flex;
    gap: 20px;
}

.header-actions svg {
    cursor: pointer;
}

/* Menu Dropdown */
.menu-dropdown {
    position: relative;
}

.menu-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: #233138;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.menu-dropdown.active .menu-content {
    display: block;
}

.menu-item {
    padding: 12px 16px;
    color: #e9edef;
    font-size: 14px;
    font-weight: 500;
    background-color: #2a3942;
    border-bottom: 1px solid #374045;
}

.settings-panel {
    padding: 16px;
}

.settings-divider {
    height: 1px;
    background-color: #374045;
    margin: 16px 0;
}

/* Chat Messages Area */
.chat-messages {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQklEQVQYV2NkYGD4z0ABYBw1kL6KWRgYGP4jC/7//x9FDJtCdHFkRSiKsClEV4SiEJtCdEUoCrEpRFeEohCbQnRFABgPEwthyk2qAAAAAElFTkSuQmCC");
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Message Bubbles */
.message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

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

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

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

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

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

.received .message-bubble {
    background-color: #202c33;
    border-bottom-left-radius: 4px;
}

.message-input {
    background: none;
    border: none;
    color: #e9edef;
    font-size: 14.5px;
    line-height: 1.4;
    resize: none;
    outline: none;
    width: 100%;
    font-family: inherit;
    min-height: 20px;
}

.message-input::placeholder {
    color: #8696a0;
    font-style: italic;
}

.message-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.time-display {
    font-size: 11px;
    color: #8696a0;
}

.delete-message {
    position: absolute;
    top: -8px;
    background-color: #374045;
    color: #e9edef;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sent .delete-message {
    right: -8px;
}

.received .delete-message {
    left: -8px;
}

.message-wrapper:hover .delete-message {
    display: flex;
}

.delete-message:hover {
    background-color: #ff5252;
    transform: scale(1.1);
}

/* Chat Input Area */
.chat-input-area {
    background-color: #202c33;
    padding: 10px 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
    border-top: 1px solid #2a3942;
}

.add-message-btn {
    background-color: #00a884;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-message-btn:hover {
    background-color: #008f6f;
    transform: translateY(-1px);
}

.received-btn {
    background-color: #374045;
}

.received-btn:hover {
    background-color: #4a5460;
}

/* Form Actions */
.form-actions {
    background-color: #202c33;
    padding: 16px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #2a3942;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.setting-group label {
    color: #8696a0;
    font-size: 13px;
    min-width: 80px;
}

.setting-group input {
    flex: 1;
    background-color: #111b21;
    border: 1px solid #374045;
    color: #e9edef;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.setting-group input:focus {
    border-color: #00a884;
}

.render-button {
    flex: 1;
    background-color: #00a884;
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.render-button:hover {
    background-color: #008f6f;
}

.render-button:disabled {
    background-color: #374045;
    cursor: not-allowed;
}

/* Results Section */
.result-section {
    flex: 1;
    background-color: #0a1014;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.result-section h2 {
    color: #e9edef;
    margin-bottom: 16px;
    font-size: 18px;
}

.success {
    background-color: #00a88426;
    border: 1px solid #00a884;
    color: #4fdc9f;
    padding: 16px;
    border-radius: 8px;
}

.error {
    background-color: #ff525226;
    border: 1px solid #ff5252;
    color: #ff8a80;
    padding: 16px;
    border-radius: 8px;
}

.video-link {
    display: inline-block;
    margin-top: 12px;
    background-color: #00a884;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.video-link:hover {
    background-color: #008f6f;
}

.loading {
    text-align: center;
    color: #8696a0;
}

.spinner {
    border: 3px solid #374045;
    border-top: 3px solid #00a884;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #111b21;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #374045;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #4a5460;
}

/* Auto-resize textarea */
.message-input {
    overflow: hidden;
}

/* Video preview */
.video-container {
    background-color: #202c33;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.video-container video {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Responsive layout */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    
    .phone-mockup {
        flex: 1 1 auto;
        max-width: 100%;
    }
    
    .result-section {
        width: 100%;
    }
}