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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.intro {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.intro h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.upload-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.divider {
    color: #999;
    font-weight: 500;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
    font-size: 18px;
    padding: 15px 30px;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-add {
    background-color: #dc3545;
    color: white;
    margin-top: 15px;
}

.btn-add:hover {
    background-color: #c82333;
}

.btn-copy {
    background-color: #17a2b8;
    color: white;
    margin-top: 15px;
}

.btn-copy:hover {
    background-color: #138496;
}

.editor-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.canvas-wrapper {
    margin-bottom: 30px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

#image-map-canvas {
    position: relative;
    display: inline-block;
    width: 100%;
}

#preview-image {
    max-width: 100%;
    display: block;
    user-select: none;
}

#overlay-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#overlay-svg polygon,
#overlay-svg rect,
#overlay-svg circle {
    pointer-events: all;
    cursor: move;
}

.controls-section {
    margin-bottom: 30px;
}

.controls-section h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.area-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

.area-table thead {
    background-color: #667eea;
    color: white;
}

.area-table th,
.area-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.area-table tbody tr:hover {
    background-color: #f8f9fa;
}

.area-table input[type="text"],
.area-table select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.area-table input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-delete:hover {
    background-color: #c82333;
}

.code-output-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.code-header h3 {
    color: #667eea;
    margin: 0;
}

.code-header .btn-copy {
    margin-top: 0;
    padding: 10px 20px;
    font-size: 14px;
}

.code-help-text {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #667eea;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.url-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.url-input:focus {
    outline: none;
    border-color: #667eea;
}

.help-text {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

#generated-code {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background-color: #f8f9fa;
}

footer {
    background-color: #2d3748;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

footer p {
    margin: 5px 0;
}

.company-description {
    font-size: 1em;
    font-weight: 500;
    margin: 10px 0 !important;
    color: #a0aec0;
}

.disclaimer {
    font-size: 0.9em;
    opacity: 0.8;
}

.contact-info {
    margin-top: 15px;
}

.contact-info a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.contact-info a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* SVG 스타일 */
.shape {
    fill: rgba(102, 126, 234, 0.3);
    stroke: #667eea;
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shape:hover {
    fill: rgba(102, 126, 234, 0.5);
    stroke-width: 3;
}

.shape.active {
    fill: rgba(40, 167, 69, 0.3);
    stroke: #28a745;
    stroke-width: 3;
}

.shape.active:hover {
    fill: rgba(40, 167, 69, 0.5);
}

.point {
    fill: white;
    stroke: #667eea;
    stroke-width: 2;
    cursor: pointer;
}

.point:hover {
    fill: #667eea;
}

/* 반응형 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .upload-section {
        flex-direction: column;
        align-items: stretch;
    }

    .divider {
        text-align: center;
    }

    .area-table {
        font-size: 14px;
    }

    .area-table th,
    .area-table td {
        padding: 8px;
    }
}
