/* ────────────────────────────────────────────────────────────────────────────
   FAVICON STUDIO — CLEAN LIGHT THEME
   Font: Inter (Google Fonts)
   ──────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
    --primary:        #5b6af0;
    --primary-hover:  #4757e2;
    --primary-light:  rgba(91, 106, 240, 0.12);
    --primary-glow:   rgba(91, 106, 240, 0.25);

    --bg:             #f5f6fa;
    --surface:        #ffffff;
    --surface-2:      #f0f1f7;

    --border:         rgba(0, 0, 0, 0.08);
    --border-focus:   rgba(91, 106, 240, 0.5);

    --text:           #18191f;
    --text-2:         #6b7280;
    --text-3:         #9ca3af;

    --success:        #10b981;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:      0 4px 16px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg:      0 12px 40px rgba(0,0,0,.09), 0 4px 12px rgba(0,0,0,.05);
    --radius-lg:      20px;
    --radius-md:      12px;
    --radius-sm:      8px;
    --ease:           cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Ambient Background ───────────────────────────────────────────────────── */
.background-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: glow-drift 18s ease-in-out infinite alternate;
}

.glow-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #c7ccff 0%, transparent 70%);
    top: -150px; left: -150px;
}

.glow-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #d1fae5 0%, transparent 70%);
    bottom: -100px; right: -100px;
    animation-delay: -9s;
}

@keyframes glow-drift {
    0%   { transform: translate(0,   0)   scale(1);   }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* ── Container ────────────────────────────────────────────────────────────── */
.container {
    max-width: 1080px;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1.15;
}

h1 .accent {
    color: var(--primary);
}

h1 .badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    vertical-align: middle;
    margin-left: 0.4rem;
}

header p {
    color: var(--text-2);
    font-size: 1.05rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

/* ── Animations ───────────────────────────────────────────────────────────── */
.fade-in {
    animation: fade-in 0.7s var(--ease) both;
}

.animate-slide-up {
    opacity: 0;
    animation: slide-up 0.65s var(--ease) both;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Layout Grid ──────────────────────────────────────────────────────────── */
.app-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.75rem;
    align-items: start;
}

@media (max-width: 860px) {
    .app-grid { grid-template-columns: 1fr; }
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* ── Controls Panel ───────────────────────────────────────────────────────── */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Drag Zone ────────────────────────────────────────────────────────────── */
.drag-zone {
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    cursor: pointer;
    transition: border-color 0.3s var(--ease),
                background   0.3s var(--ease),
                transform    0.25s var(--ease-spring),
                box-shadow   0.3s var(--ease);
    background: linear-gradient(135deg, #fafbff 0%, #f5f6ff 100%);
}

.drag-zone:hover,
.drag-zone.active {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.drag-content {
    text-align: center;
}

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-2);
    margin-bottom: 0.875rem;
    transition: background 0.3s var(--ease), transform 0.3s var(--ease-spring);
}

.drag-zone:hover .icon-wrapper {
    background: var(--primary);
    transform: scale(1.1);
}

.icon-upload {
    width: 24px;
    height: 24px;
    color: var(--text-2);
    transition: color 0.3s var(--ease);
}

.drag-zone:hover .icon-upload { color: white; }

.success-icon {
    background: var(--success) !important;
}
.success-icon svg { color: white; width: 24px; height: 24px; }

.drag-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.drag-desc {
    font-size: 0.875rem;
    color: var(--text-2);
    margin-top: 0.2rem;
}

/* ── Settings Card ────────────────────────────────────────────────────────── */
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label,
.setting-group > label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 0.6rem;
}

/* ── Shape Selector ───────────────────────────────────────────────────────── */
.shape-selector {
    display: flex;
    gap: 0.75rem;
}

.shape-option {
    flex: 1;
    cursor: pointer;
}

.shape-option input[type="radio"] { display: none; }

.shape-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 0;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    transition: border-color 0.25s var(--ease),
                background   0.25s var(--ease),
                transform    0.2s  var(--ease-spring),
                box-shadow   0.25s var(--ease);
    cursor: pointer;
}

.shape-option input:checked + .shape-btn {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.shape-option:hover .shape-btn {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.shape-icon {
    width: 22px;
    height: 22px;
    background: var(--text-3);
    transition: background 0.25s var(--ease), transform 0.25s var(--ease-spring);
}

.shape-option input:checked + .shape-btn .shape-icon { background: var(--primary); }

.shape-icon.none     { 
    border-radius: 3px; 
    background: repeating-conic-gradient(#cbd5e1 0% 25%, #f8fafc 0% 50%) 50% / 10px 10px;
}
.shape-icon.square   { border-radius: 3px; }
.shape-icon.squircle { border-radius: 7px; }
.shape-icon.circle   { border-radius: 50%; }

/* When selected, checkboard gets a blueish tint */
.shape-option input:checked + .shape-btn .shape-icon.none {
    background: repeating-conic-gradient(#93c5fd 0% 25%, #bfdbfe 0% 50%) 50% / 10px 10px;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.5);
}

/* ── Color Picker ─────────────────────────────────────────────────────────── */
.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: border-color 0.25s var(--ease);
}

.color-picker-wrapper:hover { border-color: var(--primary); }

.color-preview {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
    pointer-events: none;
    flex-shrink: 0;
}

input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.mono-text {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    color: var(--text);
}

/* ── Scale Slider ─────────────────────────────────────────────────────────── */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.value-badge {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    background: var(--surface-2);
    border-radius: 3px;
    outline: none;
    margin-top: 0.6rem;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px white, 0 0 0 5px var(--primary-glow);
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring);
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }

/* ── Offset Inputs ────────────────────────────────────────────────────────── */
.offset-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.offset-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.25s var(--ease);
}

.offset-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.offset-input span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-2);
    letter-spacing: 0.04em;
}

.offset-input input {
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    outline: none;
    font-size: 0.95rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Preview Panel ────────────────────────────────────────────────────────── */
.preview-panel > .card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tabs-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 1.5rem;
}

/* ── Browser Mockup ───────────────────────────────────────────────────────── */
.browser-mockup {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.browser-header {
    background: #efefef;
    padding: 0.5rem 0.75rem 0;
    display: flex;
    align-items: flex-end;
    gap: 0;
    border-bottom: 1px solid #d8d8d8;
}

.browser-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    padding-bottom: 0.55rem;
    margin-right: 1rem;
}

.browser-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #febc2e; }
.browser-dots span:nth-child(3) { background: #28c840; }

.browser-tab {
    background: #fff;
    padding: 0.45rem 1rem;
    border-radius: 8px 8px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 220px;
    min-width: 140px;
    position: relative;
    border: 1px solid #d8d8d8;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.tab-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.tab-title {
    font-size: 0.72rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.tab-close {
    width: 13px;
    height: 13px;
    color: #999;
    flex-shrink: 0;
    cursor: pointer;
}

.tab-close:hover { color: #333; }

.browser-tab-add {
    color: #999;
    padding: 0 0.5rem 0.55rem;
}

.browser-tab-add svg { width: 15px; height: 15px; display: block; }

.browser-body {
    background:
        linear-gradient(rgba(91,106,240,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91,106,240,.03) 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 2rem;
}

.preview-display {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#svg-container svg {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,.18));
    animation: scale-in 0.45s var(--ease-spring) both;
}

.placeholder-preview {
    text-align: center;
    color: var(--text-3);
}

.placeholder-preview svg {
    width: 44px;
    height: 44px;
    margin-bottom: 0.75rem;
    opacity: 0.45;
}

.placeholder-preview p {
    font-size: 0.9rem;
}

/* ── Export Section ───────────────────────────────────────────────────────── */
.export-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.export-section h4 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 1rem;
}

.export-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.format-selector {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.format-selector label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modern-select {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.1em;
    cursor: pointer;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.modern-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modern-select option {
    background: #fff;
    color: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: background   0.25s var(--ease),
                transform    0.2s  var(--ease-spring),
                box-shadow   0.25s var(--ease),
                opacity      0.2s  var(--ease);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn.primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn:disabled {
    background: var(--surface-2);
    color: var(--text-3);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn.secondary {
    background: var(--surface-2);
    color: var(--text-2);
    border: 1.5px solid var(--border);
}

.btn.secondary:hover:not(:disabled) {
    background: var(--surface);
    color: var(--text);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn.secondary:active:not(:disabled) {
    transform: translateY(0);
}

/* ── Color Presets ────────────────────────────────────────────────────────── */
.color-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-chip {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.25s var(--ease);
    position: relative;
}

.color-chip:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.color-chip.active {
    box-shadow: 0 0 0 3px var(--primary);
}

/* Checkerboard for transparent chip */
.color-chip.transparent {
    background: repeating-conic-gradient(#d1d5db 0% 25%, #fff 0% 50%) 50% / 8px 8px;
}

/* ── Size Preview Grid ───────────────────────────────────────────────────── */
.size-preview-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

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

.size-preview-item img {
    border-radius: 3px;
    image-rendering: pixelated;
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.size-preview-label {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 500;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease-spring), opacity 0.3s var(--ease);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.export-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-2);
    text-align: center;
    line-height: 1.5;
}

/* ── Language Selector ────────────────────────────────────────────────────── */
.language-wrapper {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    padding: 0.4rem 0.75rem;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.icon-globe {
    width: 16px;
    height: 16px;
    color: var(--text-2);
    margin-right: 0.5rem;
}

.lang-select {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    padding-right: 1.25rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 0.8em;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
    width: 100%;
    max-width: 1080px;
    margin: 4rem auto 0;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    position: relative;
    z-index: 10;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-2);
}

.loge-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s var(--ease);
}

.loge-brand-link:hover { opacity: 0.75; }

.loge-logo-img {
    height: 28px;
    width: auto;
    display: block;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-legal-links a {
    font-size: 0.82rem;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.footer-legal-links a:hover { color: var(--primary); }

.footer-divider {
    color: var(--text-3);
    font-size: 0.9rem;
}

.footer-rights {
    font-size: 0.78rem;
    color: var(--text-3);
}
