@import url('https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    border: none;
    scrollbar-width: thin;
    scrollbar-color: #8b9bb480 transparent;
    transition: all .2s ease;
}

body {
    background: url('https://images.unsplash.com/photo-1477346611705-65d1883cee1e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') no-repeat center center fixed;
    background-size: cover;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

h1 {
    font-family: "Major Mono Display", monospace;
    color: #ffd6ec;
    padding: 3rem;
    text-align: center;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 250px;
}

#title, #tags, #search, button, textarea, .snippet pre {
    font-size: .9rem;
    padding: 8px;
    border-radius: 4px;
}

#search::placeholder {
    color: #efefef99;
}

#search {
    width: 235px;
    color: #efefef;
    border: 1px solid #8b9bb480;
}

.form, #search, .snippet {
    background-color: #8b9bb480;
    backdrop-filter: blur(16px);
    border-radius: 8px;
    padding: 10px;
}

button {
    background-color: #ffd6ec;
    cursor: pointer;
}

#snippets button {
    background-color: #cecece;
    padding: 5px 8px;
    margin-right: 5px;
}

button:hover {
    filter: brightness(0.9);
}

.snippets-container {
    flex: 2;
    width: 100%;
}

#snippets {
    column-count: 2;
    column-gap: 1rem;
    margin-top: 1rem;
}

/* make each snippet adjusts to column width automatically */
.snippet {
    margin-bottom: 1rem;
    width: 100%;
    break-inside: avoid;
}

.flex-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    color: #efefef;
    font-size: .9rem;
}

textarea {
    resize: none;
    height: 200px;
}

textarea, .snippet pre {
    background-color: #fafafab3;
}

.snippet pre {
    margin: 8px auto;
    max-height: 300px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* tablet and mobile responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
        padding: 2rem;
    }

    .container {
        flex-direction: column;
    }

    .form {
        width: 100%;
    }
}

@media (max-width: 430px) {
    h1 {
        font-size: 1.3rem;
        padding: 1.5rem 1rem;
    }

    .container {
        padding: 0 1rem 2rem;
    }

    #snippets {
        column-count: 1;
    }
}