﻿@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap');

.headerText {
    margin-top: 4rem;
    font-size: 2.4rem;
}

@media (max-width: 2500px) {
    .headerText {
        font-size: 2.4rem;
    }
}

@media (max-width: 1920px) {
    .headerText {
        font-size: 2rem;
    }
}

@media (max-width: 1440px) {
    .headerText {
        font-size: 2rem;
    }
}

@media (max-width: 1024px) {
    .headerText {
        font-size: 1.8rem;
    }
}

.pixelartFont {
    font-family: "Silkscreen", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.generated-image {
    display: flex;
    justify-content: center;
}

.pixelatedResult {
    border-radius: 0px;
    width: 100%;
    transition: transform 0.2s ease-in-out;
}

#generatedImage {
    image-rendering: pixelated; /* Prevents blurry outcomes (when 'reduce size' is enabled) */
    border-radius: 0;
}

#previewImage {
    image-rendering: pixelated;
}

#artStyleDropdown {
    padding: 15px 20px;
    text-align: left;
    background-color: #303030;
}

.model-dropdown-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.model-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: #303030;
    color: white;
    padding: 12px 16px;
    border: 1px solid #454545;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
}

.model-dropdown-btn:hover {
    background-color: #373737;
    border-color: rgba(0, 123, 255, 0.5);
}

.model-card-dropdown {
    display: none;
    position: absolute;
    left: 102%;
    top: 0; 
    background: #232323;
    border: 1px solid #454545;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    z-index: 20;
    min-width: 400px;
    padding: 18px 18px 12px 18px;
    animation: fadeInRight 0.18s;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.model-card-dropdown.show {
    display: block;
}

.model-card-dropdown.dropdown-below {
    left: 0 !important;
    top: 100% !important;
    animation: fadeInDown 0.18s !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.model-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #323232;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0;
    min-width: 250px;
    max-width: 300px;
    min-height: 56px;
    cursor: pointer;
    transition: border 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.model-card:hover, .model-card.selected {
    border: 1px solid #CD78FF;
    box-shadow: 0 4px 16px rgba(0,123,255,0.08);
}

.model-card-img {
    aspect-ratio: 1 / 1;
    width: 56px;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    border: none;
    border-radius: 0;
    background: none;
    flex-shrink: 0;
    flex-grow: 0;
}

.model-card-label {
    color: #fff;
    text-align: left;
    font-weight: 500;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    padding: 0 16px;
    white-space: normal;
    width: 100%;
}

#prompt {
    background-color: #222222;
    border: 1px solid #454545;
    border-radius: 10px;
    color: white;
    height: 100px;
    margin-bottom: 3rem !important;
}

#prompt:hover {
    border-color: rgba(0, 123, 255, 0.5);
}

#prompt:focus {
    border: 1px solid #CD78FF;
} 

#prompt::placeholder {
    color: #454545;
}

#imageCount .btn {
    padding: 5px 10px;
    color: white;
    border: 1px solid #454545;
    border-radius: 5px;
}

#imageCount .btn:last-child {
    margin-right: 0;
}

#imageCount .btn:hover,
#imageCount .btn:active,
#imageCount .btn:focus {
    background-color: #303030;
}

.pixel-art-type {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pixel-art-type .dropdown-toggle {
    background-color: #303030;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    width: 100%;
}

.pixel-art-type .dropdown-menu {
    background-color: #303030;
    border-radius: 5px;
    border: none;
    width: 100%;
}

.pixel-art-type .dropdown-item {
    text-align: center;
}

.pixel-art-type .dropdown-item:hover {
    background-color: #454545;
}

.edit-mode-block {
    display: none;
}

#editImage {
    width: 80%;
    image-rendering: pixelated;
}

.main-action-btn:disabled {
    color: #454545;
    background-color: transparent;
    border: 1px solid #454545;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.main-action-btn {
    background-color: #CD78FF;
    position: relative;
    overflow: hidden;
}

.main-action-btn:hover {
    background-color: transparent;
    border: 1px solid #CD78FF;
    color: #CD78FF;
}

.main-action-btn:active {
    background-color: #CD78FF !important;
}

/* Loading animation for the button */
.main-action-btn.loading {
    position: relative;
    overflow: hidden;
}

    .main-action-btn.loading::after {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.1), transparent );
        animation: buttonLoadingAnimation 2s infinite;
    }

@keyframes buttonLoadingAnimation {
    0% { left: -100%; }
    100% { left: 100%; }
}

#savedColorsContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    gap: 10px;
    max-height: calc(100% - 80px);
}

.position-relative {
    position: relative;
    display: inline-block;
}

#colorPicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

#eyeDropperButton {
    text-align: center;
    margin: 0;
}

.toolBtn {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.divider {
    width: 100%;
    border: 1px solid #454545;
    margin-bottom: 20px;
}

.palette-buttons .addBtn, 
.palette-buttons .removeBtn {
    font-weight: normal;
}

/* Pixel-themed loading animation */
.generator-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.generator-loading-container > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
}

.generator-pixel-loading {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.generator-pixel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
    height: 100%;
}

.generator-pixel {
    background-color: #CD78FF;
    border-radius: 2px;
    animation: generatorPixelFade 2.5s infinite;
    opacity: 0;
}

@keyframes generatorPixelFade {
    0%, 100% {
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }
}

.generator-pixel:nth-child(1) {
    animation-delay: 0.0s;
}

.generator-pixel:nth-child(2) {
    animation-delay: 0.3s;
}

.generator-pixel:nth-child(3) {
    animation-delay: 0.6s;
}

.generator-pixel:nth-child(4) {
    animation-delay: 0.2s;
}

.generator-pixel:nth-child(5) {
    animation-delay: 0.5s;
}

.generator-pixel:nth-child(6) {
    animation-delay: 0.8s;
}

.generator-pixel:nth-child(7) {
    animation-delay: 0.4s;
}

.generator-pixel:nth-child(8) {
    animation-delay: 0.7s;
}

.generator-pixel:nth-child(9) {
    animation-delay: 1.0s;
}

.generator-loading-text {
    text-align: center;
    color: white;
    font-family: "Silkscreen", sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.generator-loading-progress {
    width: 120px;
    height: 3px;
    background-color: #222222;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.generator-progress-bar {
    height: 100%;
    width: 0;
    background-color: #CD78FF;
    border-radius: 2px;
    animation: generatorProgressAnimation 3s ease-in-out infinite;
}

@keyframes generatorProgressAnimation {
    0% {
        width: 0;
    }

    50% {
        width: 100%;
    }

    100% {
        width: 0;
    }
}

/* Old loader style - hiding */
.loader {
    display: none !important;
}

.download-button {
    font-size: 15px;
    width: 200px;
    height: 45px;
}

.editModeIcon {
    padding-bottom: 2px;
    width: 20px;
    height: 20px;
}

.backArrowIcon {
    width: 20px;
    height: 20px;
}

.back-icon-container {
    margin-bottom: 10px;
    cursor: pointer;
}

.downloadIcon {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
}

.modal-lg {
    max-width: 1000px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 15px;
}

.modal-dark {
    background-color: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.modal-footer {
    border-top: none;
}

.modal-title {
    color: #454545;
}

.cancelBtn {
    background-color: #303030;
    padding-right: 30px;
    padding-left: 30px;
}

.cancelBtn:hover {
    background-color: #282828;
}

.saveChangesEditMode {
    margin-left: 10px;
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a1a;
    width: 480px;
    height: 480px;
    aspect-ratio: 1 / 1;
    overflow: auto;
    position: relative;
    border: 1px solid #454545;
    margin: 0 auto;
    margin-top: 20px;
    padding: 0;
}

#editCanvas {
/*    background-image: url('/images/TransparentCanvas_64x64.png');*/
    background-size: 100% 100%;
    image-rendering: pixelated;
    display: block;
    box-sizing: content-box;
    margin: 0;
    padding: 0;
}

.canvas-colors-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.toolbox-colors-container {
    margin-left: -15px;
    margin-top: 20px;
    position: relative;
    left: -20%;
}

.toolbox-colors-container, #savedColorsContainer {
    align-items: flex-start;
}

.toolbox {
    display: flex;
    gap: 0.1rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.color-picker-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
}

.color-picker-btn i {
    font-size: 18px;
    color: #fff;
    text-shadow: 0 0 3px black;
}

.tool-selected {
    border: 1px solid #CD78FF !important;
    box-shadow: 0 0 5px rgba(255, 105, 180, 0.3);
}

.btn-secondary {
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

#savedColorsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#savedColorsContainer div {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #454545;
}

.canvas-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.canvas-wrapper::-webkit-scrollbar-track {
  background: #2a2a2a;   /* dark grey track */
  border-radius: 5px;
}

.canvas-wrapper::-webkit-scrollbar-thumb {
  background: #555555;   /* medium grey thumb */
  border-radius: 5px;
}

.canvas-wrapper::-webkit-scrollbar-thumb:hover {
  background: #777777;   /* lighter grey on hover */
}

.canvas-wrapper {
  scrollbar-width: auto;
  scrollbar-color: #555555 #2a2a2a;  /* thumb color, then track color */
}

.image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.controls-container .edit-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container {
    display: flex;
    flex-direction: column;
    width: 80%;
    margin: auto;
    border: 2px solid #303030;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: transparent;
    border-bottom: 2px solid #303030;
    color: #ffffff;
    font-size: 14px;
}

.image-title {
    font-size: 16px;
    color: #454545;
}

.edit-button {
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
    background-color: white;
    color: #303030;
    cursor: pointer;
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.edit-button:hover {
    background-color: #C2C2C2;
    color: #303030
}

.edit-button-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.raw-output-toggle {
    display: flex;
    align-items: center;
}

.raw-output-toggle .form-check-input {
    margin-right: 8px;
}

.raw-output-toggle .form-check-label {
    font-size: 14px;
    color: #fff;
}

#rawResultContainer {
    text-align: center;
}

#rawResultContainer img {
    max-width: 100%;
    height: auto;
    border: 1px solid #454545;
    border-radius: 10px;
}

.edit-instructions {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.8rem;
    color: #888;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease-in-out;
    text-align: left;
}
.instructions-content {
    display: none;
    font-size: 0.75rem;
    color: #555;
    margin-top: 5px;
}

.toggle-instructions {
    font-weight: bold;
    cursor: pointer;
}

/* Advanced Settings Styles */
.advanced-settings-container {
    position: relative;
    border-radius: 10px;
}

.advanced-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: #222222;
    color: white;
    border: 1px solid #454545;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: left;
}

.advanced-settings-toggle:hover {
    background-color: #272727;
    border-color: rgba(0, 123, 255, 0.5);
}

.advanced-settings-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.chevron-icon {
    transition: transform 0.3s ease;
}

.model-dropdown-btn.active .chevron-icon,
.advanced-settings-toggle.active .chevron-icon {
    transform: rotate(180deg);
}

.advanced-settings-content {
    background-color: #272727;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    border-left: 1px solid #454545;
    border-right: 1px solid #454545;
    border-bottom: 1px solid #454545;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    transition: all 0.3s ease;
    border-bottom: none;
}

.advanced-settings-content.show {
    max-height: 1000px;
    padding: 20px;
    border-bottom: 1px solid #454545;
}

/* Advanced Settings Form Controls */
.advanced-settings-content textarea,
.advanced-settings-content input[type="number"] {
    background-color: #222222;
    border: 1px solid #454545;
    border-radius: 8px;
    color: white;
    padding: 12px;
    width: 100%;
    transition: all 0.3s ease;
}

.advanced-settings-content textarea {
    height: 80px;
    resize: none;
}

.advanced-settings-content textarea:focus,
.advanced-settings-content input[type="number"]:focus {
    border: 1px solid #CD78FF;
    box-shadow: 0 0 0 3px rgba(205, 120, 255, 0.2);
    background-color: transparent;
    color: white;
}

.advanced-settings-content .form-text {
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Form Labels - Making them same size as prompt label */
.advanced-settings-content .form-label,
.form-label {
    font-size: 1rem;
    font-weight: normal;
    color: white;
}

/* Custom Switch Styling */
.form-check-input {
    cursor: pointer;
}

.form-switch .form-check-input {
    width: 40px;
    height: 20px;
}

.form-switch .form-check-input:checked {
    background-color: #CD78FF;
    border-color: #CD78FF;
}

.advancedDropdownMenuSetting {
    color: white !important;
    background-color: #303030 !important;
    border: 1px solid #454545 !important;
    height: 3rem !important;
}

.advancedDropdownMenuSetting:hover, .advancedDropdownMenuSetting:active{
    background-color: #373737 !important;
}

.advancedDropdownMenuSetting option {
    background: #303030 !important;
    color: #fff !important;
}

/* Warning for mobile users */
.mobile-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 0, 0.9);
    color: black;
    z-index: 9999;
    text-align: center;
    padding: 20px;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border-radius: 8px;
}

.mobile-warning {
    display: inline-block;
    width: 100%;
    margin: 0 auto;
}

/* Styles for batch size buttons */
.batch-size-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.batch-button {
    flex: 1;
    padding: 10px 15px;
    background-color: #303030;
    color: white;
    border: 1px solid #454545;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.batch-button:hover {
    background-color: #373737;
    border-color: rgba(0, 123, 255, 0.5);
}

.batch-button.active {
    background-color: #373737;
    border-color: #CD78FF;
}

.batch-size-info {
    margin-bottom: 3rem;
}

.texture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.texture-item {
    position: relative;
    aspect-ratio: 1/1;
}

.texture-container {
    position: relative;
    cursor: pointer;
    width: 100%;
    height: 100%;
    border: 2px solid #303030;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.texture-container:hover {
    transform: scale(1.01);
    border-color: rgba(0, 123, 255, 0.5);
}

.texture-container.selected {
    border: 2px solid #CD78FF;
}

.texture-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    background-color: #1a1a1a;
}

.texture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.texture-container:hover .texture-overlay {
    opacity: 1;
}

/* Seamlessness Grid */
.seamless-preview-container {
    margin-top: 15px;
    padding: 15px 15px 0px 15px;
    border: 1px solid #454545;
    border-radius: 8px;
    width: 95%;
    margin: 0 auto;
    margin-bottom: 20px;
}

.seamless-preview-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.seamless-preview-title {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.seamless-toggle {
    float: right;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seamless-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.seamless-toggle label {
    font-size: 12px;
    color: #ccc;
    margin: 0;
    cursor: pointer;
}

.seamless-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0;
    width: 576px;
    height: 576px;
    margin: 30px auto;
    border: 1px solid #555;
    background-image: 
        linear-gradient(45deg, #333 25%, transparent 25%), 
        linear-gradient(-45deg, #333 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #333 75%), 
        linear-gradient(-45deg, transparent 75%, #333 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.seamless-preview-tile {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.seamless-preview-tile.center {
    /*border: 2px dashed #FB0FFF;*/
    border: 2px dashed white;
    box-sizing: border-box;
}