/* todo: convert to woff */
@font-face {  font-family: 'Assistant'; src: url('fonts/Assistant.ttf') format('truetype') }
@font-face {  font-family: 'Font1'; src: url('fonts/Font1.otf') format('opentype') }
@font-face {  font-family: 'Font2'; src: url('fonts/Font2.otf') format('opentype') }
@font-face {  font-family: 'Font3'; src: url('fonts/Font3.otf') format('opentype') }
@font-face {  font-family: 'Font3_heart'; src: url('fonts/Font3_heart.otf') format('opentype') }
@font-face {  font-family: 'Font4'; src: url('fonts/Font4.otf') format('opentype') }
@font-face {  font-family: 'Font5'; src: url('fonts/Font5.otf') format('opentype') }
@font-face {  font-family: 'Font6'; src: url('fonts/Font6.otf') format('opentype') }
@font-face {  font-family: 'Font7'; src: url('fonts/Font7.otf') format('opentype') }
@font-face {  font-family: 'Font8'; src: url('fonts/Font8.otf') format('opentype') }
.font1 { font-family: Font1, serif !important; font-weight: normal; }
.font2 { font-family: Font2, serif !important; font-weight: normal; }
.font3 { font-family: Font3, serif !important; font-weight: normal; }
.font3_heart { font-family: Font3_heart, serif !important; font-weight: normal; }
.font4 { font-family: Font4, serif !important; font-weight: normal; }
.font5 { font-family: Font5, serif !important; font-weight: normal; }
.font6 { font-family: Font6, serif !important; font-weight: normal; }
.font7 { font-family: Font7, serif !important; font-weight: normal; }
.font8 { font-family: Font8, serif !important; font-weight: normal; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    min-width: 350px;
    text-size-adjust: none;
    opacity: 0;
    transition: opacity 2s;
}
body, input, textarea, select, option, button {
    font-family: Assistant, Georgia, serif;
    font-size: 14px;
}
p {
    line-height: 1.4em;
}
h1, h2 {
    font-weight: normal;
    font-size: 2.5em;
    margin-bottom: 0.5em;
}
h2 {
    font-size: 1.8em;
}
input, textarea, select, option {
    border: 1px solid silver;
    border-radius: 5px;
}

.info {
    position: absolute;
    left: 0;
    top: 700px;
    padding: 6px;
    max-width: 800px;
}
.description {
    border-top: 1px solid silver;
    padding-top: 0.5em;
    margin-top: 2em;
}

.output-box  {
    position: relative;
    max-width: 350px;
}
.output-box .output-text {
    width: 100%;
    height: 60px;
    display: block;
    padding: 2px 4px;
    margin: 4px 0 10px;
    resize: none;
}
.output-box .output-copy-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    padding: 2px 4px;
    cursor: pointer;
    border: 1px solid #737373;
    border-radius: 4px;
    background-color: #f3f3f3;
}
.copied .output-box .output-copy-btn {
    opacity: 0.5;
}
.copied .output-text-copy, .output-text-copied {
    display: none;
}
.copied .output-text-copied, .output-text-copy {
    display: block;
}
.shop-link {
    border: 1px solid rgb(0, 0, 0);
    border-radius: 22px;
    padding: 9px 16px;
    text-decoration: none;
    display: inline-block;
    color: black;
    font-weight: bold;
    font-size: 15px;
}
.shop-link:hover {
    border-width: 2px;
    margin: -1px;
}
.shop-link-text {
    margin-left: 0.5em;
    display: none;
}
.copied .shop-link-text {
    display: inline-block;
}
.copied .shop-link {
    background-color: #212121;
    color: white;
}


.container {
    display: flex;
}

.controls {
    padding: 20px;
}
.controls .field {
    margin-bottom: 1.2em;
}
.controls .field-fonts {
    max-width: 565px;
}
.controls label {
    display: block;
}
.controls #text {
    padding: 6px 6px;
    width: 200px;
}
.controls #glitter {
    vertical-align: bottom;
}
.controls #size {
    vertical-align: middle;
    width: 160px;
}

.controls a.font {
    border: 1px solid silver;
    border-radius: 12px;
    padding: 10px 5px;
    display: inline-block;
    cursor: pointer;
    width: 110px;
    height: 50px;
    vertical-align: top;
    margin-top: 5px;
    text-align: center;
    overflow: hidden;
    line-height: 1em;
    user-select: none;
    white-space: nowrap;
}
.controls a.font:hover {
    border-color: black;
}
.controls a.font.active {
    border-color: black;
    box-shadow: 0 0 0 1px #000000;
}
.controls a.font1 { font-size: 30px; }
.controls a.font2 { font-size: 26px; }
.controls a.font3, .controls a.font3_heart { font-size: 30px; }
.controls a.font4 { font-size: 30px; }
.controls a.font5 { font-size: 30px; }
.controls a.font6 { font-size: 25px; }
.controls a.font7 { font-size: 30px; }
.controls a.font8 { font-size: 25px; }

.preview-wrapper {
    flex-grow: 0;
    flex-shrink: 0;
    position: relative;
}

.preview-wrapper, .preview {
    max-width: 800px;
    max-height: 700px;
    overflow: hidden;
}
.preview {
    width: 800px;
    height: 700px;
    transform: scale(1);
    transform-origin: top left;
}
.preview {
    background-image: url(images/background.jpg);
    background-size: 140%;
    background-position: 40% 77%;
    position: relative;
}

.text-box {
    display: inline-block;
    width: 200px; /* default for 15" */
    height: 146px; /* default for 11" */
    border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
    position: absolute;
    top: 100px;
    left: 240px;
    cursor: move;
}
.text-box:focus {
    border: 1px dashed silver;
}
.text-box:hover {
    background-color: rgba(128, 128, 128, 0.08);
    border: 1px dashed silver;
}
.text-box .text {
    color: #d0ac77;
    filter: drop-shadow(0px 1px rgb(0 0 0 / 50%)) drop-shadow(3px 3px 5px rgb(0 0 0 / 15%));
    /*text-shadow: 1px 1px rgb(0 0 0 / 70%), 3px 3px 5px rgb(0 0 0 / 35%);*/
    /*background: rgb(255 76 76 / 6%);*/

    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;

    line-height: 0;
    padding: 100px 20px; /* fixes not drawn font background */
}
.text-box .text.font1 { bottom: -65px; }
.text-box .text.font2 { bottom: -75px; }
.text-box .text.font3, .text-box .text.font3_heart { bottom: -70px; }
.text-box .text.font4 { bottom: -76px; }
.text-box .text.font5 { bottom: -70px; }
.text-box .text.font6 { bottom: -85px; }
.text-box .text.font7 { bottom: -80px; }
.text-box .text.font8 { bottom: -65px; }

.text-box .ruler-width {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    user-select: none
}

.custom_colors {
    max-width: 570px;
}
.custom_colors .custom_color {
    display: inline-block;
    background-size: 100%;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    margin: 6px 4px;
    vertical-align: top;
    border: 1px solid #c5c5c5;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #bebebe;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}


.custom_colors .custom_color:hover {
    border-color: gray;
    width: 50px;
    height: 50px;
    margin: 4px 2px;
}

.custom_colors .custom_color.active {
    box-shadow: 0 0 0 2px #000000, 0 0 0 3px #bebebe;
}

.custom_colors div.custom_color {
    overflow: hidden;
    position: relative;
    border-color: white !important;
}
.custom_colors div.custom_color input[type="color"]{
    width: 140%;
    height: 140%;
    margin-left: -20%;
    margin-top: -20%;
    cursor: pointer;
}
.custom_colors div.custom_color span {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.custom_colors div.custom_color span.color-picker-icon {
    background-image: url("images/color_wheel.png");
    background-size: 100%;
    background-repeat: no-repeat;
}

.custom_colors .color_white {
    border: 1px solid #c5c5c5;
}

.text-box .text {
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glitter {
    background-image: url(images/glitter.png);
    background-size: 10%;
}

.color_wood                 { background-image: url(images/wood.png); background-size: 20%; }
.color_rainbow              { background-image: url(images/glitter.png), linear-gradient(to right, #f6c48f, #f6a9bf, #9d8fc4, #71b1d4, #76cdd6, #9dc6b7, #e7ec9c); background-size: 20%, 100%;  }
.color_underwater           { background-image: url(images/glitter.png), linear-gradient(to right, #5572b8, #6dc9ca); background-size: 10%, 100%; }
.color_sunset               { background-image: url(images/glitter.png), linear-gradient(to right, #f1606b, #fdc373); background-size: 10%, 100%; }
.color_mermaid              { background-image: url(images/glitter.png), linear-gradient(to right, #9066a1, #a986bd, #82d0d6, #a2d5ad); background-size: 10%, 100%; }
.color_earth                { background-image: url(images/glitter.png), linear-gradient(to right, #a2d187, #69c5eb); background-size: 10%, 100%; }
.color_cotton_candy         { background-image: url(images/glitter.png), linear-gradient(to right, #65bead, #eee49b, #ec8389); background-size: 10%, 100% }
.color_strawberry_milkshake { background-image: url(images/glitter.png), linear-gradient(to right, #d85986, #f38fbb, #f9cde0); background-size: 10%, 100% }
.color_universe             { background-image: url(images/glitter.png), linear-gradient(to right, #f6bf74, #d77185, #8767ad, #4653a4); background-size: 10%, 100%; }
.color_gold                 { background-image: url(images/gold.png); background-size: 30%; }
.color_silver               { background-image: url(images/silver.png); background-size: 30%; }
.color_rose_gold            { background-image: url(images/rose_gold.png); background-size: 30%; }
.color_white.glitter        { background-image: url(images/glitter_gray.png); }
.color_white                { background-color: #ffffff; }
.color_pink                 { background-color: #e68fb6; }
.color_peach                { background-color: #edb2ab; }
.color_yellow               { background-color: #efd56d; }
.color_green                { background-color: #83bd7c; }
.color_blue                 { background-color: #73b9dc; }
.color_purple               { background-color: #a292c6; }





/* Apple switch */
input.apple-switch {
  position: relative;
  -webkit-appearance: none;
  outline: none;
  width: 40px;
  height: 20px;
  background-color: #fff;
  border: 1px solid #D9DADC;
  border-radius: 50px;
  box-shadow: inset -20px 0 0 0 #fff;
}

input.apple-switch:after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  background: transparent;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 2px 4px 6px rgba(0,0,0,0.2);
}

input.apple-switch:checked {
  box-shadow: inset 20px 0 0 0 #4ed164;
  border-color: #4ed164;
}

input.apple-switch:checked:after {
  left: 20px;
  box-shadow: -2px 4px 3px rgba(0,0,0,0.05);
}
input.apple-switch:disabled {
    opacity: 0.4;
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip .tooltiptext {
    visibility: hidden;
    background-color: #ffffffb3;
    color: #000;
    text-align: center;
    border-radius: 6px;
    padding: 5px 7px;
    position: absolute;
    z-index: 1;
    top: 55px;
    white-space: nowrap;
    border: 1px solid silver;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
}
/*
<div class="tooltip">Hover over me
  <span class="tooltiptext">Tooltip text</span>
</div>
*/

/* Override coloris */
.clr-picker {
    padding-bottom: 13px;
    margin-top: 5px;
    margin-left: 12px;
}
.clr-preview, .clr-color {
    display: none;
}
.clr-hue, #clr-hue-slider {
    height: 20px !important;
}
.clr-hue div, .clr-alpha div {
    width: 26px !important;
    height: 26px !important;
}

.custom_colors div.custom_color .clr-field button {
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    transform: none;
    position: absolute;
    cursor: pointer;
}
.custom_colors div.custom_color .clr-field input {
    width: 40px;
    height: 40px;
    cursor: pointer;
}


@media only screen and (max-width: 1075px)  {
    .controls h1 {
        display: none;
    }
    .container {
        flex-direction: column;
    }
    .controls .field:nth-of-type(1), .controls .field:nth-of-type(2), .controls .field:nth-of-type(3) {
        display: inline-block;
    }
    .controls .field:nth-of-type(1), .controls .field:nth-of-type(2) {
        margin-right: 5px;
    }
    .controls .field-fonts {
        max-width: inherit;
    }
    .custom_colors {
        max-width: none;
    }
    .info {
        position: inherit;
        padding: 0;
    }
}

@media only screen and (max-width: 1024px)  { /* tablets */

}

@media only screen and (max-width: 480px)  { /* smartphones */
    .controls {
        padding: 10px 2px 80px 10px;
    }
    .controls .field {
        margin-right: 0;
    }
    .description {
        padding-right: 8px;
    }
    .preview-wrapper, .preview {
        max-height: 500px;
    }
    .preview {
        height: 380px;
        background-position-y: 40%;
        translate: -6% 0;
    }
    .preview .text-box {
        top: 10px;
    }
    .controls #text {
        width: 165px;
        font-size: 1.2em;
    }
     .custom_colors {
        max-width: 335px;
    }
    .custom_colors .custom_color {
        width: 36px;
        height: 36px;
    }
    .custom_colors .custom_color:hover {
        width: 40px;
        height: 40px;
    }

}
