/* ==========================================================
   APEMART.LK - POST AD PAGE
   PART 1 - MAIN LAYOUT
========================================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

.hero{
    width:100%;
    max-width:1600px;
    margin:40px auto;
    padding:20px 40px;
}

.hero h2{
    text-align:center;
    font-size:36px;
    color:#ff6600;
    margin-bottom:35px;
}


/* ==========================================================
   POST AD CARD
========================================================== */

#postAdForm{
    width:100%;
    max-width:1300px;
    margin:auto;

    background:#ffffff;

    border-radius:20px;

    padding:50px 60px;

    box-shadow:0 15px 40px rgba(0,0,0,.08);
}


/* ==========================================================
   FORM ROW
========================================================== */

.form-row{
    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:20px;

    margin-bottom:20px;
}


/* ==========================================================
   LABELS
========================================================== */

#postAdForm label{
    display:block;

    font-size:15px;

    font-weight:600;

    color:#444;

    margin-bottom:8px;
}


/* ==========================================================
   INPUTS
========================================================== */

#postAdForm input,
#postAdForm select,
#postAdForm textarea{

    width:100%;

    padding:15px;

    border:1px solid #ddd;

    border-radius:12px;

    font-size:15px;

    background:#fff;

    transition:.3s;
}


#postAdForm input:focus,
#postAdForm select:focus,
#postAdForm textarea:focus{

    outline:none;

    border-color:#ff6600;

    box-shadow:
        0 0 10px rgba(255,102,0,.20);
}


/* ==========================================================
   DESCRIPTION
========================================================== */

#postAdForm textarea{

    resize:none;

    min-height:170px;

    margin-top:10px;
}


/* ==========================================================
   FORM SPACING
========================================================== */

#postAdForm input,
#postAdForm select{

    margin-bottom:18px;
}


/* ==========================================================
   PART 2 - PHOTO UPLOAD
========================================================== */

.upload-box{

    margin-bottom:40px;
}


.upload-box h3{

    text-align:center;

    font-size:32px;

    color:#ff6600;

    margin-bottom:10px;
}


.upload-box p{

    text-align:center;

    color:#666;

    margin-bottom:25px;
}


/* ==========================================================
   PHOTO UPLOAD AREA
========================================================== */
.upload-area{
    position:relative;
    width:100%;
    min-height:210px;

    border:2px dashed #ddd;

    border-radius:20px;

    background:#fff;

    overflow:hidden;

    transition:.3s;

    cursor:pointer;
}

.upload-area:hover{
    background:#fafafa;
    border-color:#ccc;
}


/* ==========================================================
   UPLOAD CONTENT
========================================================== */

.upload-content{

    position:absolute;

    inset:0;

    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    text-align:center;
}


.camera-icon{

    font-size:70px;

    margin-bottom:15px;
}


.upload-content h4{

    font-size:28px;

    color:#ff6600;

    margin-bottom:10px;
}


.upload-content small{

    color:#777;

    font-size:15px;
}


/* ==========================================================
   PHOTO PREVIEW CONTAINER
========================================================== */

#previewContainer{

    position:absolute;

    top:15px;
    left:15px;
    right:15px;
    bottom:15px;

    display:none;

    /*
       Desktop:
       4 photos = 4 equal columns
    */

    grid-template-columns:
        repeat(4, 1fr);

    gap:12px;

    align-items:stretch;
}


#previewContainer.show{

    display:grid;
}


/* ==========================================================
   INDIVIDUAL PHOTO CARD
========================================================== */

.preview-card{
    position:relative;
    width:100%;
    height:180px;
    border-radius:15px;
    overflow:hidden;
    background:#eee;
    box-shadow:0 4px 12px rgba(0,0,0,.08);
}


/* ==========================================================
   PREVIEW IMAGE
========================================================== */

.preview-card img{

    width:100%;

    height:100%;

    object-fit:cover;

    display:block;
}


/* ==========================================================
   REMOVE PHOTO BUTTON
========================================================== */

.remove-btn{

    position:absolute;

    top:8px;

    right:8px;

    width:30px;

    height:30px;

    border:none;

    border-radius:50%;

    background:#ff3b30;

    color:#fff;

    font-size:18px;

    font-weight:bold;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    z-index:10;

    transition:.2s;
}


.remove-btn:hover{

    background:#d92d25;

    transform:scale(1.08);
}


/* ==========================================================
   PART 3 - SUBMIT BUTTON
========================================================== */

#postAdForm button[type="submit"]{

    width:260px;

    margin:35px auto 0;

    display:block;

    padding:16px 25px;

    border:none;

    border-radius:50px;

    background:#ff6600;

    color:#fff;

    font-size:18px;

    font-weight:700;

    cursor:pointer;

    transition:.3s;

    box-shadow:
        0 8px 20px rgba(255,102,0,.30);
}


#postAdForm button[type="submit"]:hover{

    background:#e65c00;

    transform:translateY(-3px);

    box-shadow:
        0 12px 25px rgba(255,102,0,.35);
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width:992px){

    .hero{

        padding:20px;
    }


    #postAdForm{

        padding:30px;
    }


    /*
       Tablet:
       2 photos per row
    */

    #previewContainer{

        grid-template-columns:
            repeat(2, 1fr);

        gap:12px;
    }


    .preview-card{

        height:150px;
    }

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width:768px){

    .hero h2{

        font-size:28px;
    }


    .form-row{

        grid-template-columns:1fr;
    }


    #postAdForm{

        padding:20px;
    }


    .upload-area{

        min-height:270px;
    }


    .camera-icon{

        font-size:55px;
    }


    .upload-content h4{

        font-size:22px;
    }


    /*
       Mobile:
       2 photos per row
    */

    #previewContainer{

        top:10px;
        left:10px;
        right:10px;
        bottom:10px;

        grid-template-columns:
            repeat(2, 1fr);

        gap:8px;
    }


    .preview-card{

        height:120px;

        border-radius:12px;
    }


    .remove-btn{

        top:6px;
        right:6px;

        width:28px;
        height:28px;

        font-size:16px;
    }


    #postAdForm button[type="submit"]{

        width:100%;
    }

}


/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width:480px){

    .hero{

        padding:15px;
    }


    .hero h2{

        font-size:24px;
    }


    .upload-area{

        min-height:270px;
    }


    .camera-icon{

        font-size:45px;
    }


    .upload-content h4{

        font-size:18px;
    }


    .upload-content small{

        font-size:13px;
    }


    /*
       Small phones:
       2 photos per row
    */

    #previewContainer{

        top:8px;
        left:8px;
        right:8px;
        bottom:8px;

        grid-template-columns:
            repeat(2, 1fr);

        gap:7px;
    }


    .preview-card{

        height:105px;

        border-radius:10px;
    }


    .remove-btn{

        top:5px;
        right:5px;

        width:26px;
        height:26px;

        font-size:15px;
    }

}