* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.toolbar {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    gap: 20px;
}

.file-upload {
    position: relative;
}

.upload-btn {
    display: inline-block;
    padding: 10px 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.toolbar-info {
    flex: 1;
    font-size: 14px;
    color: #666;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.svg-viewer {
    flex: 1;
    background: #fff;
    position: relative;
}

.file-input {
    display: none;
}

.btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}


#svg-container {
    padding: 20px;
    height: 100%;
    position: relative;
}

#svg-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    position: relative;
    background: #f8f9fa;
}

#svg-content {
    min-width: min-content;
    min-height: min-content;
    padding: 20px;
}

#svg-display {
    display: block;
    cursor: crosshair;
    transition: transform 0.2s ease;
    transform-origin: top left;
    max-width: none;
    height: auto;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.zoom-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.zoom-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.zoom-info {
    text-align: center;
    font-size: 12px;
    color: #666;
    padding: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    margin: 2px 0;
}

.clickable-mode #svg-display polygon,
.clickable-mode #svg-display rect,
.clickable-mode #svg-display path,
.clickable-mode #svg-display circle,
.clickable-mode #svg-display ellipse {
    cursor: pointer !important;
}

.marked-element {
    stroke: #28a745 !important;
    stroke-width: 3 !important;
    stroke-dasharray: 5,5 !important;
    animation: markedPulse 2s ease-in-out infinite !important;
}

.hover-element {
    stroke: #ffc107 !important;
    stroke-width: 2 !important;
    opacity: 0.8 !important;
    transition: all 0.2s ease !important;
}

@keyframes markedPulse {
    0%, 100% { stroke-opacity: 1; }
    50% { stroke-opacity: 0.5; }
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

.floor-input-tooltip {
    position: absolute;
    background: white;
    border: 2px solid #4facfe;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 2000;
    min-width: 200px;
}

.floor-input-tooltip input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.floor-input-tooltip .tooltip-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.floor-input-tooltip .tooltip-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.floor-input-tooltip .confirm-btn {
    background: #28a745;
    color: white;
}

.floor-input-tooltip .cancel-btn {
    background: #6c757d;
    color: white;
}