:root {
    --primary-color: #4f46e5;
    --secondary-color: #818cf8;
    --background-dark: #1a1a1a;
    --background-light: #ffffff;
    --text-light: #f3f4f6;
    --text-dark: #1f2937;
    --card-bg-dark: #2d2d2d;
    --card-bg-light: #f9fafb;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    transition: var(--transition);
}

/* Light theme */
body.light-theme {
    background-color: var(--background-light);
    color: var(--text-dark);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.theme-icon {
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0;
}

section {
    background-color: var(--card-bg-dark);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

body.light-theme section {
    background-color: var(--card-bg-light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.form-section, .preview-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #4b5563;
    border-radius: var(--border-radius);
    background-color: #374151;
    color: var(--text-light);
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
}

body.light-theme input,
body.light-theme textarea,
body.light-theme select {
    background-color: #ffffff;
    color: var(--text-dark);
    border: 1px solid #d1d5db;
}

body.light-theme input:focus,
body.light-theme textarea:focus,
body.light-theme select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-secondary {
    background-color: #4b5563;
    color: white;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Slider Styles */
.slider-container {
    position: relative;
    overflow: hidden;
}

.slider {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonial-card {
    min-width: 100%;
    padding: 1.5rem;
    background-color: #374151;
    border-radius: var(--border-radius);
    margin: 0 1rem;
}

.slider-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.slider-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.slider-btn:hover {
    color: var(--primary-color);
}

/* Theme-specific styles */
.whatsapp-theme {
    max-width: 85%;
    margin: 0.5rem 0;
    padding: 0.8rem 1rem;
    border-radius: 7.5px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Chat bubble untuk pengirim (hijau) */
.whatsapp-theme.sender {
    background-color: #dcf8c6;
    color: #000;
    margin-left: auto;
    border-top-right-radius: 0;
}

/* Chat bubble untuk penerima (putih) */
.whatsapp-theme.receiver {
    background-color: #fff;
    color: #000;
    margin-right: auto;
    border-top-left-radius: 0;
}

/* Nama pengirim */
.whatsapp-theme .sender-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: #075e54;
}

/* Waktu pesan */
.whatsapp-theme .message-time {
    font-size: 0.7rem;
    color: #667781;
    margin-top: 0.3rem;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
}

/* Tanda centang */
.whatsapp-theme .message-time .check {
    color: #4fc3f7;
}

/* Container chat */
.whatsapp-chat-container {
    background-color: #e5ddd5;
    padding: 1rem;
    border-radius: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.speech-theme {
    background-color: #fff;
    color: #000;
    padding: 1rem;
    border-radius: 10px;
    position: relative;
}

.speech-theme::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #fff transparent transparent;
}

.facebook-theme {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Output Section */
#outputContainer {
    margin-top: 1rem;
    width: 100%;
}

#htmlOutput {
    width: 100%;
    min-height: 200px;
    margin: 1rem 0;
    font-family: monospace;
    white-space: pre-wrap;
    background-color: #374151;
    color: var(--text-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #4b5563;
    resize: vertical;
}

#copyBtn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Footer Styles */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
}

.footer p {
    font-size: 13px;
    color: #999;
    margin: 0;
    line-height: 1.4;
}

.footer a {
    color: #999;
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Light theme styles */
body.light-theme .footer p,
body.light-theme .footer a {
    color: #666;
}

body.light-theme .footer a:hover {
    color: var(--primary-color);
}

body.light-theme h2 {
    color: var(--text-dark);
}

body.light-theme .slider-btn {
    color: var(--text-dark);
}

body.light-theme .testimonial-card {
    background-color: #f3f4f6;
    color: var(--text-dark);
}

body.light-theme #htmlOutput {
    background-color: #f9fafb;
    color: var(--text-dark);
    border: 1px solid #d1d5db;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 1rem;
    }
    
    .main-content {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    section {
        padding: 1rem;
    }
    
    #htmlOutput {
        font-size: 14px;
    }
    
    .footer {
        margin-top: 30px;
        padding: 15px 10px;
    }
    
    .footer p {
        font-size: 12px;
        padding: 0 10px;
    }
    
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}