@font-face {
    font-family: 'Satoshi';
    src: url('assets/fonts/Satoshi-Medium.otf') format('woff2');
}

* {
    box-sizing: border-box;
}

html {
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    background-color: #111111;
    font-family: 'Satoshi', Arial, sans-serif;
    overflow: hidden;
    /* color: #111111; */
    display: flex;
    flex-direction: column;
    height: 100vh;
}

canvas {
    display: block;
    max-width: calc(100% - 200px);
    max-height: calc(100% - 200px);
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

#websiteLink {
    position: fixed;
    top: 10px;
    right: 20px;
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 18px;
    color: #ffffff;
    text-decoration: none;
}

#websiteLink:hover {
    text-decoration: none;
    color: transparent;
    text-shadow: 0 0 3px rgba(255, 255, 255, 1);
}

#main-title {
    position: fixed;
    top: 10px;
    left: 20px;
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 18px;
    font-weight: normal;
    color: #ffffff;
    margin: 0;
    z-index: 0;
}

/* Main layout container */
#main-container {
    display: flex;
    flex: 1;
    width: 100%;
    height: calc(100vh - 60px);
    gap: 0;
}

/* GUI section - left side, hides when closed */
#gui-section {
    width: 380px;
    flex-shrink: 0;
    transition: margin-left 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

#gui-section.hidden {
    width: 0;
    margin-left: -380px;
}

/* Canvas section - right side, expands to fill space */
#canvas-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#canvas-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.gui-toggle-btn {
    position: fixed;
    top: 45px;
    left: 20px;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
    transition: opacity 0.3s ease;
    border-radius: 3px;
    margin: 0;
    width: auto;
    display: inline-block;
    opacity: 1;
    pointer-events: auto;
}

.gui-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gui-toggle-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.gui-close-btn {
    position: absolute;
    right: 10px;
    top: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gui-close-btn:hover {
    background: none;
    color: #cccccc;
}

#gui-panel {
    position: relative;
    height: 100%;
    width: 100%;
    color: #f0f0f0;
    font-size: 12px;
    overflow-y: auto;
}

.gui-content {
    padding: 50px 20px 20px 20px;
    height: calc(100%);
    overflow-y: auto;
}

.gui-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(25px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    /* border-radius: 10px; */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gui-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #f0f0f0;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    margin: 10px 0;
}

input[type="number"] {
    width: 60px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 10px;
}

.gui-select {
    width: 100%;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 11px;
    cursor: pointer;
    font-family: 'Satoshi', Arial, sans-serif;
    margin: 5px 0;
}

.gui-select:hover {
    background: rgba(255, 255, 255, 0.15);
}

.gui-select option {
    background: #2a2a2a;
    color: #ffffff;
}

.range-container {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 5px;
}

.range-container label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

.range-container>div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.canvas-presets-section {
    margin-bottom: 20px;
}

.canvas-preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.canvas-preset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 5px 16px;
    margin: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.canvas-preset-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

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

.gui-section-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    margin: 25px 0;
}

.gui-section-header {
    font-size: 14px;
    font-weight: normal;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* Remove top margin from first section headers */
.gui-content>.gui-section:first-child .gui-section-header,
#controls-section> :first-child .gui-section-header {
    margin-top: 0;
}

button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    margin: 5px;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.1s ease;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preview-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.preview-item {
    flex: 1;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-label {
    font-size: 11px;
    color: #ccc;
    margin-top: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px;
}

input[type="file"] {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    margin-bottom: 10px;
}

/* Switch control styling */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    margin-top: 5px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.2s;
    border-radius: 26px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: #fff;
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked+.switch-slider {
    background-color: rgba(100, 200, 255, 0.9);
}

.switch input:checked+.switch-slider:before {
    transform: translateX(20px);
}

/* Cuts Selector Grid */
.cuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 0px;
    margin-bottom: 10px;
}

.cut-selector-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888888;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Satoshi', Arial, sans-serif;
    margin: 0;
}

.cut-selector-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cut-selector-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.cut-selector-btn.has-cut {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.cut-selector-btn.has-cut.active {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    #main-container {
        display: relative;
    }

    #gui-section {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        height: auto;
        flex-shrink: 0;
        margin-top: 30px;
        overflow: visible !important;
    }

    #canvas-section {
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    #gui-panel {
        width: 100vw;
    }

    .gui-content {
        width: 100%;
    }

    #main-title {
        top: 10px;
        left: 10px;
        font-size: 16px;
    }

    .gui-toggle-btn {
        top: 45px;
        left: 10px;
        padding: 3px 6px;
        font-size: 12px;
    }

    #websiteLink {
        top: 10px;
        right: 10px;
        font-size: 16px;
    }

    canvas {
        max-width: calc(100% - 10px);
        max-height: calc(100% - 10px);
    }
}