/* ===========================================
   RESET
=========================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{

    --background:#14151a;
    --background2:#1b1d24;
    --background3:#242733;

    --primary:#4f7cff;
    --primaryHover:#3968f0;

    --green:#30c85d;
    --red:#ef4444;
    --yellow:#f7b731;

    --text:#ffffff;
    --text2:#d1d5db;
    --text3:#9ca3af;

    --border:#303442;

    --radius:12px;

    --transition:.2s ease;

}

body{

    background:var(--background);

    color:var(--text);

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

}

a{

    color:inherit;

    text-decoration:none;

}

button{

    border:none;

    cursor:pointer;

    transition:var(--transition);

}

input,
textarea,
select,
button{

    font-family:inherit;

}

/* ===========================================
    HEADER
=========================================== */

header{

    height:72px;

    background:var(--background2);

    border-bottom:1px solid var(--border);

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:0 50px;

}

.logo{

    font-size:26px;

    font-weight:bold;

    color:var(--primary);

}

nav{

    display:flex;

    align-items:center;

    gap:35px;

}

nav a{

    color:var(--text2);

    font-size:15px;

    transition:var(--transition);

}

nav a:hover{

    color:white;

}

.user-area{

    display:flex;

    align-items:center;

    gap:15px;

}

#username{

    color:white;

    font-weight:600;

}

#logout{

    background:var(--red);

    color:white;

    padding:10px 20px;

    border-radius:8px;

}

#logout:hover{

    opacity:.9;

}

/* ===========================================
    MAIN
=========================================== */

main{

    width:min(1400px,95%);

    margin:auto;

    padding:35px 0;

}

.page-title{

    margin-bottom:35px;

}

.page-title h1{

    font-size:34px;

}

/* ===========================================
    LOGIN
=========================================== */

.login-page{

    min-height:100vh;

    display:flex;

    align-items:center;

    justify-content:center;

}

.login-box{

    width:420px;

    background:var(--background2);

    border:1px solid var(--border);

    border-radius:18px;

    padding:40px;

}

.login-box .logo{

    display:block;

    margin:auto;

    width:90px;

    height:90px;

    object-fit:contain;

}

.login-box h1{

    text-align:center;

    margin-top:20px;

}

.login-box p{

    text-align:center;

    color:var(--text3);

    margin:10px 0 30px;

}

.login-box form{

    display:flex;

    flex-direction:column;

    gap:18px;

}

.login-box input{

    height:52px;

    background:var(--background3);

    border:1px solid var(--border);

    color:white;

    border-radius:10px;

    padding:0 16px;

    outline:none;

}

.login-box input:focus{

    border-color:var(--primary);

}

.login-box button{

    height:52px;

    background:var(--primary);

    color:white;

    font-size:16px;

    border-radius:10px;

}

.login-box button:hover{

    background:var(--primaryHover);

}

/* ===========================================
    CATEGORIAS
=========================================== */

.categories{

    display:grid;

    grid-template-columns:
        repeat(auto-fill,minmax(270px,1fr));

    gap:30px;

}

.category{

    background:var(--background2);

    border:1px solid var(--border);

    border-radius:14px;

    overflow:hidden;

    transition:.2s;

    cursor:pointer;

}

.category:hover{

    transform:translateY(-6px);

    border-color:var(--primary);

}

.category img{

    width:100%;

    height:180px;

    object-fit:cover;

}

.category h2{

    padding:18px;

    font-size:22px;

}

/* ===========================================
    PRODUTOS
=========================================== */

.products{

    display:grid;

    grid-template-columns:
        repeat(auto-fill,minmax(290px,1fr));

    gap:25px;

}

.product{

    background:var(--background2);

    border:1px solid var(--border);

    border-radius:14px;

    overflow:hidden;

    transition:.2s;

    cursor:pointer;

}

.product:hover{

    transform:translateY(-5px);

    border-color:var(--primary);

}

.product img{

    width:100%;

    height:190px;

    object-fit:cover;

}

.product-content{

    padding:18px;

}

.product-title{

    font-size:21px;

    margin-bottom:18px;

}

.price{

    font-size:27px;

    color:var(--green);

    font-weight:bold;

}

.seller{

    margin-top:12px;

    color:var(--text3);

}

/* ===========================================
    PAGINA DO ANUNCIO
=========================================== */

.announcement-page{

    display:grid;

    grid-template-columns:520px 1fr;

    gap:50px;

}

.main-image{

    width:100%;

    height:500px;

    border-radius:15px;

    object-fit:cover;

    background:var(--background2);

}

.gallery{

    margin-top:18px;

    display:flex;

    gap:12px;

    flex-wrap:wrap;

}

.gallery img{

    width:95px;

    height:95px;

    border-radius:10px;

    object-fit:cover;

    cursor:pointer;

    border:2px solid transparent;

    transition:.2s;

}

.gallery img:hover{

    border-color:var(--primary);

}

.announcement-right h1{

    font-size:38px;

}

.announcement-right .price{

    margin:20px 0;

}

.announcement-info{

    display:flex;

    flex-direction:column;

    gap:12px;

}

.announcement-info p{

    color:var(--text2);

}

.announcement-description{

    margin-top:35px;

}

.announcement-description h2{

    margin-bottom:12px;

}

.announcement-description p{

    line-height:28px;

    color:var(--text2);

}

/* ===========================================
    DADOS DA CONTA
=========================================== */

.account-data{

    margin-top:40px;

}

.account-data h2{

    margin-bottom:20px;

}

.account-item{

    margin-bottom:20px;

}

.account-item label{

    display:block;

    margin-bottom:8px;

    color:var(--text3);

}

.copy-box{

    display:flex;

    gap:12px;

}

.copy-box input{

    flex:1;

    height:48px;

    background:var(--background3);

    color:white;

    border:1px solid var(--border);

    border-radius:10px;

    padding:0 15px;

}

.copy-box button{

    width:110px;

    background:var(--primary);

    color:white;

    border-radius:10px;

}

.copy-box button:hover{

    background:var(--primaryHover);

}

/* ===========================================
    FORMULARIO
=========================================== */

.form-container{

    max-width:900px;

    margin:auto;

    background:var(--background2);

    border:1px solid var(--border);

    border-radius:16px;

    padding:35px;

}

.form-container h1{

    margin-bottom:30px;

}

#announcementForm{

    display:flex;

    flex-direction:column;

    gap:22px;

}

.form-group{

    display:flex;

    flex-direction:column;

    gap:10px;

}

.form-group label{

    color:var(--text2);

}

.form-group input,
.form-group textarea,
.form-group select{

    background:var(--background3);

    color:white;

    border:1px solid var(--border);

    border-radius:10px;

    padding:14px 16px;

    outline:none;

    font-size:15px;

}

.form-group textarea{

    resize:vertical;

    min-height:180px;

}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus{

    border-color:var(--primary);

}

.preview-images{

    display:flex;

    flex-wrap:wrap;

    gap:12px;

}

.preview-images img{

    width:120px;

    height:120px;

    border-radius:10px;

    object-fit:cover;

    border:1px solid var(--border);

}

.publish-button{

    height:55px;

    background:var(--primary);

    color:white;

    font-size:17px;

    border-radius:10px;

}

.publish-button:hover{

    background:var(--primaryHover);

}

/* ===========================================
    TOAST
=========================================== */

.toast-container{

    position:fixed;

    top:25px;

    right:25px;

    z-index:9999;

    display:flex;

    flex-direction:column;

    gap:12px;

}

.toast{

    min-width:320px;

    padding:18px 22px;

    border-radius:12px;

    color:white;

    font-weight:600;

    animation:
        toastIn .25s ease;
}

.toast-success{

    background:var(--green);

}

.toast-error{

    background:var(--red);

}

.toast-warning{

    background:var(--yellow);

    color:#111;

}

.toast-info{

    background:var(--primary);

}

@keyframes toastIn{

    from{

        opacity:0;

        transform:translateX(100%);

    }

    to{

        opacity:1;

        transform:translateX(0);

    }

}

@keyframes toastOut{

    from{

        opacity:1;

        transform:translateX(0);

    }

    to{

        opacity:0;

        transform:translateX(100%);

    }

}

.toast.hide{

    animation:toastOut .25s forwards;

}

/* ===========================================
    LOADING
=========================================== */

.loading{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.65);

    display:flex;

    align-items:center;

    justify-content:center;

    z-index:9998;

}

.loading.hidden{

    display:none;

}

.spinner{

    width:60px;

    height:60px;

    border:6px solid rgba(255,255,255,.15);

    border-top:6px solid var(--primary);

    border-radius:50%;

    animation:spin .8s linear infinite;

}

@keyframes spin{

    from{

        transform:rotate(0deg);

    }

    to{

        transform:rotate(360deg);

    }

}

/* ===========================================
    MODAL
=========================================== */

.modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.65);

    display:flex;

    align-items:center;

    justify-content:center;

    z-index:9997;

}

.modal.hidden{

    display:none;

}

.modal-box{

    width:420px;

    background:var(--background2);

    border:1px solid var(--border);

    border-radius:14px;

    padding:28px;

}

.modal-box h2{

    margin-bottom:12px;

}

.modal-box p{

    color:var(--text2);

    line-height:24px;

    margin-bottom:25px;

}

.modal-buttons{

    display:flex;

    justify-content:flex-end;

    gap:12px;

}

.modal-buttons button{

    height:42px;

    padding:0 22px;

    border-radius:8px;

}

.modal-cancel{

    background:var(--background3);

    color:white;

}

.modal-confirm{

    background:var(--red);

    color:white;

}

/* ===========================================
    SCROLLBAR
=========================================== */

::-webkit-scrollbar{

    width:10px;

}

::-webkit-scrollbar-track{

    background:var(--background);

}

::-webkit-scrollbar-thumb{

    background:var(--background3);

    border-radius:10px;

}

::-webkit-scrollbar-thumb:hover{

    background:#3a3d49;

}

/* ===========================================
    ANIMAÇÕES
=========================================== */

.category,
.product,
.form-container,
.login-box{

    animation:fadeIn .25s ease;

}

@keyframes fadeIn{

    from{

        opacity:0;

        transform:translateY(12px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}

/* ===========================================
    UTILIDADES
=========================================== */

.hidden{

    display:none !important;

}

.center{

    text-align:center;

}

.mt10{

    margin-top:10px;

}

.mt20{

    margin-top:20px;

}

.mt30{

    margin-top:30px;

}

.mb10{

    margin-bottom:10px;

}

.mb20{

    margin-bottom:20px;

}

.mb30{

    margin-bottom:30px;

}

/* ===========================================
    RESPONSIVO
=========================================== */

@media(max-width:1100px){

    .announcement-page{

        grid-template-columns:1fr;

    }

    .main-image{

        height:420px;

    }

}

@media(max-width:850px){

    header{

        padding:20px;

        height:auto;

        flex-direction:column;

        gap:20px;

    }

    nav{

        flex-wrap:wrap;

        justify-content:center;

    }

    .user-area{

        flex-wrap:wrap;

        justify-content:center;

    }

    .products{

        grid-template-columns:
            repeat(auto-fill,minmax(240px,1fr));

    }

    .categories{

        grid-template-columns:
            repeat(auto-fill,minmax(240px,1fr));

    }

}

@media(max-width:600px){

    main{

        width:95%;

    }

    .login-box{

        width:95%;

        padding:30px;

    }

    .form-container{

        padding:20px;

    }

    .page-title h1{

        font-size:28px;

    }

    .announcement-right h1{

        font-size:28px;

    }

    .price{

        font-size:24px;

    }

    .copy-box{

        flex-direction:column;

    }

    .copy-box button{

        width:100%;

        height:45px;

    }

    .preview-images img{

        width:90px;

        height:90px;

    }

    .gallery img{

        width:70px;

        height:70px;

    }

    .toast{

        min-width:unset;

        width:calc(100vw - 30px);

    }

}