html, body{
    scroll-behavior: smooth;
}
body{
    background-color: #CBCBCB;
    margin: 0;
    font-size: 14px;
    color: #2E373A;
    font-family: "Libre Baskerville", serif, Georgia, "Times New Roman", Times, serif;
}
*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style: none;
}
main{
    width: min(1400px, 100vw);
    margin: auto;
    padding: 20px;
}
header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
header img{
    height: 40px;
}
.banner .content{
    font-family: "Odibee Sans", sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.banner .content h1{
    font-size: 17em;
}
.banner .content .right{
    text-align: right;
    transform: translateY(-30px);
}
.banner .content .right h2{
    font-size: 7em;
    font-weight: 200;
}
.banner .image{
    width: 100%;
    height: 600px;
    background-image: url(images/banner.png);
    position: relative;
}
.banner .image img{
    position: absolute;
    height: 130%;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0px;
}
.grid figure img{
    width: 100%;
}

.grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(var(--row), 100px);
    margin-top: 50px;
    gap: 50px;
}
.grid-1 figure:nth-child(1){
    grid-column: 2 / 6;
    grid-row: 1;
}
.grid-1 figure:nth-child(2){
    grid-column: 3 / 5;
    grid-row: 1;
}
.grid-1 h2:nth-child(3){
    font-size: 7em;
    grid-column: 1 / 7;
    text-align: center;
    grid-row: 5;
    z-index: 1;
}
.grid-1{
    --row: 2;
}
.grid-2{
    --row: 8;
    font-size: 1.7em;
}
.grid-2 div:nth-child(1){
    grid-column: 1 / 4;
    grid-row: 3;
}
.grid-2 div:nth-child(2){
    grid-column: 4 / 7;
    grid-row: 1;
}
.grid-2 div:nth-child(3){
    grid-column: 4 / 7;
    grid-row: 4;
}
.grid-2 div:nth-child(4){
    grid-column: 1 / 4;
    grid-row: 6;
}
.grid-3{
    --row: 6;
    font-size: 10em;
}
.grid-3 div{
    grid-column: 2/ 6;
    text-wrap: nowrap;
}
.grid-3 div:nth-child(even){
    text-align: right;
}
.grid-3 div:nth-child(5){
    grid-column: 1/ 6;
}
.grid-3 div:nth-child(4){
    grid-column: 1/ 7;
}
footer{
    border-top: 1px solid #2E373A55;
    min-height: 100vh;
}
footer .content{
    width: min(1400px, 100vw);
    margin: auto;
    padding: 100px 20px;
}
.grid-5{
    --row: 5;
    font-size:1.7em;
}
.grid-5 div:nth-child(1){
    grid-row: 1;
    grid-column: 1 / 3;
}
.grid-5 div:nth-child(2){
    grid-row: 2;
    grid-column: 3 / 5;
}
.grid-5 div:nth-child(3){
    grid-row: 3;
    grid-column: 5 / 7;
}
.grid-5 div:nth-child(4){
    grid-row: 1;
    grid-column: 5 / 7;
}

/* ================= TABLET RESPONSIVE (768px - 1023px) ================= */
@media screen and (max-width: 1023px) and (min-width: 768px){
    header img{
        height: 2.5em;
    }
    .banner .content h1{
        font-size: 10em;
    }
    .banner .content .right{
        transform: none;
    }
    .grid-2 div:nth-child(1){
        grid-row: 2;
    }
    .grid-2 div:nth-child(3){
        grid-row: 6;
    }
    .grid-2 div:nth-child(4){
        grid-row: 5;
    }
    .grid-3{
        font-size: 5em;
        line-height: 1em;
    }
    
    /* Forms section improvements for tablets */
    .container {
        flex-direction: column;
        gap: 30px;
    }
    
    .half {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .separator {
        display: none;
    }
}

/* ================= MOBILE RESPONSIVE (up to 767px) - ENHANCED ================= */
@media screen and (max-width: 767px){
    /* Prevent horizontal scrolling */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Header mobile optimization */
    header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: space-between;
        align-items: center;
        min-height: 60px;
        position: relative;
        z-index: 1000;
    }
    
    header img{
        height: 35px;
        width: auto;
        max-width: 150px;
    }
    
    /* Login container mobile */
    .login-container {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }
    
    .login-container > div {
        width: auto;
        min-width: 120px;
        max-width: 200px;
    }
    
    .login-container button {
        padding: 8px 16px;
        font-size: 0.9em;
        white-space: nowrap;
    }
    
    /* User info mobile */
    .user-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 10px;
        width: 100%;
    }
    
    .user-welcome {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .user-welcome span {
        font-size: 0.9em;
    }
    
    .credits-display {
        font-size: 0.85em;
        padding: 5px 10px;
        border-radius: 15px;
        background: rgba(78, 205, 196, 0.2);
        border: 1px solid rgba(78, 205, 196, 0.4);
    }
    
    /* Main branding - "code de bhai . com" mobile optimization */
    .banner .content h1{
        font-size: 3.2em !important;
        text-align: center;
        line-height: 0.9;
        margin-bottom: 20px;
        word-break: break-word;
        padding: 0 10px;
    }
    
    .banner .content{
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px 15px;
        order: 1;
    }
    
    .banner .content .right {
        margin-top: 15px;
        text-align: center;
        width: 100%;
    }
    
    .banner .content .right h2 {
        font-size: 2.8em;
        margin-bottom: 15px;
        line-height: 1.1;
    }
    
    .banner .content .right p {
        font-size: 1.1em;
        line-height: 1.4;
        margin: 8px 0;
        padding: 0 15px;
        max-width: 100%;
    }
    
    .banner{
        overflow: hidden;
        padding: 20px 0;
        margin-bottom: 30px;
    }
    
    /* Image section mobile */
    .banner .image {
        height: 350px;
        margin-top: 20px;
        order: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    .banner .image img {
        height: 100%;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
    
    /* Forms section mobile optimization */
    #formsSection {
        margin-top: 40px;
        padding: 0 15px;
        clear: both;
        position: relative;
        z-index: 10;
    }
    
    .container {
        flex-direction: column;
        gap: 30px;
        width: 100%;
        max-width: none;
        align-items: center;
    }
    
    .half {
        width: 100%;
        min-width: auto;
        max-width: 450px;
        margin: 0 auto;
    }
    
    .separator {
        display: none;
    }
    
    .form-container {
        padding: 25px 20px;
        margin: 0 auto;
        border-radius: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .form-container h1 {
        font-size: 1.4em;
        margin-bottom: 20px;
        text-align: center;
        line-height: 1.3;
    }
    
    /* Form inputs mobile */
    .form-container input,
    .form-container select,
    .form-container textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        margin-bottom: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-container label {
        font-size: 0.95em;
        margin-bottom: 8px;
        display: block;
    }
    
    .form-container button {
        font-size: 1.1em;
        padding: 15px 25px;
        width: 100%;
        margin-top: 15px;
        box-sizing: border-box;
    }
    
    /* Grid system mobile */
    .grid-1 h2:nth-child(3){
        font-size: 2.2em;
        padding: 0 15px;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .grid{
        display: block;
        margin-top: 40px;
        padding: 0 15px;
    }
    
    .grid-3{
        font-size: 2.5em;
        display: block;
        margin-bottom: 40px;
        text-align: center;
        line-height: 1.1;
        padding: 0 10px;
    }
    
    /* Modal mobile optimization */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 20px auto;
        max-height: 85vh;
        overflow-y: auto;
        padding: 20px 15px;
    }
    
    .modal h2 {
        font-size: 1.6em;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .modal input,
    .modal select,
    .modal textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Progress container mobile */
    .progress-wrapper {
        width: 95%;
        max-width: 95%;
        padding: 25px 20px;
        margin: 0 auto;
    }
    
    .progress-title {
        font-size: 1.2rem;
    }
    
    .progress-icon {
        font-size: 2.2rem;
    }
    
    /* Pricing section mobile */
    .pricing-container {
        flex-direction: column;
        gap: 25px;
        padding: 0 15px;
    }
    
    .pricing-card {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }
    
    /* Customization modal mobile */
    .customization-content {
        width: 95%;
        max-width: 95%;
        padding: 20px 15px;
        max-height: 80vh;
    }
    
    .customization-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Footer mobile */
    footer {
        margin-top: 40px;
        padding: 30px 15px;
        clear: both;
    }
    
    footer .grid-5.content {
        padding: 0 15px;
    }
    
    footer .grid-5.content .insta-icon svg {
        width: 25px;
        height: 25px;
    }
}

/* ================= SMALL MOBILE (up to 480px) - ENHANCED ================= */
@media screen and (max-width: 480px) {
    /* Prevent any horizontal overflow */
    * {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Header extra small mobile */
    header {
        padding: 8px 10px;
        min-height: 50px;
    }
    
    header img {
        height: 30px;
        max-width: 120px;
    }
    
    /* Login buttons smaller */
    .login-container button {
        padding: 6px 12px;
        font-size: 0.8em;
        min-width: 80px;
    }
    
    /* User info compact */
    .user-info {
        padding: 8px;
    }
    
    .user-welcome span {
        font-size: 0.8em;
    }
    
    .credits-display {
        font-size: 0.75em;
        padding: 4px 8px;
    }
    
    /* Extra small mobile optimizations */
    .banner .content h1{
        font-size: 2.5em !important;
        padding: 0 5px;
        margin-bottom: 15px;
    }
    
    .banner .content .right h2 {
        font-size: 2.2em;
        margin-bottom: 10px;
    }
    
    .banner .content .right p {
        font-size: 0.95em;
        padding: 0 10px;
        margin: 5px 0;
    }
    
    /* Image section smaller */
    .banner .image {
        height: 280px;
        margin-top: 15px;
    }
    
    .form-container {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .form-container h1 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .form-container input,
    .form-container select,
    .form-container textarea {
        padding: 10px;
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .form-container button {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .grid-3{
        font-size: 2em;
        padding: 0 8px;
        margin-bottom: 30px;
    }
    
    .grid-1 h2:nth-child(3) {
        font-size: 1.8em;
        padding: 0 10px;
    }
    
    .modal-content {
        width: 98%;
        padding: 15px 10px;
        margin: 10px auto;
    }
    
    .modal h2 {
        font-size: 1.4em;
    }
    
    .progress-wrapper {
        width: 98%;
        padding: 20px 15px;
    }
    
    .progress-title {
        font-size: 1.1rem;
    }
    
    .progress-icon {
        font-size: 2rem;
    }
    
    /* Customization modal compact */
    .customization-content {
        width: 98%;
        padding: 15px 10px;
        max-height: 75vh;
    }
    
    /* Footer compact */
    footer {
        padding: 25px 10px;
    }
    
    footer .grid-5.content {
        font-size: 1.2rem;
    }
    
    footer .grid-5.content .insta-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* ================= LANDSCAPE MOBILE OPTIMIZATION - ENHANCED ================= */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .banner .image {
        height: 250px;
    }
    
    .banner .content h1{
        font-size: 2.2em !important;
        margin-bottom: 10px;
    }
    
    .banner .content .right h2 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .banner .content .right p {
        font-size: 0.9em;
        margin: 3px 0;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .progress-wrapper {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .form-container {
        padding: 20px 15px;
    }
    
    .form-container h1 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
}

/* ================= TABLET RESPONSIVE (768px - 1023px) ================= */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .banner .content h1 {
        font-size: 4.5em;
    }
    
    .banner .content .right h2 {
        font-size: 3.5em;
    }
    
    .container {
        flex-direction: row;
        gap: 20px;
    }
    
    .half {
        flex: 1;
        min-width: 45%;
    }
    
    .separator {
        display: block;
        width: 2px;
    }
}

/* ================= TOUCH DEVICE OPTIMIZATIONS ================= */
@media (hover: none) and (pointer: coarse) {
    button,
    .login-container button {
        min-height: 44px;
        min-width: 44px;
    }
    
    input,
    select,
    textarea {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .form-container:hover {
        transform: none;
    }
    
    button:hover {
        transform: none;
    }
}

/* ================= HIGH DPI OPTIMIZATION ================= */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    header img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .banner .image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

.autoRotate{
    animation: autoRotateAnimation;
    animation-timeline: view();
}
@keyframes autoRotateAnimation{
    from{
        transform: rotate(0deg);
    }
    to{
        transform: rotate(360deg);
    }
}
.autoShow{
    animation: autoShowAnimation both;
    animation-timeline: view(70% 5%);

}
@keyframes autoShowAnimation{
    from{
        opacity: 0;
        transform: translateY(200px) scale(0.3);
    }to{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.autoBLur{
    animation: autoBLurAnimation linear both;
    animation-timeline: view();
}
@keyframes autoBLurAnimation{
    0%{
        filter: blur(40px);
    }
    45%, 55%{
        filter: blur(0px);
    }
    100%{
        filter: blur(40px);
    }
}