﻿@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap');

.pixelartFont {
    font-family: "Silkscreen", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.main-container {
    position: absolute;
    top: 18vh; /* Height of the header + some extra margin */
    left: 50%; /* Centered main content with some extra space on the left because sidebar width */
    transform: translate(-50%); /* Horizontal centering */
    max-width: 650px;
    box-sizing: border-box;
    overflow: visible;
    transition: padding-left 0.3s ease;
}

/* Make sure the padding is equal to the width of the sidebar */
/*body.sidebar-expanded .main-container {
    padding-left: 225px;
}

@media (max-width: 1920px) {
    body.sidebar-expanded .main-container {
        padding-left: 205px;
    }
}

@media (max-width: 1440px) {
    body.sidebar-expanded .main-container {
        padding-left: 205px;
    }
}

@media (max-width: 1024px) {
    body.sidebar-expanded .main-container {
        padding-left: 195px;
    }
}*/

.form-container {
    width: 100%;
    align-items: center;
    margin: 0 auto;
}

.block {
    background-color: transparent;
    border-radius: 20px;
    /*box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);*/
    width: 100%;
    max-width: 700px;
    text-align: center;
    margin-bottom: 10px;
}

#generatedImage {
    image-rendering: pixelated; /* Prevents blurry outcomes (when 'reduce size' is enabled) */
}

.headerText {
    padding: 0 0 20px 0;
    font-size: 36px;
    text-align: center;
}

.file-upload {
    position: relative;
    margin-bottom: 20px;
    text-align: center;
}

.file-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #222222;
    border: 2px dashed #568CF4;
    color: white;
    padding: 10px;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    height: 250px;
}

.file-label .uploadIcon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.file-label p {
    margin: 0;
    font-size: 20px;
}

.file-label small {
    font-size: 14px;
    color: #ccc;
}

.file-label small a {
    color: #568CF4;
    text-decoration: none;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 35px;
    margin-bottom: 40px;
}

.generate-button {
    flex: 2;
    height: 48px;
    background-color: #568CF4;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.generate-button:hover {
    background-color: #3a74d5;
}

/* ID is used in the JS */
#reloadIcon {
    width: 22px;
    height: 22px;
}

.pixel-size-dropdown {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pixel-size-dropdown .dropdown-toggle {
    height: 48px;
    background-color: #303030;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    width: 100%;
}

.pixel-size-dropdown .dropdown-menu {
    background-color: #303030;
    border-radius: 5px;
    border: none;
    width: 100%;
}

.pixel-size-dropdown .dropdown-item {
    text-align: center;
}

.pixel-size-dropdown .dropdown-menu .dropdown-item:hover {
    background-color: #454545;
}

.image-preview {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    margin-top: 30px;
}

.uploaded-image img, .generated-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-image, .generated-image {
    width: 400px;
    height: auto;
    border-radius: 20px;
    overflow: hidden; /* Ensure the image doesn't overflow the container */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

#colorPaletteDropdown {
    background-color: #303030;
    width: 250px;
    padding: 7px 40px;
    border-radius: 10px;
    margin-top: 10px;
    margin-bottom: 50px;
}

.dropdown-menu {
    border: none;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #454545;
}

.palette-item {
    background-color: #303030;
    text-align: center;
    width: 250px;
}

.palette-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.paletteOptions {
    border-radius: 20px;
    background-color: red;
    margin: 0;
}

.color-palette-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #454545;
    border-radius: 10px;
    width: 100%;
    margin: 10px 0 30px 0;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.color-container {
    margin: 0;
    padding: 0;
    flex: none;
}

.form-control-color {
    width: 25px;
    height: 25px;
    border: none;
    background-color: transparent;
    /*border: 1px solid white;
    background-color: white;*/
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    margin: 5px;
}

.palette-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
}

.palette-buttons .btn {
    background-color: transparent;
    padding: 5px 30px;
    border: 2px solid #454545;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.palette-buttons .addBtn {
    color: white;
}

.palette-buttons .removeBtn {
    color: #E24F4F;
}

.bi-trash-fill, .bi-plus-lg {
    font-size: 14px;
}

.switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.switch-label {
    margin-right: 10px;
}

/* Checkbox styling */
.switch-input {
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #222222 !important;
    border: 2px solid #454545 !important;
    position: relative !important;
    outline: none !important;
    cursor: pointer !important;
    margin-left: 2px !important;
}

.switch-input:hover {
    background-color: #454545 !important;
}

/* Change background when checked */
.switch-input:checked {
    background-color: #454545 !important; /* Background color when switched on */
}

.bi-info-circle-fill {
    margin-left: 5px;
    cursor: pointer;
    font-size: 18px;
    z-index: 1;
}

.download-container {
    margin: 0 auto;
    max-width: 700px;
}

.download-button {
    background-color: #303030;
    padding: 10px 15px;
    width: 100%;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.download-button:hover {
    background-color: #454545;
}

.bi-download {
    padding-right: 10px;
    font-size: 18px;
    vertical-align: middle;
}

#fullscreenContainer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#fullscreenImage {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: block;
}

#closeFullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
}

.trashIcon {
    width: 18px;
    height: 18px;
}

.plusIcon {
    width: 18px;
    height: 18px;
}

/* Export settings */
.card {
    border: 1px solid #454545;
    background-color: transparent;
    border-radius: 10px;
    width: 100%;
    color: white;
    font-family: "Silkscreen", sans-serif;
}

.card-header {
    border-radius: 10px 10px 0 0;
    background-color: transparent;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.card-header i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.card-header[aria-expanded="true"] {
    border-bottom: 1px solid #454545;
}

.card-header[aria-expanded="false"] {
    border-bottom: none;
}

.card-body {
    padding: 30px;
}

.switch-label {
    margin-left: 10px;
    font-size: 14px;
}

.bi-chevron-down {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.card-header[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Loading Animation Styles */
.converter-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);
}

.converter-loading-container > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
}

.converter-pixel-loading {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.converter-pixel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
    height: 100%;
}

.converter-pixel {
    background-color: #568CF4;
    border-radius: 2px;
    animation: converterPixelFade 2.5s infinite;
    opacity: 0;
}

@keyframes converterPixelFade {
    0%, 100% {
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }
}

.converter-pixel:nth-child(1) {
    animation-delay: 0.0s;
}

.converter-pixel:nth-child(2) {
    animation-delay: 0.3s;
}

.converter-pixel:nth-child(3) {
    animation-delay: 0.6s;
}

.converter-pixel:nth-child(4) {
    animation-delay: 0.2s;
}

.converter-pixel:nth-child(5) {
    animation-delay: 0.5s;
}

.converter-pixel:nth-child(6) {
    animation-delay: 0.8s;
}

.converter-pixel:nth-child(7) {
    animation-delay: 0.4s;
}

.converter-pixel:nth-child(8) {
    animation-delay: 0.7s;
}

.converter-pixel:nth-child(9) {
    animation-delay: 1.0s;
}

.converter-loading-text {
    text-align: center;
    color: white;
    font-family: "Silkscreen", sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.converter-loading-progress {
    width: 120px;
    height: 3px;
    background-color: #222222;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.converter-progress-bar {
    height: 100%;
    width: 0;
    background-color: #568CF4;
    border-radius: 2px;
    animation: converterProgressAnimation 3s ease-in-out infinite;
}

@keyframes converterProgressAnimation {
    0% {
        width: 0;
    }

    50% {
        width: 100%;
    }

    100% {
        width: 0;
    }
}

/* Generate button loading animation */
.generate-button.loading {
    position: relative;
    overflow: hidden;
}

.generate-button.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%; }
}
