:root {
    --primary: #f5f5f5;
    --primary-hover: #e0e0e0;
    --background: #ffffff;
    --surface: #fafafa;
    --border: #eaeaea;
    --text: #1a1a1a;
    --text-secondary: #666666;
    --shadow: rgba(0, 0, 0, 0.08);
    --modal-backdrop: rgba(0, 0, 0, 0.5);
    --scrollbar-thumb: #e0e0e0;
    --scrollbar-track: #f5f5f5;
    --modal-background: #ffffff;
    --toggle-bg: #e0e0e0;
    --toggle-bg-active: var(--text);
    --toggle-knob: var(--background);
}

[data-theme="dark"] {
    --primary: #1a1a1a;
    --primary-hover: #2a2a2a;
    --background: #000000;
    --surface: #111111;
    --border: #333333;
    --text: #ffffff;
    --text-secondary: #999999;
    --shadow: rgba(0, 0, 0, 0.3);
    --modal-backdrop: rgba(0, 0, 0, 0.75);
    --scrollbar-thumb: #333333;
    --scrollbar-track: #1a1a1a;
    --modal-background: #1a1a1a;
    --toggle-bg: #333333;
    --toggle-bg-active: var(--text);
    --toggle-knob: var(--background);
}

[data-theme="dark"] .btn-primary {
    background: var(--primary-hover);
    color: var(--text);
}

[data-theme="dark"] .btn-primary:hover {
    background: #3a3a3a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}

body {
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    background-size: cover;
    background-position: center;
}

svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] svg {
    color: currentColor;
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: var(--modal-backdrop);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-actions button {
    flex: 1;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--modal-background);
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px var(--shadow);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65em auto;
}

select:focus {
    outline: none;
    border-color: var(--text);
}

.modal-content {
    overflow: hidden;
}

.onboarding-progress {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--text);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.step h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.step p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

input[type="text"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--text);
}

.center-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 2rem;
    position: relative;
}

#greeting {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    opacity: 0;
    animation: greetingSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    height: 48px;
    visibility: hidden;
}

#greeting:not([style*="visibility"]) {
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 640px;
    height: 56px;
    visibility: visible;
    animation: searchBarSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.search-engine-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.search-engine-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow);
    border: 2px solid transparent;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    animation: searchEngineOptionFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.search-engine-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.search-engine-option.selected {
    background: #eeeeee;
    border: 2px solid var(--border);
}

.search-engine-option img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-engine-option span {
    font-size: 0.875rem;
    color: var(--text);
    text-align: center;
}
.search-wrapper {
    position: relative;
}

#search-bar {
    width: 100%;
    padding: 1.25rem 1.5rem;
    border: none;
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    box-shadow: 0 4px 24px var(--shadow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

.shortcuts-container {
    width: 100%;
    max-width: 640px;
}

#add-shortcut {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: var(--primary);
    color: var(--text);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    transition: transform 0.2s ease;
    animation: addButtonFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

#add-shortcut:hover {
    background: var(--primary-hover);
    transform: scale(1.1) rotate(180deg);
}

#add-shortcut:active {
    transform: scale(0.9) rotate(180deg);
}

#shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: shortcutsSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

.shortcut {
    background: var(--surface);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px var(--shadow);
    animation: shortcutFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.shortcut:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px var(--shadow);
}

.shortcut img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    pointer-events: none;
    -webkit-user-drag: none;
}

.shortcut span {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.shortcut.blurred {
    filter: blur(4px);
    opacity: 0.7;
}

.shortcut.blurred:hover {
    filter: blur(0);
    opacity: 1;
}

.settings-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text);
    box-shadow: 0 4px 24px var(--shadow);
    transition: transform 0.4s ease;
    z-index: 999;
    animation: settingsButtonFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s backwards;
}

.settings-button:hover {
    transform: rotate(180deg) scale(1.1);
}

.settings-button:active {
    transform: rotate(180deg) scale(0.9);
}

.settings-panel {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.settings-panel::-webkit-scrollbar {
    width: 8px;
}

.settings-panel::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 0 24px 24px 0;
}

.settings-panel::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 4px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.25rem;
    opacity: 0.6;
}

.btn-icon:hover {
    opacity: 1;
}

.settings-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.setting-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
}

.setting-item.horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.setting-item .setting-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.data-management-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-management-buttons svg {
    vertical-align: middle;
    margin-right: 5px;
    margin-top: -6px;
}

.btn-danger {
    background: #dc3545 !important;
    color: white !important;
}

.btn-danger:hover {
    background: #c82333 !important;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg);
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--toggle-knob);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

input:checked + .toggle-slider {
    background-color: var(--toggle-bg-active);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

#keybind-url-combo {
    margin-bottom: 0.5rem;
}

#keybind-url {
    margin-top: 0.5rem;
}

.keybind-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.clear-keybind {
    padding: 0.25rem 0.5rem;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.clear-keybind:hover {
    opacity: 0.8;
}

.format-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.background-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    justify-content: center;
}

.background-preview {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    height: 150px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.background-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.background-preview.selected {
    border: 3px solid var(--text);
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--text);
    transform: scale(0.95);
}

.background-preview.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 2rem;
    background-color: var(--background-secondary);
    cursor: pointer;
    border: 2px dashed var(--border);
}

.remove-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    border-radius: 50%;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease;
}

.remove-icon:hover {
    background: var(--primary-hover);
}

.file-input {
    display: none;
}

.file-input-label {
    background: var(--primary);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    padding: 1rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.file-input-label:hover {
    background: var(--primary-hover);
}

[data-theme="dark"] .file-input-label {
    background: var(--primary-hover);
    color: var(--text);
}

[data-theme="dark"] .file-input-label:hover {
    background: #3a3a3a;
}

.btn-primary {
    background: var(--primary);
    color: var(--text);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

#notification-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.notification {
    background: var(--surface);
    color: var(--text);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(var(--shadow-rgb), 0.1);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1), fadeIn 0.4s ease;
    max-width: 420px;
    border: 1px solid rgba(var(--text-rgb), 0.1);
}

.notification-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.notification-content a {
    color: var(--text);
    text-decoration: none;
    font-weight: bold;
}

.notification-content a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.6;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(var(--text-rgb), 0.1);
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0.8;
    transition: width 0.1s linear;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.about-content {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem 0;
}

.about-content a {
    color: var(--text);
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

.about-content .version {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.about-content .description {
    margin-bottom: 1rem;
}

.about-content .features {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.about-content .copyright {
    font-size: 0.8rem;
    margin-top: 1rem;
}

.made-with {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.made-with i {
    color: #ff6b6b;
    animation: heartbeat 1.5s infinite ease-in-out;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.context-menu {
    position: fixed;
    background: var(--surface);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 1000;
    animation: contextMenuFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.context-menu.hidden {
    display: none;
}

.context-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;    
    font-size: 12px !important;
    gap: 0.5rem;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.context-menu-item:hover {
    background: var(--primary);
    transform: translateX(2.5px);
}

.context-menu-item i {
    width: 16px;
}

.search-container.hidden,
#greeting.hidden,
#shortcuts-grid.hidden,
#add-shortcut.hidden {
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

@media screen and (max-width: 768px) {
    .center-container {
        padding: 1rem;
        gap: 2rem;
    }

    #greeting {
        font-size: 1.5rem;
        height: 36px;
    }

    .search-container {
        max-width: 100%;
    }

    #search-bar {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .search-engine-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .search-engine-option {
        padding: 1rem;
    }

    .search-engine-option img {
        width: 24px;
        height: 24px;
    }

    #shortcuts-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .shortcut {
        padding: 0.75rem;
    }

    .shortcut img {
        width: 24px;
        height: 24px;
    }

    .shortcut span {
        font-size: 0.75rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
        border-radius: 16px;
    }

    .step h2 {
        font-size: 1.5rem;
    }

    .setting-item {
        padding: 0.5rem 0;
    }

    .setting-label {
        font-size: 0.9rem;
    }

    input[type="text"], select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .notification {
        width: 90%;
        max-width: none;
        margin: 0.5rem;
        padding: 0.75rem;
    }

    .font-size-control {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .font-size-input {
        width: 100%;
        justify-content: space-between;
    }
    
    .font-size-input input[type="number"] {
        width: 80px;
    }
    
    .btn-reset {
        width: 100%;
    }

    
    .settings-container {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .settings-content {
        padding: 1.5rem;
    }

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

    .custom-grid-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .grid-control {
        width: 100%;
        justify-content: space-between;
    }
}

@media screen and (max-width: 480px) {
    #greeting {
        font-size: 1.25rem;
        height: 32px;
    }

    .search-engine-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    #shortcuts-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.5rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions button {
        width: 100%;
    }

    .format-hint {
        font-size: 0.7rem;
        line-height: 1.2;
    }
}

@media screen and (max-height: 480px) and (orientation: landscape) {
    .center-container {
        padding: 0.5rem;
        gap: 1rem;
    }

    #greeting {
        font-size: 1.25rem;
        height: 32px;
        margin-bottom: 0;
    }

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

    .search-engine-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media screen and (max-width: 480px) {
    .search-engine-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .search-engine-option {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 1rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.2s ease;
        aspect-ratio: 1;
    }

    .search-engine-option img {
        width: 24px;
        height: 24px;
        margin-bottom: 0.5rem;
    }

    .search-engine-option span {
        font-size: 0.85rem;
        font-weight: 500;
    }

    .search-engine-option.selected {
        background: #eeeeee;
        border: 2px solid var(--border);
    }

    .onboarding-modal .modal-content {
        width: 90%;
        max-width: none;
        padding: 1.25rem;
    }

    .step h2 {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }

    #complete-setup-btn {
        width: 100%;
        margin-top: 1rem;
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

.import-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

#import-data-btn svg {
    vertical-align: middle;
    margin-right: 5px;
    margin-top: -6px;
}

.or-divider {
    position: relative;
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background-color: var(--border);
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}

.or-divider span {
    background-color: var(--background);
    padding: 0 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.settings-page {
    position: fixed;
    inset: 0;
    background: var(--background);
    z-index: 1000;
    display: flex;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.settings-page.active {
    opacity: 1;
    visibility: visible;
}

.settings-container {
    display: flex;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    background: var(--background);
}

.settings-sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 1rem;
}

#back-to-home {
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: 1rem 0.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

#back-to-home:hover {
    color: var(--primary-hover);
    transform: scale(1.15);
}

#back-to-home i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

#back-to-home:hover i {
    transform: scale(1.2);
}

.settings-sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
}

.settings-nav-item:hover {
    background: var(--primary);
    color: var(--text);
}

.settings-nav-item.active {
    background: var(--primary);
    color: var(--text);
    font-weight: 600;
}

.settings-nav-item.active svg {
    transform: scale(1.15) translateX(2px);
}

.settings-nav-item svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-nav-item:hover svg {
    transform: scale(1.15) translateX(2px);
}

.settings-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    background: var(--background);
}

.settings-section {
    display: none;
    animation: fadeIn 0.3s ease;
    max-width: 800px;
    margin: 0 auto;
}

.settings-section.active {
    display: block;
}

.settings-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.settings-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.settings-card-header .btn-reset {
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.settings-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary);
    border-radius: 0.75rem;
}

.settings-card-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-card-icon:hover svg {
    transform: scale(1.15) rotate(5deg);
}

.settings-card-title {
    flex: 1;
}

.settings-card-title h4 {
    font-size: 1.125rem !important;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.settings-card-title p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.setting-item {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.setting-item:first-child {
    border-top: none;
    padding-top: 0;
}

.setting-item:last-child {
    padding-bottom: 0;
}

.setting-item.horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.setting-item .setting-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.setting-item.horizontal .setting-label {
    margin-bottom: 0;
}

.setting-item .setting-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.data-management-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.data-management-buttons .btn-primary {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    transition: all 0.2s ease;
}

.data-management-buttons .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.data-management-buttons .btn-danger {
    grid-column: 1 / -1;
    background: #dc3545;
}

.data-management-buttons .btn-danger:hover {
    background: #c82333;
}

.data-management-buttons svg {
    width: 18px;
    height: 18px;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 2px rgba(var(--text-rgb), 0.1);
}

.format-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--toggle-bg);
    border-radius: 24px;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--toggle-knob);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

input:checked + .toggle-slider {
    background-color: var(--toggle-bg-active);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.keybind-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.keybind-container input {
    flex: 1;
}

.clear-keybind {
    padding: 0.5rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.clear-keybind:hover {
    background: var(--primary-hover);
}

.custom-grid-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.grid-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.grid-control input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}

.grid-control input[type="number"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--border);
}

[data-theme="dark"] .grid-control input[type="number"]:disabled {
    background: rgba(255, 255, 255, 0.05);
}

.grid-control label {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    flex: 1;
}

.grid-default {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
}

.grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.5rem;
}

.grid-comfortable {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
}

.grid-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.grid-list .shortcut {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.75rem 1.25rem;
    text-align: left;
    gap: 1rem;
}

.grid-list .shortcut img {
    margin-right: 0.5rem;
}

.grid-list .shortcut span {
    white-space: normal;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select {
    position: relative;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-select select {
    display: none;
}

.select-selected {
    background: var(--surface);
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    color: var(--text);
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 500;
}

.select-selected::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text);
    border-bottom: 2px solid var(--text);
    transform: translateY(-70%) rotate(45deg);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.select-selected.select-arrow-active::after {
    transform: translateY(-30%) rotate(-135deg);
}

.select-items {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
}

.select-items div {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    color: var(--text);
    font-weight: 500;
}

.select-hide {
    display: none;
}

.search-engine-google::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.search-engine-bing::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('https://www.bing.com/favicon.ico');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.search-engine-duckduckgo::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('https://duckduckgo.com/favicon.ico');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.search-engine-brave::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('https://brave.com/static-assets/images/brave-favicon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.search-engine-qwant::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('https://www.qwant.com/favicon.ico');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.search-engine-searxng::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('https://www.searx.org/favicon.ico');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 0.5rem;
}

.select-items::-webkit-scrollbar {
    display: none;
}

.select-items {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.select-selected:hover {
    border-color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.select-selected:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--shadow);
}

.select-items div {
    position: relative;
    overflow: hidden;
}

.select-items div:hover {
    background-color: var(--primary);
    color: var(--text);
}

.same-as-selected {
    background: var(--primary);
    font-weight: 600;
}

.same-as-selected::before {
    opacity: 1;
    transform: translateX(0);
}

.select-items div::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: var(--text);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    border-radius: 50%;
    pointer-events: none;
}

.select-items div:active::after {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(2);
    transition: 0s;
}

.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.settings-page {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-page.active {
    transform: translateX(0);
}

.notification {
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#greeting {
    animation: greetingSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes greetingSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-container {
    animation: searchBarSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

@keyframes searchBarSlideIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#search-bar {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#search-bar:hover {
    box-shadow: 0 8px 32px var(--shadow);
}

#search-bar:focus {
    box-shadow: 0 8px 32px var(--shadow);
}

#shortcuts-grid {
    animation: shortcutsSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes shortcutsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shortcut {
    animation: shortcutFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes shortcutFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.shortcut:active {
    transform: scale(0.95);
    box-shadow: 0 4px 12px var(--shadow);
}

#add-shortcut {
    animation: addButtonFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes addButtonFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#add-shortcut:hover {
    transform: scale(1.1) rotate(180deg);
}

#add-shortcut:active {
    transform: scale(0.9) rotate(180deg);
}
.settings-button {
    animation: settingsButtonFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s backwards;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes settingsButtonFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-button:hover {
    transform: rotate(180deg) scale(1.1);
}

.settings-button:active {
    transform: rotate(180deg) scale(0.9);
}

.context-menu {
    animation: contextMenuFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.search-engine-option {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-engine-option:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.search-engine-option:active {
    transform: scale(0.95);
    box-shadow: 0 4px 12px var(--shadow);
}

.settings-nav-item svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-card-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.data-management-buttons svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 8px;
}

.settings-nav-item:hover svg {
    transform: scale(1.15) translateX(2px);
}

.settings-card-icon:hover svg {
    transform: scale(1.15) rotate(5deg);
}

[data-icon-style="solid"] svg use {
    fill: currentColor;
    stroke: none;
}

[data-icon-style="linear"] svg use {
    fill: none;
    stroke: currentColor;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container {
    flex: 1;
}

.font-size-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-size-input input[type="number"] {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text);
    font-size: 0.875rem;
}

.font-size-input span {
    color: var(--text-secondary);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--primary);
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--text);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.btn-reset {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.color-setting {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}

.color-setting:first-child {
    border-top: none;
}

.color-setting-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
}

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

.color-setting input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-setting input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border);
    border-radius: 6px;
}