/* @import url('https://fonts.googleapis.com/css2?family=Yuji+Mai&display=swap'); */

:root {
    --bg-color: #ffffff;
    --text-color: #37352f;
    --btn-secondry-color:#ffffff;
    --border-color: #e9e9e7;
    --search-bg: rgba(255, 255, 255, 0.95);
    --button-bg: #ffffff;
    --button-hover: #f7f7f5;
    --button-text: #787774;
    --placeholder-color: #9b9a97;
    --card-bg: #ffffff;
    --svg-stroke: #787774;
    --box-shadow: rgba(0, 0, 0, 0.04) 0px 5px 4px 0px, rgba(84, 72, 49, 0.08) 0px 0px 0px 1px;
}

[data-theme="dark"] {
    --bg-color: #202020;
    --text-color: #e0e0e0;
    --btn-secondry-color:#D3D3D3;
    --border-color: #7e7e7e;
    --search-bg: rgba(26, 26, 26, 0.95);
    --button-bg: #2d2d2d;
    --button-hover: #3d3d3d;
    --button-text: #e0e0e0;
    --placeholder-color: #808080;
    --card-bg: #252525;
    --svg-stroke: #ffffff;
    --box-shadow: rgba(0, 0, 0, 0.08) 0px 5px 4px 0px, rgba(255, 255, 255, 0.094) 0px 0px 0px 1px;

}


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

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

button{
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    /* font-family: "Yuji Mai", serif; */
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}


.container {
    position: relative;
    display: flex;
}

.search-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px 15px 0 0;
    padding: 20px;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.search-container.show {
    transform: translateX(-50%) translateY(0);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    background-color: var(--search-bg);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

}

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-color);
    background: transparent;
    font-family: inherit;
}

#search-input::placeholder {
    color: var(--placeholder-color);
}

.close-search {
    position: absolute;
    top: -45px;
    right: 0;
    background: white;
    border: 1px solid #e9e9e7;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #787774;
    font-size: 18px;
    transition: all 0.2s ease;
}

.close-search:hover {
    background: #f7f7f5;
    color: #37352f;
}

#kanji_result {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin: 20px auto;
    padding: 32px;
    height: 330px;
    width: 330px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    background-color: var(--card-bg);
}

#kanji_result::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('./assets/Image.png');
    background-size: cover;
    background-position: center;
    opacity: 50%;
    z-index: 0;
    border-radius: 12px;
}

#kanji_result>* {
    position: relative;
    z-index: 1;
}

.svg-container {
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.kanji-svg {
    width: 200px;
    height: 200px;
}

svg {
    width: 100%;
    height: 100%;
    fill: var(--svg-stroke);
}

#other_result {
    text-align: center;
}

.no-results {
    text-align: center;
    color: var(--placeholder-color);
    margin-top: 40px;
    font-size: 16px;
}

text {
    font-size: 6px;
    fill: var(--text-color);
    user-select: none;
}

.container .controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 10px;
    gap: 12px;
}


button {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--button-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--svg-stroke);
    box-shadow: var(--box-shadow);
}

button:hover {
    background: var(--button-hover);
}

.animate-button {
    background: var(--button-bg);
    color: var(--button-text);
}

.animate-button svg {
    height: 32px;

}

.animate-button:hover {
    background: var(--button-hover);
}

.speed-button.active {
    background: var(--button-bg);
    color: var(--button-text);
}

.speed-button img {
    height: 20px;
    width: 20px;
}

.search-toggle,
.theme-toggle {
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 999;
}

.search-toggle:hover,
.theme-toggle:hover {
    background: var(--button-hover);
    transform: scale(1.05);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--placeholder-color);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.kanji-svg path {
    transition: stroke 0.3s ease;
}

.no-results {
    background-color: var(--bg-color);
    padding: 10px;
    margin-bottom: 22px;
}

button svg {
    width: 24px;
    height: 24px;
    fill: var(--svg-stroke);
    transition: fill 0.3s ease, color 0.3s ease;
}

.github-btn{
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 15px 15px;
    height: 50px;
    width: 50px;
    background-color: var(--btn-secondry-color);
    box-shadow: none;
    border: 1px solid var(--border-color);

    .github-link{
        svg{
            fill: #3d3d3d;
            width: 32px;
            height: 32px;
        }
    }
}
.github-btn:hover{
    background-color: #ededed;
}


@media (max-width: 640px) {
    body {
        padding: 20px 16px;
    }

    .svg-container {
        width: 200px;
        height: 200px;
    }

    .kanji-svg {
        width: 160px;
        height: 160px;
    }

    .search-toggle {
        bottom: 20px;
        right: 20px;
    }


}

/* Responsive styles for mobile and tablets */
@media (max-width: 900px) {
    body {
        max-width: 100%;
        padding: 20px 8px;
    }

    .search-container {
        max-width: 98vw;
        padding: 12px;
    }

    #kanji_result {
        width: 320px;
        height: 320px;
        padding: 16px;
    }

    .svg-container {
        width: 90vw;
        max-width: 220px;
        height: 300px;
    }

    .kanji-svg {
        width: 90vw;
        max-width: 190px;
        height: auto;
    }
        .github-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px 2px;
        font-size: 15px;
    }

    .search-container {
        padding: 6px;
        border-radius: 10px 10px 0 0;
    }

    #kanji_result {
        width: 73vw;
        min-height: 350px;
        padding: 8px;
        font-size: 15px;
    }

    .svg-container {
        max-width: 220px;
        height: 220px;
    }

    .kanji-svg {
        max-width: 400px;
    }


.github-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

@media (max-width: 640px) {
    .github-btn {
        display: none;
    }
}

    .kanji-char {
        font-size: 18px;
    }

    .kanji-id {
        font-size: 11px;
    }

    .controls {
        gap: 12px;
    }

    button,
    .search-toggle,
    .theme-toggle {
        width: 50px;
        height: 50px;
    }

    button svg {
        width: 23px;
        height: 23px;
    }
}