* {
    box-sizing: border-box;
}

:root {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --accent-color: #325bd8;
    --secondary-bg: #08080ec7;
    --bm-bg: #912964;
    --desc-color: #e0e0e0b3;
    --chosen-color: #b8548d;
    scrollbar-width: none;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    margin: 0 auto;
    padding: 1.5rem;
}

a.h1 {
    display: block;
    width: fit-content;
    margin: 0.67em auto;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    margin-bottom: 2rem;
    font-size: 1.7em;
}

.search-container {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 2rem;
    max-width: 75vw;
    margin-left: auto;
    margin-right: auto;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 1rem;
    border: none;
    border-radius: 50px;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.7;
}

#letters-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.letter-item {
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.letter-item.active {
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: bold;
    transform: scale(1.25);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag-btn {
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tag-btn.active {
    background-color: var(--accent-color);
}

#bookmarks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.bookmark {
    background-color: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    border: 2px solid #ffffff00;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
}

.bookmark-info {
    flex: 1;
    display: grid;
    padding: 1rem;
    min-height: 4.5rem;
    grid-template-rows: 1fr auto;
    gap: 10px;
}

.bookmark-hover {
    transform: translateY(-5px);
    background-color: var(--secondary-bg);
    border: 2px solid #e65100;
}

.bookmark-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.bookmark-desc {
    font-size: 0.85rem;
    overflow: hidden;
    overflow-wrap: break-word;
    margin-bottom: 0.5rem;
    color: var(--desc-color);
    display: none;
}

.bookmark-tags {
    display: flex;
    flex-flow: row wrap;
    gap: 4px;
    font-size: 0.7em;
}

.bookmark-tags span {
    background-color: #29b7a6c0;
    color: #222222;
    border-radius: 5px;
    padding: 0 4px;
    font-weight: bolder;
}

.bookmark-target {
    width: 18%;
    background: linear-gradient(to bottom right, #193c87, #266e6c);
    border-radius: 0 10px 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}


.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dialog-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--secondary-bg);
    border: 2px solid #e65100;
    padding: 20px;
    border-radius: 10px;
    z-index: 1001;
    max-width: 400px;
    width: 90%;
    display: grid;
    gap: 15px;
}

.dialog-content * {
    margin: 0;
}

.dialog-content h2 {
    color: var(--accent-color);
}

.dialog-content :is(input:not([type=checkbox]), textarea) {
    outline: none;
    width: 100%;
    padding: 8px 4px;
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
}

.dialog-content textarea {
    resize: vertical;
    height: 100px;
    scrollbar-width: none;
}

.dialog-content button {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.url-container {
    display: flex;
    align-items: center;
    justify-items: center;
    gap: 10px;
}

.url-container input {
    flex: 1;
}

.button-container {
    display: flex;
    gap: 10px;
}

.button-container button {
    flex: 1;
}

@media (max-width: 768px) {
    .bookmarks-container {
        grid-template-columns: 1fr;
    }
}

#add-bookmark-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    cursor: pointer;
    display: none;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#add-bookmark-btn:hover {
    transform: scale(1.2);
}

#tags-list {
    max-height: 120px;
    overflow-y: scroll;
    scrollbar-width: none;
    display: none;
    border: 1px solid var(--accent-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    background-color: var(--bg-color);
    box-sizing: border-box;
}

#tags-list button {
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 0px;

    &:hover {
        background-color: var(--bm-bg);
    }
}

#chose-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

#chose-tags-container .tag-btn {
    background-color: var(--chosen-color);
    color: var(--text-color);
    font-weight: bolder;
}

#chose-tags-container .tag-btn.new {
    background-color: #959517;
}

#tags-list .tag-btn {
    border-radius: 20px;
    font-weight: bold;
    padding: 5px;
}