* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;

    color: #111;

    background: #fff;
}


/* =========================================
   HEADER
========================================= */

.style-header {
    height: 75px;

    display: flex;
    align-items: center;

    gap: 20px;

    padding: 0 35px;

    border-bottom: 1px solid #ededed;
}


.style-logo {
    color: #111;

    text-decoration: none;

    font-size: 27px;
    font-weight: 700;
}


.back-btn {
    color: #111;

    text-decoration: none;

    font-size: 26px;
}


/* =========================================
   PAGE
========================================= */

.style-page {
    width: min(1100px, calc(100% - 40px));

    margin: auto;

    padding: 55px 0 80px;
}


/* =========================================
   TITLE
========================================= */

.style-title-area {
    margin-bottom: 35px;

    text-align: center;
}


.style-title-area h1 {
    margin-bottom: 10px;

    font-size: clamp(30px, 4vw, 45px);
}


.style-title-area p {
    color: #666;

    font-size: 16px;
}


/* =========================================
   EDITOR
========================================= */

.style-editor {
    display: grid;

    grid-template-columns:
        minmax(300px, 0.85fr)
        minmax(400px, 1.15fr);

    gap: 55px;

    padding: 35px;

    border: 1px solid #dedede;
    border-radius: 20px;

    background: #fff;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.06);
}


/* =========================================
   LEFT
========================================= */

.style-controls {
    display: flex;
    flex-direction: column;

    gap: 25px;
}


/* =========================================
   UPLOAD
========================================= */

.style-upload {
    width: 100%;
    min-height: 260px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    overflow: hidden;

    padding: 20px;

    background: #fafafa;

    border: 2px dashed #cfcfcf;
    border-radius: 16px;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}


.style-upload.dragging {
    border-color: #2563eb;

    background: #eff6ff;
}


.upload-placeholder {
    text-align: center;
}


.upload-symbol {
    margin-bottom: 12px;

    font-size: 35px;
}


.upload-placeholder h3 {
    margin-bottom: 8px;

    font-size: 20px;
}


.upload-placeholder p {
    margin-bottom: 17px;

    color: #777;

    font-size: 14px;
}


#styleBrowseBtn {
    padding: 10px 18px;

    background: #fff;

    border: 1px solid #ccc;
    border-radius: 9px;

    cursor: pointer;
}


#styleBrowseBtn:hover {
    background: #f2f2f2;
}


/* uploaded image */

.user-preview {
    display: none;

    width: 100%;
    height: 100%;

    position: absolute;

    inset: 0;

    object-fit: contain;

    padding: 10px;

    background: #f7f7f7;
}


.style-upload.has-image .user-preview {
    display: block;
}


.style-upload.has-image .upload-placeholder {
    display: none;
}


/* =========================================
   PROMPT
========================================= */

.prompt-area {
    width: 100%;
}


.prompt-area label {
    display: block;

    margin-bottom: 9px;

    font-size: 17px;
    font-weight: 600;
}


.prompt-area textarea {
    width: 100%;
    min-height: 130px;

    padding: 15px;

    resize: vertical;

    outline: none;

    border: 1px solid #ccc;
    border-radius: 12px;

    font-size: 15px;
    line-height: 1.5;
}


.prompt-area textarea:focus {
    border-color: #777;
}


.prompt-help {
    margin-top: 7px;

    color: #777;

    font-size: 12px;
}


/* =========================================
   GENERATE
========================================= */

.style-generate-btn {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 14px 20px;

    color: #fff;

    background: #111;

    border: none;
    border-radius: 11px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}


.style-generate-btn:hover {
    background: #333;
}


/* =========================================
   EXAMPLE
========================================= */

.example-area {
    min-width: 0;
}


.example-heading {
    margin-bottom: 15px;
}


.example-heading span {
    color: #777;

    font-size: 13px;
}


.example-heading h2 {
    margin-top: 3px;

    font-size: 22px;
}


.example-image-box {
    width: 100%;
    height: 470px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #f3f3f3;

    border-radius: 16px;
}


.example-image-box img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


.example-area > p {
    margin-top: 12px;

    color: #777;

    font-size: 13px;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    .style-header {
        height: 65px;

        padding: 0 15px;
    }


    .style-logo {
        font-size: 23px;
    }


    .style-page {
        width: 100%;

        padding: 35px 14px 60px;
    }


    .style-title-area {
        margin-bottom: 25px;
    }


    .style-title-area h1 {
        font-size: 30px;
    }


    .style-editor {
        grid-template-columns: 1fr;

        gap: 40px;

        padding: 18px;

        border-radius: 16px;
    }


    .style-upload {
        min-height: 230px;
    }


    .example-area {
        order: 2;
    }


    .example-image-box {
        height: 390px;
    }

}

/* =========================================
   GENERATED IMAGE DOWNLOAD
========================================= */

.style-download-btn {
    display: none;

    width: 100%;
    margin-top: 15px;
    padding: 14px 20px;

    color: #fff;
    background: #111;

    border: none;
    border-radius: 11px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.style-download-btn.show {
    display: block;
}

.style-download-btn:hover {
    background: #333;
}





/* =========================================
   STYLE GENERATING ANIMATION
========================================= */

.style-generating {
    display: none;

    width: 100%;
    height: 100%;

    position: absolute;
    inset: 0;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 20px;

    background: #f7f7f7;
}


.style-generating.show {
    display: flex;
}


.style-generating p {
    font-size: 16px;
    font-weight: 600;
}


/* animation box */

.style-generating-animation {
    width: 75%;
    height: 65%;

    position: relative;

    overflow: hidden;

    border-radius: 16px;

    background-image:
        radial-gradient(
            circle,
            #c7c7c7 1.5px,
            transparent 1.5px
        );

    background-size: 13px 13px;

    background-color: #f3f3f3;
}


/* moving glow */

.style-generating-glow {
    width: 180px;
    height: 180px;

    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    background:
        rgba(70, 120, 255, 0.35);

    filter: blur(45px);

    animation:
        styleGlow 2.3s ease-in-out infinite alternate;
}


@keyframes styleGlow {

    0% {
        transform:
            translate(-70%, -60%)
            scale(0.8);
    }

    100% {
        transform:
            translate(-30%, -40%)
            scale(1.35);
    }

}


/* =========================================
   DISABLED GENERATE BUTTON
========================================= */

.style-generate-btn:disabled {
    opacity: 0.55;

    cursor: not-allowed;

    background: #555;
}



/* Login popup overlay */
.login-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 18px;
}

.login-popup-overlay[hidden] {
    display: none !important;
}

/* Popup card */
.login-popup-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 22px;
    padding: 34px 27px;
    position: relative;
    box-shadow: 0 18px 65px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: loginPopupIn 0.25s ease-out;
    color: #172033;
}

.login-popup-close {
    position: absolute;
    right: 18px;
    top: 13px;
    font-size: 29px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
}

.login-popup-icon {
    font-size: 38px;
    background: #edf4ff;
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.login-popup-card h2 {
    font-size: 25px;
    margin: 0 0 12px;
    font-weight: 750;
}

.login-popup-description {
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 22px;
}

.login-popup-benefits {
    background: #f4f7ff;
    border-radius: 14px;
    padding: 15px;
    text-align: left;
    margin-bottom: 24px;
}

.login-popup-benefits p {
    margin: 11px 0;
    font-size: 14px;
    color: #334155;
}

.login-popup-button {
    display: block;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 650;
    transition: background 0.2s;
}

.login-popup-button:hover {
    background: #1d4ed8;
}

.login-popup-footer {
    color: #64748b;
    font-size: 12px;
    margin: 18px 0 0;
}

@keyframes loginPopupIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .login-popup-card {
        padding: 30px 20px;
    }

    .login-popup-card h2 {
        font-size: 22px;
    }
}
