*{
    margin: 0;
    padding: 0;
    font-family: "Suisseworks Webs", Georgia, sans-serif;
    box-sizing: border-box;
}

body{
    background: linear-gradient(90deg, rgba(165, 42, 42, 0.039) 20%, white 80%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header{
    width: 100%;
}

.top_head{
    background-image: url("head_bg.avif");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    width: 100%;
    text-align: center;
    color: white;
    font-size: smaller;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 30px;
}

.main_head{
    padding-top: 20px;
    padding-inline: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main_head img{
    width: 150px; /* Adjusted size to prevent overflow */
}

/* Responsive Container */
.content{
    padding-top: 20px;
    display: flex;
    gap: 20px;
    padding-inline: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.content .left, .content .right{
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.content .left .card_preview, .content .right .card_input{
    width: 100%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
}

/* CARD STYLING */
.card{
    box-shadow: inset 3px 5px 14px rgba(0, 0, 0, 0.194);
    padding: 6px;
    justify-content: center;
    display: flex;
    align-items: center;
    background-image: url("head_bg.avif");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    margin-bottom: 20px;
    border-radius: 12px;
}

.card_wrapper{
    /* Background gradient is updated dynamically via JS */
    background: linear-gradient(45deg, #F7EAB7, rgba(255, 255, 255, 0.6));
    position: relative;
    width: 400px;
    height: 200px;
    padding-top: 10px;
    padding-inline: 10px;
    border-radius: 10px;
    overflow: hidden; /* Important for clean download */
}
.card_wrapper .overlay{
    background-image: url("card_bg.jpg");
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.5;
    

    
}
.card_wrapper .header {
    padding-bottom: 30px;

}

.card_wrapper .header .logo{
    width: 40%;
    float: right;
    display: flex;
    justify-content: right;
    padding-right: 20px;

}

.card_wrapper .header .logo img{
    width: 50%;
    z-index: 100;
}

.middle_content{
    display: flex;
    padding-top: 8px;
}

/* FIXED IMAGE FRAME */
.card_wrapper .image_frame{
    width: 120px;
    height: 120px;
    position: relative;
    /* Removed overflow: hidden so the mag badge can be outside */
}

.image_frame .overlay{
    background: rgba(40, 40, 40, 0.194);
    position: absolute;
    inset: 0;
    border-radius: 10px; /* Added directly here */
}
.image_frame .frame{
    position: absolute;
    inset: 0;
    top: -12px;
    left: -10px;
}
.image_frame .frame img{
    width: 140px;
}

.image_frame img#profile_image{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px; /* Added directly here */
    display: block;
}

.image_frame .mag_frame{
    position: absolute;
    bottom: -25px;
    right: -8px;
    width: 40px;
    height: 90px;
   
}

.image_frame .mag_frame img {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

.text_content{
    display: flex;
    flex-direction: column;
    margin-left: 20px;
    gap: 20px;
    width: 100%;
    color: #000;
    z-index: 100;
}

.text_content .profile_name_text{
  

    font-size: smaller;
}

footer p{
    letter-spacing: 5px; 
    font-size: smaller;
    position: absolute;
    bottom: 10px;
    inset-inline: 0;
    text-align: center;
    color: #000;
}

/* BUTTON STYLING */
.download_btn button{
    width: 100%;
    border: none;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all ease-in-out 0.3s;
    background: rgba(165, 42, 42, 0.7);
    color: white;
    font-weight: bold;
}

.download_btn button:hover{
    background: rgba(165, 42, 42, 1);
}

/* RIGHT INPUT STYLING */
.right .card_input .header{
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 26px;
}

.profile_input{
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile_input > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile_input input, .profile_input select {
    padding: 10px;
    border-radius: 10px; 
    border: 1px solid rgb(188, 188, 188);
    width: 100%;
    outline: none;
}

/* RESPONSIVE VIEWS */
@media (max-width: 900px) {
    .content{
        flex-direction: column;
    }
    .content .left, .content .right{
        width: 100%;
    }
    .card_wrapper {
        width: 100%; /* Allows card to fit mobile screens */
    }
}
