/* ============================================
   Favicon Emoji Generator — Styles
   Modern gradient palette with glassmorphism
   ============================================ */

:root {
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --secondary: #0EA5E9;
    --accent: #F59E0B;
    --accent-light: #FBBF24;
    --bg: #0F0A1A;
    --bg-elevated: #1A1433;
    --bg-card: rgba(26, 20, 51, 0.7);
    --surface: #251E3E;
    --surface-hover: #2E2650;
    --text: #F1F5F9;
    --text-secondary: #A5B4C8;
    --text-muted: #6B7A8D;
    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(108, 99, 255, 0.3);
    --success: #22C55E;
    --danger: #EF4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
    --bg: #F5F3FF;
    --bg-elevated: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.8);
    --surface: #E8E5F5;
    --surface-hover: #DDD8F0;
    --text: #1E1533;
    --text-secondary: #4A4163;
    --text-muted: #8B82A0;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: border-color var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 10, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .header {
    background: rgba(245, 243, 255, 0.85);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #38BDF8);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.5);
    transform: translateY(-1px);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn-ghost:hover {
    background: var(--surface);
    color: var(--text);
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: 0.75rem;
}

/* --- Main --- */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

/* --- Editor Layout --- */
.editor-section {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* --- Form Controls --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.emoji-input-row {
    display: flex;
    gap: 0.5rem;
}

.emoji-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 2rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    transition: border-color var(--transition);
}

.emoji-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.emoji-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.emoji-btn:hover {
    border-color: var(--primary);
    transform: scale(1.15);
}

/* Color controls */
.color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

input[type="color"] {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    padding: 2px;
}

.color-hex {
    width: 90px;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: monospace;
    font-size: 0.85rem;
}

.color-hex:focus {
    outline: none;
    border-color: var(--primary);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.color-swatch:hover {
    transform: scale(1.2);
    border-color: var(--primary);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    outline: none;
    margin-top: 0.25rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(108, 99, 255, 0.4);
}

/* --- Preview --- */
.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-grid {
    display: flex;
    gap: 1.25rem;
    align-items: end;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.preview-item canvas {
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    image-rendering: pixelated;
}

.preview-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Browser Mockup */
.mockup-chrome {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

.mockup-toolbar {
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mockup-dots {
    display: flex;
    gap: 5px;
}

.mockup-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mockup-dots span:nth-child(1) {
    background: #EF4444;
}

.mockup-dots span:nth-child(2) {
    background: #F59E0B;
}

.mockup-dots span:nth-child(3) {
    background: #22C55E;
}

.mockup-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-elevated);
    border-radius: 6px 6px 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mockup-tab canvas {
    border-radius: 2px;
}

.mockup-url {
    flex: 1;
    background: var(--bg-elevated);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mockup-content {
    height: 80px;
    background: var(--bg-elevated);
}

/* --- Export --- */
.export-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

/* --- History --- */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.history-header h3 {
    margin-bottom: 0;
}

.history-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 40px;
}

.history-item {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}

.history-item:hover {
    border-color: var(--primary);
    transform: scale(1.1);
}

.history-item canvas {
    width: 100%;
    height: 100%;
}

/* --- Toast --- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    max-width: 360px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--primary);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* --- Animations --- */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* --- Responsive --- */
@media (max-width: 800px) {
    .editor-section {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        grid-template-columns: 1fr;
    }

    .preview-grid {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0.625rem 1rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .main {
        padding: 1.25rem 1rem;
    }

    .glass-card {
        padding: 1rem;
    }
}