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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    background-color: #fafafa;
}

#graph {
    width: 100vw;
    height: 100vh;
}

.input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    padding: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 3000;
}

#claim-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

#claim-input:focus {
    border-color: #0070f3;
}

#submit-btn {
    padding: 12px 24px;
    background: #0070f3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

#submit-btn:hover:not(:disabled) {
    background: #0051cc;
}

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

#clear-btn {
    padding: 12px 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

#clear-btn:hover {
    background: #dc2626;
}

.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0070f3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.active {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.node circle, .node rect {
    stroke: #fff;
    stroke-width: 2px;
    cursor: pointer;
}

.node.critical circle, .node.critical rect {
    stroke: #fbbf24;
    stroke-width: 6px;
}

.node circle:hover, .node rect:hover {
    filter: brightness(0.85);
}

.node.selected circle {
    r: 25;
    stroke-width: 4px;
}

.node.selected rect {
    width: 35;
    height: 35;
    stroke-width: 4px;
}

.link {
    stroke-width: 4px;
    fill: none;
    cursor: pointer;
}

.link.premise {
    stroke: #60a5fa;
    stroke-opacity: 0.8;
}

.link.support {
    stroke: #22c55e;
    stroke-opacity: 0.8;
}

.link.attack {
    stroke: #ef4444;
    stroke-opacity: 0.8;
}

.link-arrow {
    fill: #22c55e;
}

.link-arrow.attack {
    fill: #ef4444;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    display: none;
    max-width: 300px;
    word-wrap: break-word;
    white-space: pre-wrap;
    z-index: 1000;
}

.side-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: calc(100vh - 140px);
    background: white;
    border-left: 1px solid #ddd;
    padding: 24px;
    transition: right 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.side-panel.open {
    right: 0;
}

.side-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.side-panel-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
}

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

.strength-display {
    font-size: 48px;
    font-weight: bold;
    color: #0070f3;
    margin-bottom: 8px;
}

.strength-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.criticality-display {
    font-size: 48px;
    font-weight: bold;
    color: #fbbf24;
    margin-bottom: 8px;
}

.criticality-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.metrics-row {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
}

.metric {
    flex: 1;
}

.argument-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 24px;
}

.incoming-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.incoming-header {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.claim-box {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-left: 3px solid #60a5fa;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.incoming-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #f5f5f5;
}

.incoming-item.support {
    border-left: 3px solid #22c55e;
}

.incoming-item.attack {
    border-left: 3px solid #ef4444;
}

.incoming-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.incoming-type {
    font-weight: 600;
    text-transform: uppercase;
}

.incoming-type.support {
    color: #22c55e;
}

.incoming-type.attack {
    color: #ef4444;
}

.incoming-relevance {
    color: #666;
}

.incoming-arg {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.incoming-reasoning {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.impact-control {
    margin-top: 24px;
}

.impact-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.impact-value {
    font-size: 24px;
    font-weight: bold;
    color: #0070f3;
    margin-bottom: 12px;
}

.impact-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 20px;
}

.impact-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0070f3;
    cursor: pointer;
}

.impact-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0070f3;
    cursor: pointer;
    border: none;
}

.delete-btn {
    width: 100%;
    padding: 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.delete-btn:hover {
    background: #dc2626;
}

.link-info {
    margin-bottom: 24px;
}

.link-type-label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.link-type-label.support {
    background: #dcfce7;
    color: #22c55e;
}

.link-type-label.attack {
    background: #fee2e2;
    color: #ef4444;
}

.link-nodes {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.link-reasoning {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 24px;
    z-index: 5000;
    display: none;
}

.info-panel.show {
    display: block;
}

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

.info-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.info-content {
    margin-bottom: 20px;
}

.info-content p {
    margin-bottom: 12px;
    color: #333;
}

.info-content ul.info-list {
    margin-left: 0;
    padding-left: 0;
    list-style: none;
    color: #666;
    line-height: 1.4;
}

.info-content li {
    margin-bottom: 4px;
    margin-left: 20px;
}

.info-content li:first-child,
.info-content li:nth-child(2),
.info-content li:nth-child(3) {
    list-style: disc;
}

.info-content li.edge-explanation,
.info-content li.shape-explanation {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin-left: 0;
}

.icon-box {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-close-x {
    font-size: 48px;
    width: 60px;
    height: 60px;
}
