body {
    background: #000;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    z-index: 0;
}

body::before {
    content: "";
    position: fixed;
    left: -30vw;
    top: -30vh;
    width: 180vw;
    height: 180vh;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 20%, #23c8ff44 0%, transparent 70%),
        radial-gradient(circle at 90% 80%, #ff49c333 0%, transparent 70%),
        radial-gradient(circle at 40% 70%, #764ba244 0%, transparent 85%);
    z-index: 0;
    filter: blur(55px) saturate(120%);
    opacity: 1;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    margin: 40px auto 24px auto;
    border-radius: 24px;
    background: rgba(18,24,36,0.95);
    box-shadow: 0 10px 60px 5px #23c8ff33, 0 2px 10px #ff49c344 inset;
    padding: 50px 38px;
    overflow: visible;
}

h1, .gallery-title {
    font-weight: 900;
    letter-spacing: 2px;
    color: #23c8ff;
    text-shadow: 0 0 20px #23c8ff44, 0 2px 10px #ff49c344;
    font-size: 2.8em;
    margin-bottom: 0;
    background: linear-gradient(90deg, #23c8ff 20%, #ff49c3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-area {
    background: rgba(25,27,40,0.89);
    border: 3px dashed #ff49c3;
    border-radius: 16px;
    padding: 55px 20px 42px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 24px;
    position: relative;
    overflow: visible;
    transition: background .32s, border .33s, box-shadow .48s;
    box-shadow: 0 4px 15px #23c8ff22, 0 8px 30px #ff49c344 inset;
}

.upload-area.active,
.upload-area:hover {
    background: linear-gradient(125deg, #23c8ff77 0%, #ff49c388 100%);
    border-color: #23c8ff;
    box-shadow: 0 8px 32px #23c8ff44, 0 14px 40px #ff49c355 inset;
    transform: translateY(-4px) scale(1.022);
}

.upload-area::before {
    content: '🗎';
    font-size: 4.3em;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 18px #23c8ff66);
    user-select: none;
}

.upload-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.22em;
    letter-spacing: 1.2px;
}

.upload-subtext {
    color: #bbb;
    font-size: 1em;
}

#fileInput {
    display: none;
}

.preview-section {
    margin-top: 32px;
    display: none;
}

.preview-section.active {
    display: block;
    animation: slideIn .52s cubic-bezier(.37,.2,.66,1.26);
}

@keyframes slideIn {
    from {opacity: 0; transform: translateY(23px);}
    to {opacity: 1; transform: translateY(0);}
}

.image-preview {
    max-width: 100%;
    min-height: 110px;
    border-radius: 13px;
    box-shadow: 0 4px 22px #23c8ff55, 0 2px 7px #ff49c399;
    margin-bottom: 22px;
    border: 2.4px solid #232349;
    background: #19172b;
    animation: floatingImg 2.5s cubic-bezier(.46,.07,.44,1.52) infinite alternate-reverse;
}

@keyframes floatingImg {
    from { transform: translateY(-2px) scale(1);}
    40% { transform: translateY(12px) scale(1.018);}
    75% { transform: translateY(-7px) scale(0.997);}
    to { transform: translateY(6px) scale(1.02);}
}

.action-btn {
    background: linear-gradient(93deg, #23c8ff 0%, #ff49c3 100%);
    color: white;
    border: none;
    padding: 18px 37px;
    font-size: 1.18em;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 800;
    width: 100%;
    margin-bottom: 17px;
    opacity: 0.97;
    box-shadow: 0 5px 21px #764ba277, 0 2px 7px #23c8ff55;
    transition: box-shadow .19s, background .17s, transform .18s, letter-spacing .18s;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 8px #23c8ff33;
    will-change: transform, background, box-shadow;
}

.action-btn:active {
    transform: scale(0.97);
}

.action-btn:hover,
.action-btn:focus {
    box-shadow: 0 10px 44px #ff49c388, 0 3px 19px #23c8ff55;
    background: linear-gradient(90deg, #ff49c3 0%, #23c8ff 100%);
    letter-spacing: 2.6px;
    opacity: 1;
    text-shadow: 0 5px 33px #ff49c377, 0 2px 8px #23c8ff66;
}

.copy-btn {
    background: linear-gradient(92deg, #66ffa8 0%, #38ef7d 100%);
    margin-top: 11px;
    color: #181835;
    font-weight: 900;
    font-size: 1.1em;
    box-shadow: 0 4px 20px #38ef7d33, 0 1px 5px #23c8ff44;
    text-shadow: none;
}

.copy-btn:hover {
    background: linear-gradient(92deg, #38ef7d 0%, #5efc82 100%);
    color: #181835;
}

.result-section {
    margin-top: 24px;
    display: none;
}

.result-section.active {
    display: block;
    animation: fadeIn .48s cubic-bezier(.49,.01,.61,1.26);
}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(.97);}
    to {opacity: 1; transform: scale(1);}
}

.result-box {
    background: #151b26;
    border: 2.3px solid #23c8ff;
    border-radius: 12px;
    padding: 22px;
    min-height: 150px;
    max-height: 340px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    line-height: 1.61;
    font-size: 1.09em;
    color: #eee;
    box-shadow: 0 2px 6px #23c8ff22, 0 2px 7px #ff49c333 inset;
    scrollbar-color: #23c8ff #1a1a22;
    scrollbar-width: thin;
}

.result-box::-webkit-scrollbar {
    background: #111;
    width: 8px;
}

.result-box::-webkit-scrollbar-thumb {
    background: #23c8ffbb;
    border-radius: 4px;
}

.spinner {
    border: 4px solid #19122a;
    border-top: 4px solid #23c8ff;
    border-radius: 50%;
    width: 43px;
    height: 43px;
    animation: spin 1.1s linear infinite;
    margin: 20px auto;
    display: none;
    box-shadow: 0 2px 10px #23c8ff55;
}

.spinner.active {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    text-align: center;
    color: #23c8ff;
    font-weight: 900;
    margin-top: 13px;
    background: #1c2036;
    padding: 10px 0;
    border-radius: 14px;
    box-shadow: 0 2px 10px #23c8ff44;
    display: none;
    font-size: 1.14em;
    letter-spacing: 1.2px;
}

.status-text.active {
    display: block;
}

.status-text.error {
    color: #ff49c3 !important;
    background: #201026;
    box-shadow: 0 3px 17px #ff49c366;
}

.gallery-section {
    background: rgba(17,24,34,0.93);
    border-radius: 15px;
    box-shadow: 0 2px 12px #23c8ff22;
    padding: 24px;
    margin-top: 28px;
    margin-bottom: 10px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 9px;
}

.gallery-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 13px;
    box-shadow: 0 3px 18px #23c8ff44, 0 2px 8px #ff49c344;
    cursor: grab;
    border: 2.3px solid #16162a;
    background: #222;
    transition: border .19s, box-shadow .29s, transform .29s, filter .25s;
    filter: drop-shadow(0 0 18px #23c8ff11);
    will-change: transform, box-shadow, filter;
    animation: floatingImg cubic-bezier(.46,.07,.44,1.52) infinite alternate;
    animation-duration: 2.4s;
}

.gallery-img:hover,
.gallery-img:active,
.gallery-img.dragging {
    border: 2.3px solid #ff49c3;
    box-shadow: 0 8px 35px #ff49c388, 0 4px 22px #23c8ff77;
    filter: brightness(112%) saturate(120%) blur(0.4px);
    transform: scale(1.035) rotate(-1.4deg);
    z-index: 1;
}

.view-more-btn {
    margin-top: 20px;
    background: linear-gradient(95deg, #23c8ff 10%, #ff49c3 90%);
    color: #fff;
    border: none;
    border-radius: 22px;
    padding: 12px 48px;
    font-weight: 800;
    font-size: 1.11em;
    box-shadow: 0 3px 17px #23c8ff33, 0 2px 8px #ff49c344;
    cursor: pointer;
    letter-spacing: 1.4px;
    transition: background .19s, transform .35s, box-shadow .32s;
    position: relative;
    z-index: 1;
}

.view-more-btn:hover {
    background: linear-gradient(95deg, #ff49c3 10%, #23c8ff 90%);
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 7px 27px #ff49c388, 0 2px 13px #23c8ff44;
}

@media (max-width: 600px) {
    .container {
        padding: 9px;
        max-width: 99vw;
    }

    h1, .gallery-title {
        font-size: 1.4em;
    }

    .gallery-section {
        padding: 7px;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-img {
        height: 63px;
    }

    .upload-area {
        padding: 18px 3px;
    }
}

body {
    background: #000;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    z-index: 0;
}
body::before {
    content: "";
    position: fixed;
    left: -30vw;
    top: -30vh;
    width: 180vw;
    height: 180vh;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 20%, #23c8ff44 0%, transparent 70%),
        radial-gradient(circle at 90% 80%, #ff49c333 0%, transparent 70%),
        radial-gradient(circle at 40% 70%, #764ba244 0%, transparent 85%);
    z-index: 0;
    filter: blur(55px) saturate(120%);
    opacity: 1;
}
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    margin: 40px auto 24px auto;
    border-radius: 24px;
    background: rgba(18,24,36,0.95);
    box-shadow: 0 10px 60px 5px #23c8ff33, 0 2px 10px #ff49c344 inset;
    padding: 50px 38px;
    overflow: visible;
}
h1, .gallery-title {
    font-weight: 900;
    letter-spacing: 2px;
    color: #23c8ff;
    text-shadow: 0 0 20px #23c8ff44, 0 2px 10px #ff49c344;
    font-size: 2.8em;
    margin-bottom: 0;
    background: linear-gradient(90deg, #23c8ff 20%, #ff49c3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.apikey-toggle-block {
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background: #23c8ff55;
    border-radius: 20px;
    transition: .3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px; width: 22px;
    left: 4px; bottom: 3px;
    background: #fff;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 12px #23c8ff66;
}
input:checked + .slider {
    background: #ff49c366;
}
input:checked + .slider:before {
    transform: translateX(22px);
    background: #23c8ff;
}
.apikey-toggle-label {
    color: #23c8ff;
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 1px;
}
.user-apikey-block {
    display: none;
    margin-bottom: 22px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.user-apikey-block input {
    padding: 10px 16px;
    border: 2px solid #23c8ff;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    background: #0f1320;
    color: #fff;
    width: 260px;
    transition: border .2s;
}
.user-apikey-block input:focus {
    outline: none;
    border: 2.1px solid #ff49c3;
}
.user-apikey-block .action-btn.small {
    padding: 10px 20px;
    font-size: 0.97em;
    border-radius: 15px;
    font-weight: 700;
    box-shadow: none;
    margin-top: 0;
    margin-bottom: 0;
}
.user-apikey-block.active {
    display: flex;
}


@media (max-width: 600px) {
    .container {
        padding: 9px;
        max-width: 99vw;
    }
    h1, .gallery-title {
        font-size: 1.4em;
    }
    .gallery-section {
        padding: 7px;
    }
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .gallery-img {
        height: 63px;
    }
    .upload-area {
        padding: 18px 3px;
    }
}

/* --- Glassmorphism Block --- */
.container, .gallery-section, .preview-section, .result-section, .upload-area {
    backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(18, 24, 36, 0.70) !important;
    border: 1.3px solid rgba(35, 200, 255, 0.17);
    box-shadow: 0 8px 32px 0 rgba(35,200,255,0.25);
}

/* --- Awesome Gradient Header --- */
h1, .gallery-title {
    background: linear-gradient(120deg, #23c8ff 30%, #ff49c3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 22px #23c8ff66, 0 6px 40px #ff49c366;
    animation: gradientFlow 2.5s infinite linear alternate-reverse;
}
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* --- Gallery Image Hover Animations --- */
.gallery-img {
    transition: transform .45s cubic-bezier(.36,.04,.58,.92), box-shadow .34s;
    box-shadow: 0 2px 32px #23c8ff33, 0 6px 24px #ff49c355;
}
.gallery-img:hover {
    transform: scale(1.10) rotate(-2deg) translateY(-10px);
    filter: drop-shadow(0 0 18px #ff49c3aa);
    box-shadow: 0 8px 32px #ff49c388;
    border-color: #ff49c3;
}

/* --- Button Ripple/Neumorphic Effect --- */
.action-btn, .copy-btn, .view-more-btn {
    position: relative;
    transition: box-shadow .22s, transform .22s, background .28s;
    box-shadow: 0 2px 6px #23c8ff66, 0 1px 11px #ff49c366;
    overflow: hidden;
}
.action-btn:active, .copy-btn:active, .view-more-btn:active {
    transform: scale(0.97);
    box-shadow: 0 0 11px #23c8ff77;
}
.action-btn::after, .copy-btn::after, .view-more-btn::after {
    content: "";
    display: block;
    position: absolute;
    left: 50%; top: 50%;
    width: 0; height: 0;
    background: rgba(35,200,255,0.22);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .3s ease, height .3s ease, opacity .33s;
    opacity: 0.5;
}
.action-btn:active::after, .copy-btn:active::after, .view-more-btn:active::after {
    width: 110px; height: 110px; opacity: 0.17;
    transition: width .18s, height .18s, opacity .22s;
}

/* --- Result Section Reveal --- */
.result-section, .preview-section {
    box-shadow: 0 6px 32px #23c8ff22, 0 1px 22px #ff49c333;
    transition: opacity .44s, transform .44s;
    opacity: 0;
    transform: translateY(18px) scale(.96);
}
.result-section.active, .preview-section.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Shimmer Effect for Loader --- */
.spinner {
    box-shadow: 0 2px 12px #ff49c399, 0 0 11px #23c8ff77;
    animation: spin 1.1s linear infinite, shimmer 2.2s ease-in-out infinite alternate;
}
@keyframes shimmer {
    from    { filter: brightness(1.0) drop-shadow(0 0 5px #23c8ff77); }
    to      { filter: brightness(1.45) drop-shadow(0 0 12px #ff49c399); }
}

/* --- API Key Block Slide/Reveal --- */
.user-apikey-block {
    transition: opacity .38s, transform .38s;
    opacity: 0; transform: translateY(-10px);
}
.user-apikey-block.active {
    opacity: 1; transform: translateY(0);
}

/* --- Subtle Floating on Upload Panel --- */
.upload-area {
    animation: uploadFloat 2.2s cubic-bezier(.46,.04,.54,1.36) infinite alternate-reverse;
}
@keyframes uploadFloat {
    from { transform: translateY(-2px) scale(1.01);}
    to   { transform: translateY(8px) scale(0.99);}
}
/* --- Glassmorphism Block --- */
.container, .gallery-section, .preview-section, .result-section, .upload-area {
    backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(18, 24, 36, 0.70) !important;
    border: 1.3px solid rgba(35, 200, 255, 0.17);
    box-shadow: 0 8px 32px 0 rgba(35,200,255,0.25);
}

/* --- Awesome Gradient Header --- */
h1, .gallery-title {
    background: linear-gradient(120deg, #23c8ff 30%, #ff49c3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 22px #23c8ff66, 0 6px 40px #ff49c366;
    animation: gradientFlow 2.5s infinite linear alternate-reverse;
}
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* --- Gallery Image Hover Animations --- */
.gallery-img {
    transition: transform .45s cubic-bezier(.36,.04,.58,.92), box-shadow .34s;
    box-shadow: 0 2px 32px #23c8ff33, 0 6px 24px #ff49c355;
}
.gallery-img:hover {
    transform: scale(1.10) rotate(-2deg) translateY(-10px);
    filter: drop-shadow(0 0 18px #ff49c3aa);
    box-shadow: 0 8px 32px #ff49c388;
    border-color: #ff49c3;
}

/* --- Button Ripple/Neumorphic Effect --- */
.action-btn, .copy-btn, .view-more-btn {
    position: relative;
    transition: box-shadow .22s, transform .22s, background .28s;
    box-shadow: 0 2px 6px #23c8ff66, 0 1px 11px #ff49c366;
    overflow: hidden;
}
.action-btn:active, .copy-btn:active, .view-more-btn:active {
    transform: scale(0.97);
    box-shadow: 0 0 11px #23c8ff77;
}
.action-btn::after, .copy-btn::after, .view-more-btn::after {
    content: "";
    display: block;
    position: absolute;
    left: 50%; top: 50%;
    width: 0; height: 0;
    background: rgba(35,200,255,0.22);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .3s ease, height .3s ease, opacity .33s;
    opacity: 0.5;
}
.action-btn:active::after, .copy-btn:active::after, .view-more-btn:active::after {
    width: 110px; height: 110px; opacity: 0.17;
    transition: width .18s, height .18s, opacity .22s;
}

/* --- Result Section Reveal --- */
.result-section, .preview-section {
    box-shadow: 0 6px 32px #23c8ff22, 0 1px 22px #ff49c333;
    transition: opacity .44s, transform .44s;
    opacity: 0;
    transform: translateY(18px) scale(.96);
}
.result-section.active, .preview-section.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Shimmer Effect for Loader --- */
.spinner {
    box-shadow: 0 2px 12px #ff49c399, 0 0 11px #23c8ff77;
    animation: spin 1.1s linear infinite, shimmer 2.2s ease-in-out infinite alternate;
}
@keyframes shimmer {
    from    { filter: brightness(1.0) drop-shadow(0 0 5px #23c8ff77); }
    to      { filter: brightness(1.45) drop-shadow(0 0 12px #ff49c399); }
}

/* --- API Key Block Slide/Reveal --- */
.user-apikey-block {
    transition: opacity .38s, transform .38s;
    opacity: 0; transform: translateY(-10px);
}
.user-apikey-block.active {
    opacity: 1; transform: translateY(0);
}

/* --- Subtle Floating on Upload Panel --- */
.upload-area {
    animation: uploadFloat 2.2s cubic-bezier(.46,.04,.54,1.36) infinite alternate-reverse;
}
@keyframes uploadFloat {
    from { transform: translateY(-2px) scale(1.01);}
    to   { transform: translateY(8px) scale(0.99);}
}



