@font-face {
    font-family: 'Yermak';
    src: url('./fonts/Yermak.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body { 
    margin: 0; 
    overflow: hidden; 
    font-family: 'Segoe UI', sans-serif; 
    background-color: #f0f2f5; 
}

#canvas-container { 
    width: 100vw; 
    height: 100vh; 
    display: block; 
    cursor: default; 
}

#modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); 
    z-index: 1000;
    display: flex; 
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white; 
    padding: 40px; 
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    text-align: center;
    max-width: 500px; 
    width: 90%;
}

.modal-title { 
    font-size: 24px; 
    margin-bottom: 30px; 
    color: #2c3e50; 
}

.type-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    margin-bottom: 20px; 
}

.type-card {
    border: 2px solid #eee; 
    border-radius: 12px; 
    padding: 20px;
    cursor: pointer; 
    transition: all 0.2s;
}

.type-card:hover { 
    border-color: #00a896; 
    background: #f0fdfc; 
    transform: translateY(-3px); 
}

.type-icon { 
    font-size: 40px; 
    margin-bottom: 10px; 
    display: block; 
}

.type-name { 
    font-weight: bold; 
    color: #333; 
}

.controls {
    position: absolute; 
    top: 20px; 
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px; 
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 400px; 
    max-height: 90vh; 
    overflow-y: auto;
    z-index: 10; 
    display: none;
}

h2 { 
    margin-top: 0; 
    color: #2c3e50; 
    font-size: 18px; 
    border-bottom: 2px solid #00a896; 
    padding-bottom: 10px; 
}

h3 { 
    margin: 15px 0 10px; 
    color: #555; 
    font-size: 16px; 
    border-left: 4px solid #ddd; 
    padding-left: 10px; 
}

h4 { 
    margin: 10px 0 8px; 
    color: #666; 
    font-size: 14px; 
}

.control-group { 
    margin-bottom: 12px; 
}

label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: 600; 
    color: #555; 
    font-size: 14px; 
}

input[type="range"], select, input[type="text"], textarea, input[type="number"] { 
    width: 100%; 
    padding: 8px; 
    border-radius: 6px; 
    border: 1px solid #ccc; 
    box-sizing: border-box;
}

input[type="file"] { 
    width: 100%; 
    font-size: 14px; 
}

input[type="color"] { 
    width: 60px; 
    height: 30px; 
    padding: 2px; 
    cursor: pointer; 
}

button {
    background: #00a896; 
    color: white; 
    border: none; 
    padding: 10px 16px;
    border-radius: 6px; 
    cursor: pointer; 
    width: 100%; 
    font-weight: 600; 
    margin-top: 8px;
    transition: all 0.2s ease;
}

button:hover { 
    background: #008f7f; 
    transform: translateY(-1px); 
}

button.small { 
    width: auto; 
    padding: 6px 12px; 
    font-size: 12px; 
    margin-top: 4px; 
}

button.danger { 
    background: #e74c3c; 
}

button.danger:hover { 
    background: #c0392b; 
}

.checkbox-group { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-bottom: 10px; 
}

.checkbox-group input { 
    width: auto; 
}

.value-display { 
    float: right; 
    color: #00a896; 
    font-weight: bold; 
}

.hint-box {
    background: #f8fafc; 
    border-left: 3px solid #00a896;
    padding: 10px; 
    margin-top: 10px; 
    font-size: 12px; 
    color: #64748b;
    border-radius: 0 6px 6px 0;
}

.mode-switch {
    background: #eef; 
    padding: 10px; 
    border-radius: 8px; 
    margin-bottom: 15px;
    display: flex; 
    gap: 10px;
}

.mode-switch button {
    background: #ccc; 
    margin: 0; 
    width: 50%; 
    padding: 8px;
}

.mode-switch button.active {
    background: #00a896;
}

#loading-msg {
    position: absolute; 
    bottom: 20px; 
    right: 20px; 
    background: rgba(0,0,0,0.7); 
    color: white; 
    padding: 10px; 
    border-radius: 5px; 
    display: none;
    z-index: 20;
}

.coordinate-group {
    background: #f0f8ff; 
    padding: 12px; 
    border-radius: 8px;
    margin: 10px 0; 
    border: 1px solid #b8d4fe;
}

.coordinate-group h4 { 
    margin: 0 0 8px; 
    color: #0056b3; 
    font-size: 14px; 
}

.coord-row {
    display: grid; 
    grid-template-columns: 30px 1fr 30px 1fr 30px 1fr;
    gap: 5px; 
    align-items: center; 
    margin-bottom: 5px;
}

.coord-row span {
    font-size: 12px; 
    font-weight: bold; 
    color: #666; 
    text-align: center;
}

.coord-row input {
    padding: 4px; 
    font-size: 12px; 
    text-align: center;
}

.photo-preview {
    width: 100%; 
    max-height: 100px; 
    object-fit: contain;
    margin-top: 5px; 
    border-radius: 4px; 
    border: 1px solid #ddd;
    display: none;
}

.photo-shape-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.shape-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
}

.shape-option:hover { 
    border-color: #00a896; 
    background: #f0fdfc; 
}

.shape-option.active { 
    border-color: #00a896; 
    background: #00a896; 
    color: white; 
}

.shape-icon {
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 4px;
    border: 2px solid currentColor;
}

.shape-oval { 
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; 
}

.shape-circle { 
    border-radius: 50%; 
}

.shape-square { 
    border-radius: 4px; 
}

.shape-custom { 
    border-radius: 4px; 
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(0,0,0,0.05) 5px, rgba(0,0,0,0.05) 10px); 
}

.mm-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.mm-inputs label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.mm-inputs input {
    padding: 6px;
    font-size: 13px;
}

#toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    font-family: 'Segoe UI', sans-serif;
}

/* КАТАЛОГ ПАМЯТНИКОВ */
.catalog-category-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.catalog-category-btn:hover {
    border-color: #9b59b6;
    background: #f3e5f5;
}

.catalog-category-btn.active {
    background: #9b59b6;
    color: white;
    border-color: #9b59b6;
}

.catalog-item {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.catalog-item:hover {
    border-color: #9b59b6;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.2);
}

.catalog-item.selected {
    border-color: #9b59b6;
    background: #f3e5f5;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.catalog-preview {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    overflow: hidden;
}

.catalog-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-name {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.catalog-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.catalog-price {
    font-size: 18px;
    color: #9b59b6;
    font-weight: bold;
}

.catalog-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.catalog-tag {
    background: #eef;
    color: #555;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}