/* Meme Generator - creatememe.org */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.theme-toggle {
    position: fixed; bottom: 20px; right: 20px;
    width: 50px; height: 50px; border-radius: 50%;
    border: none; background: var(--bg-secondary);
    box-shadow: var(--shadow-md); cursor: pointer; z-index: 1000;
}
.sun-icon, .moon-icon { font-size: 1.5rem; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: opacity 0.3s; }
.moon-icon { opacity: 0; }
[data-theme="dark"] .sun-icon { opacity: 0; }
[data-theme="dark"] .moon-icon { opacity: 1; }

.container { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }

header { text-align: center; margin-bottom: 40px; }
h1 {
    font-size: 2.5rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-secondary); font-size: 1.1rem; margin-top: 10px; }

.generator-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

.controls-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.controls-panel h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.upload-section, .text-section, .action-section {
    margin-bottom: 25px;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-tertiary);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent-primary);
}
.drop-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.drop-zone p { color: var(--text-secondary); font-size: 0.9rem; }

.input-group { margin-bottom: 15px; }
.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.input-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.text-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.option-group label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.option-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    -webkit-appearance: none;
}
.option-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

.option-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary {
    background: var(--accent-gradient);
    color: white;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.preview-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 25px;
}
.preview-panel h3 {
    font-size: 1rem;
    margin-bottom: 15px;
}

.canvas-container {
    position: relative;
    min-height: 400px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#memeCanvas {
    display: none;
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.placeholder {
    text-align: center;
    color: var(--text-muted);
}
.placeholder span { font-size: 3rem; display: block; margin-bottom: 10px; }

.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 50px 0;
}
.badge {
    text-align: center;
    padding: 20px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}
.badge-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.badge-text { display: block; font-weight: 700; margin-bottom: 5px; }
.badge-desc { font-size: 0.85rem; color: var(--text-secondary); }

.how-it-works { margin: 50px 0; }
.how-it-works h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 25px; }
.step { text-align: center; padding: 25px; }
.step-number {
    width: 50px; height: 50px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700;
    margin: 0 auto 15px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--text-secondary); font-size: 0.95rem; }

.faq-section { margin: 50px 0; }
.faq-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.faq-item { background: var(--bg-secondary); padding: 25px; border-radius: var(--radius-md); }
.faq-item h3 { font-size: 1rem; margin-bottom: 12px; }
.faq-item p { color: var(--text-secondary); font-size: 0.9rem; }

footer { text-align: center; padding: 40px 20px; border-top: 1px solid var(--border-color); }
footer p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 10px; }
footer a { color: var(--accent-primary); text-decoration: none; }

@media (max-width: 800px) {
    .generator-layout { grid-template-columns: 1fr; }
    h1 { font-size: 2rem; }
}
