/* Import custom Open Sans font files */
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

/* Apply new custom default font with fallback, button and textarea are special, they do not inherit the font from body */
body,
button,
textarea {
    font-family: 'Open Sans', sans-serif;
}

/* Main header used outside of the panels */
h1 {
    font-size: 36px;
    margin-top: 0px;
    margin-bottom: 20px;
}

/* Second level header used in the different panels at the top */
h2 {
    font-size: 32px;
    margin-top: 0px;
    margin-bottom: 10px;
    overflow-wrap: break-word;
}

/* Third level header used for progress status and results */
h3 {
    font-size: 24px;
    margin-top: 0px;
    margin-bottom: 10px;
}

/* Color for size text is a bit muted */
#info-size,
#progress-size,
#result-size,
#error-size {
    color: #667799;
    cursor: help;
}

/* Special badge styling for expiration duration */
#info-expiration,
#progress-expiration,
#result-expiration,
#error-expiration {
    font-size: 12px;
    vertical-align: middle;
    white-space: nowrap;
    margin-left: 5px;
    color: #1F65F0;
    background-color: #EFF4FE;
    border-radius: 20px;
    border: 1px solid #DEE8FD;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    cursor: help;
}

/* We use a different badge color for expired links */
#info-expiration.expired,
#progress-expiration.expired,
#result-expiration.expired,
#error-expiration.expired {
    color: #E50505;
    border-color: #FDB9B9;
    background-color: #FFEBEB;
}

/* Fixed Sphere XG logo in the top left corner */
#logo {
    position: fixed;
    top: 35px;
    left: 50px;
    width: 70px;
    height: 70px;

    background-image: url("images/logo.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: top left;
}

/* Link back to the Sphere XG Dashboard */
#sphere-link {
    position: fixed;
    top: 45px;
    right: 80px;

    background-color: white;
    color: #1F65F0;
    border: none;
    border-radius: 4px;
    padding: 10px;
    padding-left: 15px;
    padding-right: 15px;
    text-decoration: none;
    margin-right: 20px;
}

/* Tiny hover effect for text color in the XG link */
#sphere-link:hover {
    color: rgb(14, 78, 204);
}

/* Help icon in the top right corner */
#help-link {
    position: fixed;
    top: 51px;
    right: 50px;
    width: 21px;
    height: 21px;
    border-radius: 15px;
    padding: 5px;
}

/* Small hover effect for the help icon */
#help-link:hover {
    background-color: rgba(236, 238, 242, 0.2);
}

/* Contains the main header and the panels */
#main-container {
    position: fixed;
    top: 120px;
    left: 180px;
    color: white;
}

/* Adjust main container position for smaller screens */
@media (max-width: 700px) {
    #main-container {
        left: 60px;
    }
}

/* Main header is two lines if the screen is big enough */
@media (min-height: 900px) {
    #header {
        width: 475px;
        font-size: 44px;
    }
}

/* Contains the different white content panels of the app */
#panel-container {
    background-color: white;
    border-radius: 10px;
    color: #363C4D;
    padding: 20px;
    width: 400px;
}

/* Small version number in the bottom left corner */
#version {
    position: fixed;
    bottom: 5px;
    left: 5px;
    color: white;
    opacity: 0.5;
    font-size: 12px;
}

/* Optional hints at the bottom that are active during certain states of the download */
#keep-open-hint,
#close-hint {
    position: fixed;
    bottom: 0px;
    right: 0px;
    left: 0px;
    text-align: center;
    padding: 35px;
    color: white;
}

/* Hints are not used for small screen heights */
@media (max-height: 900px) {
    #keep-open-hint,
    #close-hint {
        display: none !important;
    }
}

/* The keep open hint has a special color background */
#keep-open-hint {
    background: rgba(255, 203, 0, 0.3);
}

/* The close hint has a special color background */
#close-hint {
    background: rgba(0, 0, 0, 0.2);
}

/* The spinner and the images should use the same size and padding */
#input-image,
#info-image,
#progress-spinner,
#result-image,
#error-image {
    margin-top: 50px;
    margin-bottom: 50px;
    height: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
}

/* Reduce vertical margin for smaller screens */
@media (max-height: 800px) {
    #input-image,
    #info-image,
    #progress-spinner,
    #result-image,
    #error-image {
        margin-top: 20px;
        margin-bottom: 20px;
    }
}

/* Show download image for input and info panels */
#input-image,
#info-image {
    background-image: url("images/download.svg");
}

/* Image for completed download in the results panel */
#result-image {
    background-image: url("images/complete.svg");
}

/* Error image for failures in the error panel */
#error-image {
    background-image: url("images/error.svg");
}

/* Center all headers and messages in the different panels */
#result-header,
#result-message,
#progress-header,
#progress-message,
#error-header,
#error-message,
#error-link {
    text-align: center;
}

/* The messages in the different panels are a bit muted */
#result-message,
#progress-message,
#error-message {
    color: #667799;
    margin-bottom: 20px;
}

/* Center and colorize the link to contact support */
#error-link {
    display: block;
    color: #1F65F0;
    text-decoration: none;
    font-weight: bold;
}

/* The input field for manual entering of URLs */
#input-url {
    width: 385px;
    font-size: 16px;
    padding: 5px;
    margin-bottom: 20px;
}

/* The start download buttons */
#input-download,
#info-download {
    background-color: #1F65F0;
    color: white;
    border: none;
    border-radius: 4px;
    width: 100%;
    font-size: 20px;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

/* Hover effects for download buttons */
#input-download:hover:not(:disabled),
#info-download:hover:not(:disabled) {
    background-color: rgb(14, 78, 204);
}

/* Mouse down effect for download buttons */
#input-download:hover:active:not(:disabled),
#info-download:hover:active:not(:disabled) {
    background-color: rgb(11, 60, 157);
}

/* Disabled state for download buttons */
#input-download:disabled,
#info-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Container for original link and clipboard button */
#info-link-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Original direct download link */
#info-link {
    font-size: 12px;
    text-decoration: none;
    color: #667799;
}

/* Copy to clipboard button */
#info-copy {
    margin-left: 5px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    background-image: url("images/link.svg");
    background-size: 20px 20px;
}

/* Class to add brief animation to copy button */
.info-copy-animation {
    animation: clipboardAnimation 2s;
}

/* Animation that temporarily replaces the copy icon with a success icon */
@keyframes clipboardAnimation {
    0% {
        opacity: 1;
        background-image: url("images/link.svg");
    }
    3% {
        opacity: 0.0;
        background-image: url("images/link.svg");
    }
    4% {
        opacity: 0.0;
        background-image: url("images/success.svg");
    }
    8% {
        opacity: 1.0;
        background-image: url("images/success.svg");
    }
    90% {
        opacity: 1.0;
        background-image: url("images/success.svg");
    }
    95% {
        opacity: 0.0;
        background-image: url("images/success.svg");
    }
    96% {
        opacity: 0.0;
        background-image: url("images/link.svg");
    }
    100% {
        opacity: 1.0;
        background-image: url("images/link.svg");
    }
}

/* By default the original link and the copy button are slightly transparent */
#info-link,
#info-copy {
    opacity: 0.8;
}

/* Change opacity for hover animation of original link and copy button */
#info-link:hover,
#info-copy:hover {
    opacity: 1;
}

/* Hide dynamic panels until JS code decides to show them */
#panel-container,
#keep-open-hint,
#close-hint {
    display: none;
}

/* Background with blueish gradient */
#gradient {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100vw;
    height: 100vh;
}

/* Transparent large Sphere XG logo in the background on the right */
#sphere {
    position: fixed;
    top: -15vh;
    right: 0px;
    height: 130vh;
}