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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

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

.header p {
    opacity: 0.9;
    font-size: 0.95em;
}

.form-section {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.results-section {
    padding: 30px;
    display: none;
}

.results-section.active {
    display: block;
}

.loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.result-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.result-card h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.2em;
}

.path-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.path-item .path-label {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 5px;
}

.path-item .path-details {
    color: #666;
    font-size: 0.9em;
}

.no-path {
    background: #fff3cd;
    border-left-color: #ffc107;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.no-path .icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.no-path h3 {
    color: #856404;
    margin-bottom: 10px;
}

.info-list {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
}

.info-list ul {
    list-style: none;
    padding: 0;
}

.info-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list li::before {
    content: "✓ ";
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

.summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.summary h2 {
    margin-bottom: 10px;
}

.summary .count {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.graph-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.graph-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 0.85em;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.legend-line {
    width: 30px;
    height: 0;
    border-top: 3px solid #ffd43b;
    flex-shrink: 0;
}

/* Paths visualization */
.paths-visualization {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.paths-visualization h3 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.2em;
}

.path-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 1.1em;
}

.path-user {
    font-weight: 600;
    color: #333;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 4px;
}

.path-arrow {
    color: #667eea;
    font-size: 1.5em;
    font-weight: bold;
}

/* Users grid - 2 columns */
.users-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.users-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid;
}

.users-column.trusted-column {
    border-left-color: #51cf66;
}

.users-column.stranger-column {
    border-left-color: #ff6b6b;
}

.users-column h3 {
    margin-bottom: 15px;
    font-size: 1.2em;
}

.trusted-column h3 {
    color: #51cf66;
}

.stranger-column h3 {
    color: #ff6b6b;
}

/* User cards */
.user-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.user-card.stranger-card {
    border-left: 4px solid #ff6b6b;
}

.user-card:not(.stranger-card) {
    border-left: 4px solid #51cf66;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.card-name-section {
    flex: 1;
}

.card-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.card-id {
    font-size: 0.9em;
    color: #666;
    font-family: monospace;
}

.card-description {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.5;
}

.card-desc-text {
    margin: 0;
}

.card-see-more {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 5px 0;
    font-size: 0.9em;
    text-decoration: underline;
    margin-top: 5px;
}

.card-see-more:hover {
    color: #764ba2;
}

.card-geo,
.card-pubkey {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-geo:last-child,
.card-pubkey:last-child {
    margin-bottom: 0;
}

.card-pubkey code {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Path sections with horizontal scrolling */
.path-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ff6b6b;
}

.path-section-header {
    margin-bottom: 15px;
}

.path-section-header h4 {
    color: #ff6b6b;
    font-size: 1.1em;
    margin: 0;
}

.path-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.path-cards-wrapper {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
    flex: 1;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.path-cards-wrapper::-webkit-scrollbar {
    height: 8px;
}

.path-cards-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.path-cards-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.path-cards-wrapper::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.scroll-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.scroll-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.scroll-btn:active {
    transform: scale(0.95);
}

.scroll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Path cards */
.path-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    min-width: 280px;
    max-width: 280px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.path-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.path-card.trusted-card {
    border-left: 4px solid #51cf66;
}

.path-card.certifier-card {
    border-left: 4px solid #ffd43b;
}

.path-card.stranger-path-card {
    border-left: 4px solid #ff6b6b;
}

.path-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 8px;
}

.path-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    margin-bottom: 8px;
}

.path-card-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    padding: 0;
}

.path-card-id {
    font-size: 1em;
    color: #555;
    font-family: monospace;
    word-break: break-all;
    font-weight: 500;
}

.path-card-desc {
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.path-card-geo {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.path-arrow-card {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: #667eea;
    font-weight: bold;
    min-width: 40px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .path-card {
        min-width: 240px;
        max-width: 240px;
    }
    
    .scroll-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}