/* =========================================================
   UPSCALORA HOME PAGE
   indexnew.css

   Desktop + Tablet + Mobile
========================================================= */


/* =========================================================
   1. RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #111111;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
textarea,
input {
    font: inherit;
}


/* =========================================================
   2. MAIN LAYOUT
========================================================= */

.app-layout {
    width: 100%;
    height: 100vh;

    display: flex;

    overflow: hidden;
}


/* =========================================================
   3. LEFT SIDEBAR
========================================================= */

.sidebar {
    width: 300px;
    height: 100vh;

    flex-shrink: 0;

    background: #faf9f0;

    padding: 28px 18px;

    overflow: visible;   

    border-right: 1px solid #eeeeee;

    position: relative;
    z-index: 100;
}


/* LOGO */

.logo {
    margin: 0 0 45px 15px;
    padding: 0;

    font-size: 32px;
    font-weight: 700;

    text-align: left;
}


/* =========================================================
   4. SIDEBAR ITEMS
========================================================= */

.sidebar-item {
    position: relative;

    width: 100%;

    margin-bottom: 10px;
}


.sidebar-link {
    width: 100%;

    min-height: 52px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 12px 15px;

    border-radius: 10px;

    font-size: 17px;
    font-weight: 500;

    color: #222222;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.sidebar-link:hover {
    background: #efeee6;
}


.menu-arrow {
    margin-left: auto;

    font-size: 25px;
    line-height: 1;
}


/* =========================================================
   5. SIDEBAR FLYOUT MENU
========================================================= */

.has-submenu {
    position: relative;
}


.flyout-menu {
    display: none;

    width: 235px;

    position: absolute;

    left: 100%;
    top: 0;

    padding: 10px;

    background: #ffffff;

    border: 1px solid #e6e6e6;
    border-radius: 14px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.12);

    z-index: 1000;
}


.has-submenu:hover .flyout-menu {
    display: block;
}


.flyout-menu a {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 13px;

    border-radius: 9px;

    font-size: 15px;

    transition: background 0.2s ease;
}


.flyout-menu a:hover {
    background: #f4f4f4;
}


/* =========================================================
   6. RIGHT / MAIN CONTENT
========================================================= */

.main-content {
    flex: 1;

    min-width: 0;
    height: 100vh;

    position: relative;

    overflow-y: auto;
    overflow-x: hidden;

    padding:
        30px
        clamp(25px, 5vw, 75px)
        80px;
}


/* =========================================================
   7. LOGIN + REGISTER
========================================================= */

.auth-buttons {
    width: 100%;

    display: flex;
    justify-content: flex-end;
    align-items: center;

    gap: 10px;

    margin-bottom: 45px;
}


.login-btn,
.register-btn {
    min-width: 90px;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    padding: 11px 20px;

    border-radius: 9px;

    font-size: 15px;
    font-weight: 600;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


/* REGISTER */

.register-btn {
    background: #ffffff;

    color: #1d4ed8;

    border: 1px solid #2563eb;
}


.register-btn:hover {
    background: #eff6ff;
}


/* LOGIN */

.login-btn {
    background: #2563eb;

    color: #ffffff;

    border: 1px solid #2563eb;
}


.login-btn:hover {
    background: #1d4ed8;
}


.login-btn:active,
.register-btn:active {
    transform: scale(0.97);
}


/* =========================================================
   8. MAIN TITLE
========================================================= */

.main-title {
    margin: 20px auto 35px;

    padding: 0;

    text-align: center;

    font-size: clamp(32px, 4vw, 52px);
    font-weight: 600;

    line-height: 1.15;

    letter-spacing: -1px;
}


/* =========================================================
   9. AI PROMPT BOX
========================================================= */

.ai-prompt-box {
    width: min(100%, 850px);
    min-height: 150px;

    margin: 0 auto 65px;

    padding: 18px;

    display: grid;

    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "textarea textarea textarea"
        "upload empty generate";

    gap: 14px;

    background: #ffffff;

    border: 1px solid #d7d7d7;
    border-radius: 20px;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.07);
}


/* TEXTAREA */

.ai-prompt-box textarea {
    grid-area: textarea;

    width: 100%;
    min-height: 75px;

    resize: none;

    border: none;
    outline: none;

    padding: 8px 6px;

    background: transparent;

    color: #222222;

    font-size: 16px;
    line-height: 1.5;
}


.ai-prompt-box textarea::placeholder {
    color: #8a8a8a;
}


/* =========================================================
   10. PROMPT UPLOAD BUTTON
========================================================= */

.prompt-upload-btn {
    grid-area: upload;

    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 9px 14px;

    background: #f4f4f4;

    border: 1px solid #dddddd;
    border-radius: 10px;

    color: #222222;

    cursor: pointer;

    transition: background 0.2s ease;
}


.prompt-upload-btn:hover {
    background: #eaeaea;
}


.plus-icon {
    font-size: 21px;
    line-height: 1;
}


/* =========================================================
   11. GENERATE BUTTON
========================================================= */

.generate-btn {
    grid-area: generate;

    display: inline-flex;
    align-items: center;

    gap: 9px;

    padding: 10px 17px;

    background: #111111;

    border: none;
    border-radius: 10px;

    color: #ffffff;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.generate-btn:hover {
    background: #333333;
}


.generate-btn:active {
    transform: scale(0.97);
}


.generate-arrow {
    font-size: 17px;
}


/* =========================================================
   12. STYLE SECTIONS
========================================================= */

.styles-section {
    width: 100%;

    margin: 0 0 65px;
}


.styles-section h2,
.cartoon-style1 {
    margin-bottom: 22px;

    font-size: 25px;
    font-weight: 600;

    line-height: 1.3;
}


/* =========================================================
   13. HORIZONTAL IMAGE SCROLLER
========================================================= */

.style-scroll-container {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 5px 2px 16px;

    scroll-behavior: smooth;

    scrollbar-width: thin;
}


.style-cards {
    width: max-content;

    display: flex;
    align-items: stretch;

    gap: 18px;
}


/* =========================================================
   14. IMAGE CARDS
========================================================= */

.style-card {
    width: 190px;

    flex: 0 0 190px;

    position: relative;

    overflow: hidden;

    background: #f3f3f3;

    border-radius: 15px;

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.style-card:hover {
    transform: translateY(-5px);

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.13);
}


/* IMAGE */

.style-card img {
    width: 100%;
    height: 235px;

    display: flex;

    object-fit: cover;

    margin: 0;

    transition: transform 0.35s ease;
}


.style-card:hover img {
    transform: scale(1.05);
}


/* STYLE NAME */

.style-name {
    width: 100%;

    position: absolute;

    left: 0;
    bottom: 0;

    padding: 28px 12px 12px;

    color: #ffffff;

    font-size: 15px;
    font-weight: 600;

    background:
        linear-gradient(
            transparent,
            rgba(0, 0, 0, 0.75)
        );
}


/* =========================================================
   15. TABLET
   601px - 1024px
========================================================= */

@media (min-width: 601px) and (max-width: 1024px) {

    .sidebar {
        width: 220px;

        padding: 25px 12px;
    }


    .logo {
        margin-left: 10px;
        margin-bottom: 35px;

        font-size: 27px;
    }


    .sidebar-link {
        font-size: 15px;

        padding: 11px 10px;
    }


    .flyout-menu {
        width: 210px;
    }


    .main-content {
        padding:
            25px
            30px
            70px;
    }


    .auth-buttons {
        margin-bottom: 35px;
    }


    .main-title {
        font-size: 38px;
    }


    .ai-prompt-box {
        width: min(100%, 700px);
    }


    .style-card {
        width: 165px;
        flex-basis: 165px;
    }


    .style-card img {
        height: 210px;
    }

}


/* =========================================================
   HAMBURGER
   DESKTOP DEFAULT
========================================================= */

.mobile-header {
    display: block;
}

.hamburger-btn {
    display: none;
}

.mobile-overlay {
    display: none;
}


/* =========================================================
   MOBILE - 600px AND BELOW
========================================================= */

@media (max-width: 600px) {

    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }


    /* =========================================
       PAGE
    ========================================= */

    .app-layout {
        display: block;

        width: 100%;
        height: auto;

        overflow: visible;
    }


    /* =========================================
       MOBILE HEADER
    ========================================= */

    .sidebar {
        width: 100%;
        height: 72px;

        position: relative;

        padding: 0;

        background: #faf9f0;

        border-right: none;
        border-bottom: 1px solid #e8e8e8;

        overflow: visible;

        z-index: 2000;
    }


    .mobile-header {
        width: 100%;
        height: 72px;

        display: flex;
        align-items: center;

        gap: 13px;

        padding: 0 17px;

        background: #faf9f0;
    }


    /* HAMBURGER ON LEFT */

    .hamburger-btn {
        width: 42px;
        height: 42px;

        display: flex;
        justify-content: center;
        align-items: center;

        flex-shrink: 0;

        padding: 0;

        border: none;
        background: transparent;

        color: #111;

        font-size: 28px;

        cursor: pointer;
    }


    .logo {
        margin: 0;
        padding: 0;

        font-size: 24px;
        font-weight: 700;

        white-space: nowrap;
    }


    /* =========================================
       MENU ITEMS - CLOSED
    ========================================= */

    .sidebar-item {
        display: none;
    }


    /* =========================================
       OPEN SIDEBAR
    ========================================= */

    .sidebar.mobile-open {
        width: 72%;
        max-width: 300px;
        height: 100vh;

        position: fixed;

        top: 0;
        left: 0;

        padding: 0;

        background: #faf9f0;

        overflow-y: auto;

        border-right: 1px solid #ddd;

        box-shadow:
            6px 0 25px rgba(0, 0, 0, 0.15);

        z-index: 2100;
    }


    .sidebar.mobile-open .sidebar-item {
        display: block;

        width: 100%;

        margin: 4px 0;

        padding: 0 12px;
    }


    /* =========================================
       MENU LINKS
    ========================================= */

    .sidebar.mobile-open .sidebar-link {
        width: 100%;

        min-height: 52px;

        display: flex;
        align-items: center;

        gap: 12px;

        padding: 12px 14px;

        border-radius: 9px;

        color: #111;

        font-size: 16px;
    }


    .menu-arrow {
        margin-left: auto;
    }


    /* =========================================
       OVERLAY
    ========================================= */

    .mobile-overlay {
        display: block;

        position: fixed;

        top: 0;
        right: 0;
        bottom: 0;
        left: 0;

        background: rgba(0, 0, 0, 0.35);

        opacity: 0;
        visibility: hidden;

        pointer-events: none;

        z-index: 2050;

        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
    }


    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;

        pointer-events: auto;
    }


 /* =========================================
   MOBILE IMAGES SUBMENU
========================================= */

.has-submenu {
    position: relative;
}

/* closed */
.has-submenu .flyout-menu {
    display: none !important;

    position: static;

    width: 100%;

    margin: 4px 0 8px;
    padding: 6px;

    background: #ffffff;

    border: 1px solid #eeeeee;
    border-radius: 10px;

    box-shadow: none;
}

/* opened after clicking Images */
.has-submenu.submenu-open .flyout-menu {
    display: block !important;
}

.has-submenu.submenu-open .flyout-menu a {
    display: flex;

    align-items: center;

    gap: 12px;

    width: 100%;

    padding: 12px 14px;

    color: #222222;

    font-size: 14px;

    border-radius: 8px;
}

/* Disable desktop hover bridge on mobile */
.has-submenu::after {
    display: none;
}
/* arrow */

.has-submenu.submenu-open .menu-arrow {
    transform: rotate(90deg);
}


/* remove desktop hover bridge */

.has-submenu::after {
    display: none;
}
    /* =========================================
       MAIN CONTENT
    ========================================= */

    .main-content {
        width: 100%;
        height: auto;

        padding: 16px 14px 55px;

        overflow: visible;
    }


    /* =========================================
       LOGIN / REGISTER
    ========================================= */

    .auth-buttons {
        margin: 0 0 30px;

        gap: 8px;
    }


    .login-btn,
    .register-btn {
        min-width: 70px;

        padding: 8px 12px;

        border-radius: 8px;

        font-size: 13px;
    }


    /* =========================================
       MAIN TITLE
    ========================================= */

    .main-title {
        margin: 15px auto 28px;

        padding: 0 5px;

        font-size: clamp(29px, 9vw, 38px);

        line-height: 1.15;

        letter-spacing: -0.5px;
    }


    /* =========================================
       AI PROMPT
    ========================================= */

    .ai-prompt-box {
        width: 100%;

        min-height: 170px;

        margin: 0 auto 70px;

        padding: 14px;

        grid-template-columns: 1fr auto;

        grid-template-areas:
            "textarea textarea"
            "upload generate";

        gap: 12px;

        border-radius: 16px;
    }


    .ai-prompt-box textarea {
        min-height: 90px;

        padding: 5px;

        font-size: 15px;
    }


    .prompt-upload-btn {
        justify-self: start;

        padding: 9px 12px;

        font-size: 14px;
    }


    .generate-btn {
        justify-self: end;

        padding: 9px 13px;

        font-size: 14px;
    }


    /* =========================================
       STYLE SECTIONS
    ========================================= */

    .styles-section {
        margin-bottom: 50px;
    }


    .styles-section h2,
    .cartoon-style1 {
        margin-bottom: 18px;

        font-size: 21px;
    }


    /* =========================================
       HORIZONTAL IMAGE SCROLL
    ========================================= */

    .style-scroll-container {
        width: 100%;

        overflow-x: auto;
        overflow-y: hidden;

        padding-bottom: 12px;

        -webkit-overflow-scrolling: touch;

        scroll-snap-type: x proximity;
    }


    .style-cards {
        width: max-content;

        display: flex;

        gap: 12px;
    }


    /* =========================================
       IMAGE CARDS
    ========================================= */

    .style-card {
        width: 145px;

        flex: 0 0 145px;

        border-radius: 12px;

        scroll-snap-align: start;
    }


    .style-card img {
        width: 100%;
        height: 185px;

        object-fit: cover;
    }


    .style-name {
        padding:
            25px
            10px
            10px;

        font-size: 13px;
    }


    .style-card:hover {
        transform: none;

        box-shadow: none;
    }


    .style-card:hover img {
        transform: none;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .mobile-header {
        padding: 0 11px;

        gap: 8px;
    }


    .hamburger-btn {
        width: 38px;
    }


    .logo {
        font-size: 21px;
    }


    .main-content {
        padding:
            14px
            11px
            45px;
    }


    .main-title {
        font-size: 29px;
    }


    .style-card {
        width: 135px;

        flex-basis: 135px;
    }


    .style-card img {
        height: 175px;
    }

}





/* =========================
   USER ACCOUNT
========================= */

.user-account {
    display: none;
    align-items: center;
    gap: 15px;
    position: absolute;
    top: 25px;
    right:40px;
    z-index: 1000;
}

.user-profile-picture {
    width: 42px;
    height: 42px;

    border-radius: 50%;
    object-fit: cover;

    cursor: pointer;
    border: 2px solid #e5e5e5;
}

.notification-btn {
    width: 42px;
    height: 42px;

    border: none;
    background: transparent;

    font-size: 24px;
    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;
}





/* ==============================
   PROFILE AREA
============================== */

.user-account {
    display: none;
    align-items: center;
    gap: 12px;
}

.profile-wrapper {
    position: relative;
}

.user-profile-picture {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #e5e5e5;
}

.user-profile-picture:hover {
    border-color: #2563eb;
}


/* Notification */

.notification-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    font-size: 21px;
    cursor: pointer;
}


/* ==============================
   DROPDOWN
============================== */

.profile-dropdown {
    position: absolute;

    top: 52px;
    right: 0;

    width: 280px;

    background: white;

    border: 1px solid #e5e5e5;
    border-radius: 14px;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);

    padding: 14px;

    display: none;

    z-index: 9999;
}


/* Show dropdown */

.profile-dropdown.show {
    display: block;
}


/* User information */

.dropdown-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-profile-picture {
    width: 48px;
    height: 48px;

    border-radius: 50%;
    object-fit: cover;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.dropdown-user-info strong {
    font-size: 15px;
    color: #111;
}

.dropdown-user-info span {
    font-size: 12px;
    color: #777;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Divider */

.dropdown-line {
    height: 1px;
    background: #eeeeee;

    margin: 12px 0;
}


/* Credits */

.credits-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 5px 4px;

    font-size: 14px;
}


/* Account + logout */

.dropdown-item {
    width: 100%;

    display: block;

    padding: 10px;

    border: none;
    border-radius: 8px;

    background: transparent;

    text-align: left;
    text-decoration: none;

    color: #222;
    font-size: 14px;

    cursor: pointer;

    box-sizing: border-box;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.logout-item {
    margin-top: 3px;
}




/* =========================================
   SMOOTH PAGE TRANSITION
========================================= */

body {
    opacity: 1;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}


body.page-leaving {
    opacity: 0;

    transform: translateY(-4px);
}


/* HOME UPLOADED IMAGE PREVIEW */

.home-upload-preview {
    width: 44px;
    height: 44px;

    display: block;

    object-fit: cover;

    border-radius: 8px;
}



/* 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;
    }
}

/* FIX: Mobile logged-in profile overlapping heading */
@media (max-width: 600px) {
    .main-content > .user-account {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        min-height: 42px;
        margin: 0 0 30px;
        justify-content: flex-end;
    }
}
