@font-face {
  font-family: 'Icons';
  src: url('font/icons.eot?4793778');
  src: url('font/icons.eot?4793778#iefix') format('embedded-opentype'),
       url('font/icons.woff2?4793778') format('woff2'),
       url('font/icons.woff?4793778') format('woff'),
       url('font/icons.ttf?4793778') format('truetype'),
       url('font/icons.svg?4793778#icons') format('svg');
  font-weight: normal;
  font-style: normal;
}

:host, html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-feature-settings: normal;
    font-variation-settings: normal;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(0deg,rgba(51, 0, 0, 1) 0%, rgba(153, 0, 0, 1) 50%, rgba(85, 0, 0, 1) 100%);
    font-family: 'Inter', sans-serif;
    touch-action: none; /* Prevents default touch behaviors like scrolling on the body */
    overscroll-behavior-y: contain; /* Prevents pull-to-refresh on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #333;
    margin: 0;
    padding: 0;
}

main {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#palette-container, #tools-container {
    scrollbar-color: rgba(255, 255, 255, .2) transparent;
    scrollbar-width: thin;
}

#palette-container {
    width: 288px;
    background: rgba(248, 31, 31, 0.20);
    padding: 20px 10px;
    margin: 30px;
    border-radius: 16px;
    height: calc(100% - 80px);
    overflow: auto;
    flex-shrink: 0;
}
#palette-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#palette-container::-webkit-scrollbar-track {
    background: transparent;
}
#palette-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 10px;
}
#palette-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .3);
}
#palette-items-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 .5rem;
    gap: .5rem;
}

#canvas-parent {
    flex: 1 1 0%;
    position: relative;
    padding: 30px 0;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}
#canvas-wrapper {
    aspect-ratio: 59 / 95;
    max-width: 100%;
    max-height: 100%;
}
#canvas {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-mask-image: url('/moj-dizajn/assets/images/mask.svg');
    mask-image: url('/moj-dizajn/assets/images/mask.svg');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

#odustani {
    font-size: 14px;
    color: #FF6804;
    padding: 8px 20px;
    border-radius: 25px;
    border: 1px solid #FF6804;
    margin-right: 10px;
    text-decoration: none;
}

#spremi {
    font-size: 14px;
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    background: #FF6804;
    text-decoration: unset;
}


#export-btn, #export-img-btn {
    background: #fff;
    font-size: 13px;
    color: #000;
    text-decoration: none;
    border: 0;
    padding: 6px 20px;
    margin-top: 15px;
    border-radius: 6px;
    cursor: pointer;
}

#export-btn, #export-img-btn {
    margin-top: 40px;
}

#instructions {
    position: absolute;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    padding: 10px 30px;
    font-size: 13px;
    line-height: 1;
    left: 0;
    top: 62px;
    background: rgba(255,255,255,.1);
    color: #fff;
    border-radius: 18px 0 0 18px;
    corner-shape: bevel;
    animation: .3s fadeOut 3s ease-out forwards;
}

#controls-container {
    top: calc(100% - 206px);
    left: calc(50% - 130px);
    position: absolute;
    padding: 12px 24px 24px 24px;
    background: rgba(153, 0, 0, 1);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    width: 200px;
    z-index: 20;
    box-shadow: 0 0 10px rgba(0, 0, 0, .2);
}
#controls-container .slider label {
    color: #fff;
}

#controls-container.active {
    display: flex;
}

.controls-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

#overlay-slot1-preview, #overlay-slot2-preview {
    background: #fff;
    border-radius: .5rem;
}

.overlay-image-wrapper a,
#selection-tools button,
#share-btn {
    display: inline-flex;
    justify-content: center;
    font-size: 17px;
    font-family: 'Icons';
    line-height: 1;
    text-decoration: none;
    width: 28px;
    height: 28px;
    background: #fff;
    color: #7E0A0A;
    border-radius: 50%;
    align-items: center;
    cursor: pointer;
    border: none;
}

#drag-handle {
    display: flex;
    height: 6px;
    cursor: grab;
    align-items: center;
    width: 100%;
    justify-content: center;
    padding: 8px 0;
}
#drag-handle:active {
    cursor: grabbing;
}
#drag-handle > div {
    background: rgba(255, 255, 255, 0.3);
    width: 70px;
    border-radius: 3px;
    height: 6px;
}

.palette-item {
    background: #fff;
    border: none;
    border-radius: .5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex-shrink: 0;
    aspect-ratio: 1;
    transition: all 0.2s ease-in-out;
    width: 70px;
    height: 70px;
    padding: 6px;
    cursor: pointer;
}
.palette-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.palette-item img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    pointer-events: none;
    display: block;
    vertical-align: middle;
}

form > div:not(:last-child) {
    margin-bottom: 15px;
}

form label {
    display: block;
    color: rgba(255,255,255,.7);
    font-size: 14px;
    margin: 8px 0 4px 0;
}

form input {
    display: block;
    font-size: 14px;
    width: 100%;
    padding: 8px 10px;
    box-sizing: border-box;
    background: rgba(248, 31, 31, 0.20);
    border-radius: 8px;
    border: 0;
    color: #fff;
}

form input:focus-visible {
    outline: none;
}

form .check-container {
  display: block;
  position: relative;
  padding-left: 25px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.3;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  color: #fff;
}

form .check-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

form .check-container .checkmark {
  position: absolute;
  top: 3px;
  left: 0;
  height: 13px;
  width: 13px;
  background-color: rgba(255,255,255,.1);
  border-radius: 50%;
}

form .check-container input:checked ~ .checkmark {
  background-color: #fff;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    cursor: pointer;
    outline: none;
    border-radius: 15px;
    height: 6px;
    background: rgba(255,255,255,.4);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    background-color: #900;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    transition: .2s ease-in-out;
}
input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    background-color: #900;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 50%;
    transition: .2s ease-in-out;
}

#tools-container {
    position: relative;
    width: 288px;
    background: rgba(248, 31, 31, 0.20);
    padding: 20px;
    margin: 30px;
    border-radius: 16px;
    height: calc(100% - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 13px;
    color: #fff;
    line-height: 1;
    margin: 0 0 13px 0;
    padding: 0;
    text-align: center;
}

.sidebar-title-mid {
    margin-top: 40px;
}

.mobile-nav {
    display: none;
}

.text-right {
    text-align: right;
}

.thirds {
    display: flex;
    gap: 10px;
}
.thirds > * {
    width: calc((100% - 20px) / 3);
}

.overlay-image-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.overlay-image-wrapper img {
    width: 80%;
    padding: 10%;
    height: auto;
}

#selection-tools {
    position: absolute;
    right: 0;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: .1s all ease-in-out;
}

#selection-tools.active {
    opacity: 1;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

@media screen and (min-width: 992px) and (max-width: 1365px) {
    #palette-container, #tools-container {
        width: 200px;
    }
    #export-img-btn {
        margin-top: 20px;
    }
}

@media screen and (min-width: 768px) and (max-width: 991px) {
    #canvas-parent {
        flex: unset;
        height: calc(84vh - 60px);
        height: calc(84vh - 60px);
    }

    .mobile-nav div {
        width: 150px;
    }
    
}

@media screen and (max-width: 991px) {

    main {
        flex-direction: column;
        height: calc(100vh - 83px);
        height: calc(100dvh - 83px);
    }
    #instructions {
        top: 0;
        width: 100%;
        border-radius: 0;
        margin: 0;
        padding: 5px 0;
        text-align: center;
    }
    #palette-container {
        width: 100%;
        margin: 0;
        padding: 0;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        border-radius: 0;
        overflow: unset;
        background: rgba(126, 10, 10, .7);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 9;
    }
    .palette-item {
        width: 65px;
        height: 65px;
    }
    #palette-items-wrapper {
        flex-wrap: nowrap;
        padding: 20px;
        overflow: auto;
    }
    #tools-container {
        position: fixed;
        bottom: 0;
        left: 0;
        width: calc(100% - 30px);
        height: auto;
        border-radius: 0;
        margin: 0;
        z-index: 9;
    }

    .sidebar-title {
        display: none;
    }

    #controls-container {
        display: none!important;
    }

    .sidebar h2 {
        font-size: 14px;
        padding: 15px;
    }

    .mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 10;
        padding: 20px;
        width: calc(100% - 40px);
        background: #7E0A0A;
    }

    .mobile-nav div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        padding: 10px;
        background: rgb(85, 0, 0);
        color: #7E0A0A;
        background: #7E0A0A;
        border: 1px solid #fff;
        color: #fff;
        border-radius: 30px;
        opacity: 0.3;
        cursor: pointer;
    }

    .mobile-nav .tab-link.active {
        background: #fff;
        color: #7E0A0A;
        opacity: 1;
    }

    .tools-container .tab {
        background: rgba(126, 10, 10, .7);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 20px;
    }

    .tab.tab-palette, .tools-container .tab {
        position: fixed;
        left: 0;
        bottom: 0;
        width: calc(100% - 40px);
        transform: translateY(100%);
        opacity: 0;
        transition: all 0.3s ease-in-out;
    }

    .tab.tab-palette.active, .tools-container.active .tab.active {
        transform: translateY(-82px);
        opacity: 1;
    }

    #export-btn, #export-img-btn {
        margin-top: 15px;
    }

    .text-right {
        text-align: left;
    }

    #instructions {
        position: fixed;
    }
}

@media screen and (max-width: 767px){
    .mobile-nav div {
        width: 80px;
    }
}

@media screen and (max-width: 390px) {

    main {
        justify-content: center;
    }
    #canvas-parent {
        flex: unset;
        height: calc(100vh - 200px);
        height: calc(100dvh - 200px);
        padding: 0;
    }

    #selection-tools {
        right: auto;
        left: -80px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 1;
        transition: .1s all ease-in-out;
    }

    #selection-tools.active {
        left: 10px;
        opacity: 1;
    }
}

