:root {
    --tp-50: #18181b;
    --tp-100: #1d1d20;
    --tp-200: #27272b;
    --tp-300: #303036;
    --tp-400: #3a3a41;
    --tp-500: #9ca3af;
    --tp-600: #d1d5db;
    --tp-700: #e5e7eb;
    --tp-800: #f3f4f6;
    --tp-900: #f9fafb;
}

@font-face {
    font-family: GILROY;
    src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-300.TTF) format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap
}
@font-face {
    font-family: GILROY;
    src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-400.TTF) format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap
}
@font-face {
    font-family: GILROY;
    src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-500.TTF) format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap
}
@font-face {
    font-family: GILROY;
    src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-600.TTF) format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap
}
@font-face {
    font-family: GILROY;
    src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-700.TTF) format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap
}
@font-face {
    font-family: GILROY;
    src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-800.TTF) format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap
}

* {
    font-family: 'GILROY', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    background-color: var(--tp-50);
    color: var(--tp-700);
}

.btn {
    @apply py-2 px-4 rounded transition-all duration-200 font-semibold;
    background-color: var(--tp-300);
    color: var(--tp-700);
    line-height: 1.2;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn svg {
    margin-right: 4px;
}

.btn:hover {
    background-color: var(--tp-400);
}

.btn-primary {
    background-color: #0078d7;
    color: white;
}

.btn-primary:hover {
    background-color: #1684e0;
}

.btn-primary:active {
    background-color: #00559f;
}

.btn:disabled {
    background-color: var(--tp-200);
    color: var(--tp-500);
    cursor: not-allowed;
}

.panel-group {
    background-color: var(--tp-100);
    border: 1px solid var(--tp-300);
    border-radius: 8px;
    flex-shrink: 0;
}

.panel-title {
    background-color: var(--tp-200);
    color: var(--tp-700);
    font-weight: 600;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

input[type="number"] {
    background-color: var(--tp-300);
    color: var(--tp-700);
    border: 1px solid var(--tp-400);
    border-radius: 4px;
}

.canvas-container {
    background-color: var(--tp-200);
    border: 1px solid var(--tp-300);
    overflow: hidden;
    position: relative;
    height: 100%;
    width: 100%;
}

#imageCanvas {
    cursor: crosshair;
    position: absolute;
    transform-origin: 0 0;
}

.status-bar {
    background-color: var(--tp-200);
    color: var(--tp-600);
    border-top: 1px solid var(--tp-300);
}

.color-box {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1px solid var(--tp-400);
    border-radius: 4px;
    cursor: pointer;
}

.color-box.active {
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--tp-50);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--tp-100);
}

::-webkit-scrollbar-thumb {
    background: var(--tp-300);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tp-400);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--tp-300);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #0078d7;
    border-radius: 50%;
    cursor: pointer;
}

.page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.header {
    flex: 0 0 auto;
}

.main-content {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
    height: calc(100vh - 56px - 36px);
}

.canvas-section {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.canvas-wrapper {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
    background-color: var(--tp-200);
    border-radius: 8px;
}

.control-panel {
    flex: 0 0 330px;
    overflow-y: auto;
    padding-right: 3px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer {
    flex: 0 0 auto;
}

.mobile-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.mobile-warning-content {
    padding: 2rem;
    max-width: 90%;
    width: 480px;
    text-align: center;
    color: white;
}

.grid-corner-point {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: rgba(255, 255, 0, 0.8);
    border: 2px solid black;
    border-radius: 50%;
    transform: translate(-7px, -7px);
    cursor: move;
    z-index: 10;
}

@media screen and (max-width: 1100px) {
    .control-panel {
        flex: 0 0 290px;
    }
}

@media screen and (max-width: 900px) {
    .main-content {
        flex-direction: column;
        overflow-y: auto;
        padding-right: 8px;
    }
    
    .canvas-section {
        height: 60vh;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .control-panel {
        width: 100%;
        flex: none;
        overflow-y: visible;
    }
}

.hidden{
    display:none;
}

.selected-point {
    background-color: rgba(0, 255, 0, 0.8);
    transform: translate(-7px, -7px) scale(1.2);
}