/* SVG Icon Search — Dark Rose Gold Theme */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #F43F5E;
    --primary-rgb: 244, 63, 94;
    --secondary: #FB7185;
    --accent: #38BDF8;
    --bg: #1A0C12;
    --bg-card: #261319;
    --bg-elevated: #321A21;
    --bg-surface: #3D2129;
    --text: #F8F0F2;
    --text-muted: #A8899A;
    --text-dim: #6E5566;
    --border: rgba(244, 63, 94, 0.15);
    --border-hover: rgba(244, 63, 94, 0.35);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --glass: rgba(38, 19, 25, 0.7);
    --glass-border: rgba(244, 63, 94, 0.1);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 20% 0%, rgba(var(--primary-rgb), 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    color: white;
}

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

.header-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 640px) {
    .header-tagline {
        display: block;
    }
}

.main {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.search-section {
    margin-bottom: 24px;
}

.search-container {
    margin-bottom: 16px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.search-shortcut {
    position: absolute;
    right: 14px;
    padding: 2px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-dim);
    font-size: 0.75rem;
    pointer-events: none;
}

.filter-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 7px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--bg-elevated);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.3);
}

.customize-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-range {
    width: 80px;
    height: 4px;
    appearance: none;
    background: var(--bg-surface);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.control-range::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.control-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.control-value {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    min-width: 30px;
}

.control-color {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    padding: 0;
    background: none;
}

.control-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

#results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-download-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-download-all:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.icon-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    min-height: 100px;
}

.icon-card:hover,
.icon-card:focus-visible {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.12);
}

.icon-card:active {
    transform: translateY(0);
}

.icon-card .icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--text);
    transition: var(--transition);
}

.icon-card:hover .icon-preview {
    color: var(--primary);
}

.icon-card .icon-name {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.icon-card .icon-set-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.55rem;
    color: var(--text-dim);
    text-transform: uppercase;
    opacity: 0;
    transition: var(--transition);
}

.icon-card:hover .icon-set-tag {
    opacity: 1;
}

.icon-card.copied {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.empty-state,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    color: var(--text-dim);
    text-align: center;
    gap: 16px;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-surface);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.recent-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 90;
}

.recent-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.recent-toggle:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.recent-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    border-radius: 100px;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
}

.recent-list {
    display: none;
    position: absolute;
    bottom: 50px;
    right: 0;
    width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
}

.recent-list.open {
    display: block;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.recent-item:hover {
    background: var(--bg-surface);
}

.recent-item .recent-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.recent-item .recent-name {
    font-size: 0.75rem;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item .recent-set {
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(56, 189, 248, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: 0.35s ease;
    z-index: 200;
}

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

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.modal-set-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 3px 8px;
    background: var(--bg-surface);
    border-radius: 100px;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-surface);
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.modal-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .modal-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.modal-btn:hover {
    background: var(--bg-surface);
    color: var(--text);
    border-color: var(--border-hover);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

.modal-btn.primary:hover {
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.3);
}

.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.code-tab {
    padding: 6px 14px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.code-tab:hover {
    color: var(--text-muted);
}

.code-tab.active {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text);
}

.modal-code {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 0.75rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 200px;
    color: var(--accent);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 3px;
}

@media (max-width: 640px) {
    .header-inner {
        padding: 12px 16px;
    }

    .main {
        padding: 16px;
    }

    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .icon-card {
        padding: 12px 6px 8px;
        min-height: 85px;
    }

    .filter-strip {
        flex-direction: column;
        align-items: stretch;
    }

    .modal {
        max-height: 90vh;
        overflow-y: auto;
    }
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}