/* ==============================
   Favicon Generator
   ============================== */

.fav-source-section {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
}

.fav-source-section .preview-header {
    margin-bottom: 14px;
}

.fav-source-preview {
    width: 100%;
    aspect-ratio: 1;
    background: repeating-conic-gradient(#1e1e22 0% 25%, #141418 0% 50%) 50% / 20px 20px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fav-source-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Preset Options */
.fav-preset-options {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    background: #27272a;
    border-radius: 10px;
    padding: 3px;
}

.fav-preset-btn {
    flex: 1;
    padding: 8px 6px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.25s;
    background: transparent;
    color: #71717a;
    white-space: nowrap;
    font-family: inherit;
}

.fav-preset-btn:hover {
    color: #a1a1aa;
}

.fav-preset-btn.active {
    background: #18181b;
    color: #fafafa;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.fav-preset-desc {
    font-size: 0.75rem;
    color: #71717a;
    line-height: 1.4;
    padding: 4px 2px;
}

/* Shape Options */
.fav-shape-options {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.fav-shape-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    background: #18181b;
    color: #71717a;
    text-align: center;
    font-family: inherit;
    font-weight: 500;
}

.fav-shape-btn:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: #a1a1aa;
}

.fav-shape-btn.active {
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
}

/* Color Picker Row */
.fav-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.fav-color-row span {
    font-size: 0.85rem;
    color: #fafafa;
    min-width: 50px;
    font-weight: 500;
}

.fav-color-row input[type="color"] {
    width: 36px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.fav-color-row input[type="text"] {
    width: 80px;
    padding: 8px 10px;
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #fafafa;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Menlo', monospace;
}

.fav-color-row input[type="text"]:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
    outline: none;
}

.fav-transparent-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.fav-transparent-toggle input[type="checkbox"] {
    display: none;
}

.fav-transparent-toggle span {
    color: #fafafa;
    font-size: 0.85rem;
    min-width: 0;
    font-weight: 500;
}

/* Icon Grid */
.fav-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.fav-icon-item {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

.fav-icon-item-preview {
    width: 64px;
    height: 64px;
    background: repeating-conic-gradient(#1e1e22 0% 25%, #141418 0% 50%) 50% / 10px 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fav-icon-item-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.fav-icon-item-label {
    font-size: 0.75rem;
    color: #a1a1aa;
    text-align: center;
    font-weight: 500;
}

.fav-icon-item-size {
    font-size: 0.7rem;
    color: #71717a;
}

.fav-icon-item .download-btn {
    margin-left: 0;
    font-size: 0.7rem;
    padding: 5px 12px;
    width: 100%;
    text-align: center;
    display: block;
}

/* Snippet Section */
.fav-snippet-section {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
}

.fav-snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fav-snippet-title {
    font-size: 0.75rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.fav-snippet-copy {
    background: #27272a;
    border: none;
    color: #a1a1aa;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.fav-snippet-copy:hover {
    color: #fafafa;
    background: #3f3f46;
}

.fav-snippet-code {
    background: #27272a;
    border-radius: 10px;
    padding: 14px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.75rem;
    color: #fafafa;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
    max-height: 300px;
    overflow-y: auto;
}

/* Generate Button */
.fav-generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #a78bfa, #38bdf8);
    border: none;
    color: #fff;
    padding: 14px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 16px;
    display: none;
    font-family: inherit;
}

.fav-generate-btn.visible {
    display: block;
}

.fav-generate-btn:hover {
    opacity: 0.9;
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
}

/* Toast */
.fav-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #18181b;
    color: #fafafa;
    padding: 10px 24px;
    border-radius: 980px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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