:root {
    /* MD3 Color Tokens (Mockup based on a Blue/Purple theme) */
    --md-sys-color-primary: #0061a4;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-on-primary-container: #001d36;
    
    --md-sys-color-secondary: #535f70;
    --md-sys-color-secondary-container: #d7e3f7;
    --md-sys-color-on-secondary-container: #101c2b;

    --md-sys-color-tertiary: #6b5778;
    --md-sys-color-tertiary-container: #f2daff;
    --md-sys-color-on-tertiary-container: #251431;

    --md-sys-color-surface: #fdfcff;
    --md-sys-color-surface-container: #f0f4f9; /* Light background */
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-on-surface-variant: #43474e;
    --md-sys-color-outline: #73777f;
    
    --md-ref-typeface: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Elevation Shadows */
    --md-sys-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--md-ref-typeface);
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 840px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: popup 0.5s cubic-bezier(0, 0.67, 0, 1) 1;
}

/* Header Card */
.header-card {
    background-color: var(--md-sys-color-surface);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--md-sys-elevation-1);
    position: relative;
    overflow: hidden;
}

/* Gradient accent for header */
.header-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(135deg, #e0eaff 0%, #d1e4ff 100%);
    z-index: 0;
    opacity: 0.5;
}

.header-content {
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ccc;
    box-shadow: var(--md-sys-elevation-1);
}

.avatar img {
    animation: spin 4s linear infinite;
}

/* Action Buttons Area */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

/* MD3 Buttons */
.btn {
    border: none;
    border-radius: 20px;
    padding: 0 24px;
    height: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-filled {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}
.btn-filled:hover {
    box-shadow: var(--md-sys-elevation-1);
    background-color: #005691; 
}

.btn-tonal {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}
.btn-tonal:hover {
    background-color: #c2d5f0;
}

/* Main Content Card */
.card {
    background-color: var(--md-sys-color-surface);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--md-sys-elevation-1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Text Field */
.input-group {
    position: relative;
}

textarea {
    width: 100%;
    height: 120px;
    padding: 16px;
    border-radius: 12px; /* MD3 Outline variant */
    border: 1px solid var(--md-sys-color-outline);
    background-color: transparent;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
    box-sizing: border-box;
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    border-width: 2px;
    padding: 15px; /* Adjust for border width change */
}

.helper-text {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 8px;
    line-height: 1.5;
}

.warning-box {
    background-color: #fff8e1; /* Light amber */
    color: #5d4000;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    gap: 12px;
    align-items: start;
}

/* Options / Checkboxes */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--md-sys-color-primary);
}

.checkbox-label {
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
    line-height: 1.5;
    margin-left: 36px;
}

.meme-list {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
    margin-left: 4px;
    display: block;
}

/* Sliders */
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.slider-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-label {
    width: 50px;
    font-size: 14px;
    font-weight: 500;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-secondary-container);
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-1);
    border: none;
}

/* Preview Section */
.preview-section {
    background-color: var(--md-sys-color-surface-container);
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
}

.preview-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
}

.audio-player-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

audio {
    flex-grow: 1;
    height: 40px;
    border-radius: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .action-bar {
        flex-direction: column;
        width: 100%;
    }
    .btn:not(.btn-tonal){
        width: 100%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
        }
@keyframes popup {
    from {
        scale: 0.85;
        opacity: 0.0;
    }
    to {
        scale: 1;
        opacity: 1.0;
    }
}