:root {
    --mauroy-pink: #e61c7d;
    /* Nice deep red pink! */
    --mauroy-pink-darker: rgb(140, 16, 76);
    --mauroy-grey-light: rgb(200, 200, 200);
    --mauroy-grey-medium: #212529;
    --mauroy-grey-darker: #181a1d;
    --mauroy-blue: #6079a1;
    --mauroy-grey-font: rgb(52, 58, 64);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--mauroy-grey-darker) 0%, var(--mauroy-grey-medium) 100%);
    min-height: 100vh;
    min-width: 400px;
    padding: 1vw;
    color: var(--mauroy-grey-light);
}

.container {
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    margin: 0 auto;
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1.5vw;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(230, 28, 125, 0.2);
}

h1 {
    text-align: center;
    color: var(--mauroy-grey-light);
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 300;
}

.panels-grid {
    display: flex;
    flex-wrap: wrap;
    width: 95vw;
    margin-bottom: 2vh;
    justify-content: space-around;
    align-items: flex-start;
}

.panel {
    background: var(--mauroy-grey-medium);
    border-radius: 1vw;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s;
    border: 2px solid rgba(230, 28, 125, 0.3);
    width: 45.0vw;
    height: 34.6vw;
    position: relative;
    margin-bottom: 2vw;
}

.panel:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-color: var(--mauroy-pink);
}


.white {
    background-color: white;
}

#img-window {
    order: 1;
    position: relative;
    overflow: hidden;
}

#img-padding {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

#img-src {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    /*object-fit: contain; */
    top: 0;
    left: 0;
}

#svgWindow {
    position: relative;
    order: 2;
    overflow: hidden;
}

#img-processing {
    order: 3;
}

#invisible {
    order: 4;
    visibility: hidden;
}

#canvas-centerLine {
    order: 5;
    position: relative;
}

#outputWindow {
    order: 6;
    overflow: hidden;
    position: relative;
}

#output-options {
    order: 7;
}

#smoothing-controls {
    order: 8;
}


.control-group {
    padding: 1vw;
    height: unset;
    align-items: flex-start;
}

.control-group h3 {
    color: var(--mauroy-grey-light);
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.slider-container {
    margin-bottom: 0.5vw;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    color: var(--mauroy-grey-light);
    font-weight: 500;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--mauroy-grey-light);
    outline: none;
    transition: background 0.3s ease;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--mauroy-grey-darker);
    border: none;
}

.slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--mauroy-grey-darker);
    border: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--mauroy-pink), var(--mauroy-pink-darker));
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
    border: 2px solid white;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(230, 28, 125, 0.5);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--mauroy-pink), var(--mauroy-pink-darker));
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.checkbox-group {
    margin-bottom: 1vw;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 1vw;
    cursor: pointer;
}

.checkbox {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
    accent-color: var(--mauroy-pink);
}

.checkbox-label {
    color: var(--mauroy-grey-light);
    font-weight: 500;
    cursor: pointer;
}

.create-btn {
    background: linear-gradient(45deg, var(--mauroy-pink), var(--mauroy-pink-darker));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 5px 15px rgba(230, 28, 125, 0.3);
}

.create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 28, 125, 0.4);
}

.create-btn:active {
    transform: translateY(0);
}

#fileInput {
    color: var(--mauroy-grey-light);
    font-size: 1em;
    width: 100%;
}

#fileInput::file-selector-button {
    background: linear-gradient(45deg, #3f639c, #2d4f82);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    box-shadow: 0 5px 15px rgba(63, 99, 156, 0.3);
}

#fileInput::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(63, 99, 156, 0.4);
}

#svgTextOutput {
    width: 80vw;
    background: var(--mauroy-grey-light);
    color: black;
    border: 2px solid rgba(230, 28, 125, 0.3);
    border-radius: 8px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

#svgTextOutput:focus {
    border-color: var(--mauroy-pink);
    outline: none;
}

/* Overlay styles */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1vw;
    z-index: 10;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#fileInput {
    display: block;
}

#canvas {
    display: block;
}

#canvas-svg-window {
    display: block;
}

#centerLineCanvas {
    display: block;
    border: solid red 1px;
}

#smoothedCanvas {
    display: block;
}

/* Potrace SVG output: scale to fill the panel like the input image */
#svgOutput svg {
    display: block;
    width: 100%;
    height: auto;
}


.flexbox-centered {
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkbox-buttons {
    display: flex;
    justify-content: space-around;
    align-items: baseline;
    border: solid white 1px;
}



.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(230, 28, 125, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.close-button:hover {
    background: var(--mauroy-pink);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(230, 28, 125, 0.5);
}

.close-button:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .panel {
        width: 90vw;
        height: 90vw;
    }

    .control-group {
        height: unset;
    }

    .panels-grid {
        gap: 3vh;
    }

    .control-group {
        width: 95%;
    }

    .container {
        padding: 0;
    }

    h1 {
        font-size: 2em;
    }

    #img-window {
        order: 1;
    }

    #svgWindow {
        order: 3;
    }

    #img-processing {
        order: 2;
    }

    #invisible {
        display: none;
    }

    #canvas-centerLine {
        order: 4;
    }

    #outputWindow {
        order: 6;
    }

    #output-options {
        order: 5;
    }

    #smoothing-controls {
        order: 7;
    }
}

/* Smooth animations */
.panel,
.slider,
.create-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glow effect for active elements */
.panel:focus-within {
    box-shadow: 0 0 0 3px rgba(230, 28, 125, 0.2);
}