/* Imported my geisty */

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&display=swap');


/* Rooooooottttttt */

:root {

    /* Colorsss */

    --prime-color: #F5F5F5;
    --second-color: #CCCCCC;
    --accent-color: #eeb0ff;

    --text-color: #323232;
    --text-light-color: #d5d5d5;

    --border-color: #E0E0E0;



    /* Typography and shii */

    --body-font: "Geist mono", sans-serif;

    --text-xs: 0.7rem;
    --text-sm: 0.75rem;
    --text-md: 0.9rem;
    --text-lg: 1rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-3xl: 3rem;

    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;


    /* Borders */

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;



    /* Shadows */

    --shadow-sm:
        2px 2px 4px #dfdada,
        -2px -2px 4px #ffffff;

    --shadow-md:
        6px 6px 12px #cfcfcf,
        -6px -6px 12px #ffffff;

    --shadow-lg:
        12px 12px 24px #cfcfcf,
        -12px -12px 24px #ffffff;



    /* Transitions */


    --transition-fast: .2s ease;
    --transition-normal: .3s ease;
    --transition-slow: .5s ease;

}

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

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--prime-color);
    transition: 500ms ease;
}

body.dark-theme {
    --prime-color: #2b2b2b;
    --second-color: #8f8f8f;
    --accent-color: #eeb0ff;

    --text-color: #f5f5f5;
    --text-light-color: #515151;

    --border-color: #3a3a3a;

    --card-bg: #2b2b2b;
    --input-bg: #242424;

    --shadow-sm:
        2px 2px 4px #1a1a1a,
        -2px -2px 4px #383838;

    --shadow-md:
        6px 6px 12px #1a1a1a,
        -6px -6px 12px #383838;

    --shadow-lg:
        12px 12px 24px #1a1a1a,
        -12px -12px 24px #383838;

    background-color: var(--prime-color);
}

h1 {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-light-color);
}

.container {
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
    padding: 30px;
    width: 100%;
    max-width: 700px;
    margin-bottom: 30px;
}
/* The different groups of the contaianer */

.header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 200ms ease;
    background-color: var(--prime-color);
    color: var(--text-color);
}

.header button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px) scale(1.03);
    background-color: var(--text-color);
    color: var(--prime-color);
}

.header button svg {
    width: 15px;
    height: 15px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-wrapper h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo-wrapper svg {
    color: var(--text-light-color);
}


.header button {
    margin-left: auto;
}



/* The prompt container and its babies */

.prompt-container {
    display: flex;
    width: 100%;
    margin: 30px 0;
    gap: 5px;
}

.prompt-container textarea {
    width: 100%;
    min-height: 50px;
    margin-right: 5px;
    border-radius: var(--radius-sm);
    padding: 10px;
    border: none;
    background-color: var(--input-bg, white);
    color: var(--text-color);
    font-size: var(--text-sm);
}

.prompt-container textarea:focus {
    border: none;
    outline: none;
}

.prompt-container button {
    width: 70px;
    min-height: 50px;
    background-color: var(--prime-color);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border: none;
    border-radius: var(--radius-sm);
    transition: 200ms ease;
}


.prompt-container button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px) scale(1.03);
    background-color: var(--accent-color);
    color: white;
}


.prompt-container svg {
    width: 20px;
    height: 20px;
}




/* The prompt selectors and the generate button area thingys*/

.prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.prompt-actions button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    left: 0;
    border: none;
    border-radius: var(--radius-sm);
    background-color: var(--prime-color);
    box-shadow: var(--shadow-sm);
    gap: 10px;
    font-weight: 600;
    color: var(--text-color);
    margin-left: auto;
    cursor: pointer;
    transition: 200ms;
}

.prompt-actions button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px) scale(1.03);
    background-color: var(--accent-color);
    color: white;
}

.prompt-actions button svg {
    width: 20px;
    height: 20px;
}


/* All the selectors are under the same class, separate o but the same class */

.select-wrapper select {
    outline: none;
    border: none;
    border-radius: var(--radius-sm);
    min-height: 30px;
    padding: 10px;
    background-color: var(--input-bg, white);
    color: var(--text-color);
}



/* The result images */

.main-content .gallery-grid:has(.img-card){
    margin-top: 30px;
}

.main-content .gallery-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(4, 1fr);
    justify-content: center;
}

.gallery-grid .img-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    min-width: 0;
    border-radius: 16px;
    background: var(--card-bg, var(--prime-color));
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.gallery-grid .img-card:not(.loading, .error):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.gallery-grid .img-card .result-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-grid .img-card:is(.loading, .error) :is(.result-img, .img-overlay) {
    display: none;
}

.gallery-grid .img-card:hover .img-download-btn {
    opacity: 0.8;
    transform: translateY(0);
}

.gallery-grid .img-card .img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    display: flex;
    justify-content: flex-end;
}

.gallery-grid .img-card .img-download-btn svg {
    width: 15px;
    height: 15px;
}

.gallery-grid .img-card .img-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    color: white;
    backdrop-filter: blur(5px);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: grey;

    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
}

.gallery-grid .img-card .img-download-btn:hover {
    transform: scale(1.05);
    opacity: 1;
}

.gallery-grid .img-card .status-container {
    padding: 15px;
    display: none;
    gap: 13px;
    flex-direction: column;
    align-items: center;
}

.gallery-grid .img-card:where(.loading, .error) .status-container {
    display: flex;
}


.gallery-grid .img-card.error .spinner {
    display: none;
}

.gallery-grid .img-card.loading .status-container svg {
    display: none;
}

.gallery-grid .img-card.error .status-container svg {
    color: #ef4444;
}

.gallery-grid .img-card.loading .spinner {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 3px solid var(--prime-color);
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

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

.gallery-grid .img-card .status-text {
    font-size: var(--text-sm);
    text-align: center;
    color: var(--second-color);
}


/* Responsive breakpoints - tablet and mobile */

@media (max-width: 768px) {

    .container {
        padding: 20px;
    }

    .main-content .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header button {
        width: 44px;
        min-height: 44px;
    }

    .header button svg {
        width: 20px;
        height: 20px;
    }

    .prompt-actions button.generate-btn {
        min-height: 44px;
        padding: 0 24px;
        font-size: var(--text-md);
    }

    .prompt-actions button.generate-btn svg {
        width: 22px;
        height: 22px;
    }

}

@media (max-width: 480px) {

    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 16px;
    }

    .prompt-actions button.generate-btn {
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: center;
    }

    .main-content .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

.my-tag {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}