@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Work Sans", "sans-serif";
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    padding: 0 1.2rem;
    margin-top: 1rem;
}

.add-clothing {
    padding: 1.5rem 2rem;
    margin: 0rem auto;
    border: 1px dashed #5c5b5b;
    max-width: 920px;
    margin-bottom: 2rem;
}

.upload-clothing-container {
    margin-top: 1.1rem;
    margin-bottom: 1.5rem;
}

.upload-image-label,
#add-image-btn {
    padding: 0.5rem 2rem;
    border: 1px solid black;
    background-color: black;
    color: white;
    cursor: pointer;
    border-radius: 0.25rem;
}

#clothing-name-input {
    padding: 0.4rem 2rem;
    font-size: 1rem;
}

#upload-image {
    display: none;
}

.category-container {
    margin-top: 1rem;
    display: inline-block;
    background-color: #fff;
    border: 1px solid #000;
    padding: 0.4rem 1rem;
    border-radius: 0.25rem;
}

.category-container:hover {
    box-shadow: 0 0 0.3rem rgba(0, 0, 0, 0.2);
}

#category-bar {
    max-width: 100%;
    background-color: #fff;
    color: #000;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.4rem 2rem 0.4rem 0.4rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='black' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.7rem;
    border-radius: 0.4rem;
    max-width: 400px;
}

#category-bar option {
    background-color: #ffffff;
    color: #000;
}

.image-container {
    width: 10rem;
    height: 10rem;
    margin: 0rem auto;
    text-align: center;
    border: 1px solid #000000;
}

#image-preview {
    width: 100%;
    height: 80%;
    object-fit: contain;
}

#image-preview:not([src]),
#image-preview[src=""] {
    visibility: hidden;
}

#add-image-btn {
    display: flex;
    margin: auto;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    margin-top: -0.6rem;
    border-radius: 0.25rem;    
    text-align: center;
}

.wardrobe-preview {
    margin: 1.5rem auto;
    border: 1px solid #ddd;
    padding: 2rem;
    max-width: 920px;
    width: 100%;
    background-color: #f9f9f9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wardrobe-actions {
    margin-top: 2rem;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.wardrobe-actions a {
    padding: 0.6rem 1.3rem;
    text-decoration: none;
    color: #ffffff;
    background-color: #000;
    border-radius: 0.25rem;
}

.wardrobe-grid {
    margin: 1.5rem auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 1.8rem;
    max-width: 800px;
    width: 100%;
}

.wardrobe-grid .item-container {
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
}


/* want to show only 6 clothes on the front page so that's 
why displaying none onward */
.wardrobe-grid .item-container:nth-child(n+7) {
    display: none;
}

main h1 {
    font-weight: 530;
}

@media (max-width: 550px) {
    main h1 {
        font-size: 1.5rem;
    }

    .add-clothing {
        margin-top: 2rem;
    }

    .add-clothing,
    .wardrobe-preview {
        padding: 0;
        border: none;
        max-width: 100%;
        background-color: #ffffff;
        box-shadow: none;
    }

    .wardrobe-preview {
        border-top: 1px solid rgb(158, 157, 157);
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .upload-clothing-container {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem;
    }

    .upload-clothing-container>div:first-child {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
    }

    .upload-image-label {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }

    #clothing-name-input {
        flex: 1 1 auto;
        min-width: 0;
        margin-top: 0;
        max-width: 100%;
    }

    .image-container {
        width: 100%;
        height: 200px;
        border: 1px dashed gray;
        border-radius: 0.6rem;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    #clothing-name-input {
        padding: 0.8rem;
        font-size: 1rem;
        margin-top: 0;
        border: 1px solid #ccc;
    }

    #image-preview {
        width: 100%;
        height: 90%;
        object-fit: contain;
    }

    .upload-image-label {
        padding: 0.8rem;
        border-radius: 0.25rem;
        margin-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .category-container {
        width: 100%;
        padding: 0.6rem;
        margin-top: 0rem;
        border: 1px solid #969696;
        border: 1px solid #ccc
    }

    #category-bar {
        width: 100%;
        font-size: 1rem;
    }

    #add-image-btn {
        width: 100%;
        padding: 0.9rem;
        border-radius: 0.25rem;
        display: inline-block;
        text-align: center;
    }

    .wardrobe-actions a {
        border-radius: 0.25rem;
        padding: 0.9rem;
    }
}


@media (max-width: 770px) {
    .category-container {
        margin-bottom: 1rem;
    }
}

@media (max-width: 710px) {
    .wardrobe-grid {
        gap: 1rem;
    }
}

@media(max-width: 566px) {
    .wardrobe-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    .wardrobe-actions {
        justify-content: center;
        gap: 1rem;
    }

    .wardrobe-actions a {
        flex: 1 1 120px;
        text-align: center;
        max-width: 180px;
        font-size: 0.9rem;
        border-radius: 0.25rem;
    }
}