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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', Arial, sans-serif;
    background: #ffffff;
    color: #000000;
    overflow: hidden;
    height: 100vh;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    color: #666;
}

.settings-section {
    padding: 12px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.segments-section,
.dots-section {
    display: flex;
    flex-direction: column;
}

#segments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    min-height: 40px;
}

.segment-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    background: #fafafa;
}

.segment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.segment-dots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 28px;
}

.dot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: #fff;
}

.dot-item:hover {
    background: #f9f9f9;
}

.segment-info,
.dot-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.segment-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.segment-name,
.dot-name {
    font-size: 14px;
    font-weight: 500;
}

.dot-size-indicator {
    display: inline-block;
    border-radius: 50%;
    background: #666;
    margin-right: 8px;
}

.dot-size-indicator.small {
    width: 6px;
    height: 6px;
}

.dot-size-indicator.medium {
    width: 10px;
    height: 10px;
}

.dot-size-indicator.large {
    width: 14px;
    height: 14px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    font-size: 14px;
}

.icon-btn:hover {
    color: #000;
}

.btn {
    padding: 10px 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.btn:hover:not(:disabled) {
    background: #ff7900;
    color: #000;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: #000;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #ff7900;
    color: #000;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin-left: 28px;
}

/* Radar Container */
.radar-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
    padding: 40px;
    overflow: hidden;
}

#radar-svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.radar-ring {
    fill: none;
    stroke-width: 1;
}

.radar-segment {
    fill-opacity: 0.03;
    stroke: #e0e0e0;
    stroke-width: 1;
}

.dot {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 2;
    transition: stroke-width 0.2s, filter 0.2s;
}

.dot:hover {
    stroke-width: 3;
}

.dot.selected {
    stroke-width: 4;
    filter: drop-shadow(0 0 6px currentColor);
    cursor: move;
}

.dot.new-dot {
    animation: pulse-glow 2s ease-out;
}

@keyframes pulse-glow {
    0% {
        stroke-width: 2;
        filter: drop-shadow(0 0 0 transparent);
    }
    15% {
        stroke-width: 6;
        filter: drop-shadow(0 0 8px currentColor);
    }
    30% {
        stroke-width: 2;
        filter: drop-shadow(0 0 4px currentColor);
    }
    45% {
        stroke-width: 6;
        filter: drop-shadow(0 0 8px currentColor);
    }
    60% {
        stroke-width: 2;
        filter: drop-shadow(0 0 4px currentColor);
    }
    100% {
        stroke-width: 2;
        filter: drop-shadow(0 0 0 transparent);
    }
}

.dot-label {
    font-size: 11px;
    fill: #000;
    pointer-events: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', Arial, sans-serif;
    font-weight: 400;
}

.dot-label-bg {
    fill: #fff;
    fill-opacity: 0.9;
    pointer-events: none;
}

.segment-label {
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 22px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', Arial, sans-serif;
    font-weight: 400;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.tooltip.hidden {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    min-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-content input[type="text"],
.modal-content input[type="color"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.modal-content input[type="color"] {
    height: 44px;
    cursor: pointer;
}

.size-selector {
    margin-bottom: 16px;
}

.size-selector > label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.segmented-control {
    display: inline-flex;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-right: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    transition: all 0.2s;
    user-select: none;
    margin: 0;
}

.segmented-control label:last-of-type {
    border-right: none;
}

.segmented-control label:hover {
    background: #f5f5f5;
}

.segmented-control input[type="radio"]:checked + label {
    background: #000;
    color: #fff;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Mobile Warning - hidden by default */
.mobile-warning {
    display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }

    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-top: 1px solid #e0e0e0;
        order: 2;
        padding: 16px;
        padding-bottom: 60px;
        gap: 24px;
    }

    .radar-container {
        order: 1;
        min-height: 60vh;
        height: 60vh;
        padding: 20px;
    }

    .sidebar h1 {
        font-size: 20px;
    }

    .sidebar h2 {
        font-size: 13px;
    }

    /* Make modals more mobile-friendly */
    .modal-content {
        min-width: 280px;
        max-width: 90vw;
        padding: 20px;
    }

    /* Adjust segment and dot containers for smaller screens */
    .segment-dots {
        margin-left: 20px;
    }

    .btn-small {
        margin-left: 20px;
    }

    /* Increase dot sizes for easier touch targets on mobile */
    .dot {
        stroke-width: 3;
    }

    .dot:hover {
        stroke-width: 4;
    }

    /* Make dot labels more visible on mobile */
    .dot-label {
        font-size: 13px;
    }

    /* Show mobile warning */
    .mobile-warning {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #ff7900;
        background: #fff4e6;
        text-align: center;
        line-height: 1.5;
        margin-top: 16px;
        margin-bottom: 40px;
        padding: 12px 16px;
        border-radius: 6px;
    }
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .sidebar {
        display: none !important;
    }

    .container {
        display: block;
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .radar-container {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        page-break-inside: avoid;
        page-break-after: avoid;
        page-break-before: avoid;
    }

    #radar-svg {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
    }

    /* Hide modals during print */
    .modal {
        display: none !important;
    }

    /* Hide tooltip during print */
    .tooltip {
        display: none !important;
    }
}
