/* Legis Ledger MVP Styles */

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

:root {
    --color-primary: #2196F3;
    --color-success: #4CAF50;
    --color-warning: #FFC107;
    --color-error: #F44336;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #ddd;
    --color-bg: #f5f5f5;
    --spacing: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Header */
header {
    background: white;
    border-bottom: 3px solid var(--color-primary);
    padding: 2rem;
    text-align: center;
}

h1 {
    color: var(--color-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--color-text-light);
    font-size: 1.1rem;
}

/* Main Content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing);
}

/* Controls */
.controls {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.slider-container {
    margin-bottom: 1.5rem;
}

.slider-container label {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        #FFC107 0%, 
        #2196F3 50%, 
        #4CAF50 100%);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.summary {
    text-align: center;
    font-size: 1.2rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 4px;
}

/* Custom tooltip for funnel dots */
.custom-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.custom-tooltip.visible {
    opacity: 1;
}

.custom-tooltip strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.custom-tooltip .confidence {
    color: #4CAF50;
    font-weight: 600;
}

.custom-tooltip .grade {
    color: #2196F3;
    font-weight: 600;
}

/* Enhanced dot hover state */
.claim-dot:hover {
    r: 12;
    stroke-width: 4;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.credibility-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.credibility-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.credibility-item strong {
    color: #667eea;
    font-size: 1rem;
}

.credibility-item span {
    color: #666;
    font-size: 0.9rem;
}

.institutions-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    margin-top: 4rem;
}

.institutions-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.lead {
    text-align: center;
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    opacity: 0.95;
}

.institution-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.benefit {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.benefit h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.cta-section {
    text-align: center;
}

.btn-primary {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 1rem 3rem;
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cta-note {
    margin-top: 1rem;
    opacity: 0.8;
    font-size: 0.9rem;
}

.funnel-wrapper {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.funnel-wrapper svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.claim-dot {
    cursor: pointer;
    transition: r 0.2s, stroke-width 0.2s;
}

.claim-dot:hover {
    r: 12;
    stroke-width: 3;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .funnel-wrapper {
        padding: 1rem;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-expand {
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-expand:not([disabled]) {
    cursor: pointer;
    opacity: 1;
    background: #2196F3;
    color: white;
}

/* Claims */
.claims-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.claim {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.claim-header h3 {
    margin-bottom: 1rem;
    color: var(--color-text);
    font-size: 1.3rem;
}

.claim-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.claim-dot {
    cursor: pointer;
    transition: opacity 0.3s ease, r 0.2s ease, stroke-width 0.2s ease;
}

.claim-dot:hover {
    r: 12;
    stroke-width: 3;
}

/* Faded dots have different hover */
.claim-dot[style*="opacity: 0.2"]:hover {
    opacity: 0.5 !important; /* Slightly more visible on hover */
}

.grade {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.grade-aplus { background: #2E7D32; }
.grade-a { background: #4CAF50; }
.grade-b { background: #2196F3; }
.grade-c { background: #FFC107; color: #333; }
.grade-d { background: #FF9800; }

.confidence {
    padding: 0.25rem 0.75rem;
    background: var(--color-bg);
    border-radius: 4px;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.domain {
    padding: 0.25rem 0.75rem;
    background: var(--color-bg);
    border-radius: 4px;
    color: var(--color-text-light);
    font-size: 0.9rem;
    text-transform: capitalize;
}

.claim-actions {
    margin-top: 1rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1976D2;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
}

.empty-state .hint {
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

.loading, .error {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
}

.error {
    color: var(--color-error);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

footer a {
    color: var(--color-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .controls {
        padding: 1.5rem;
    }
    
    .claim {
        padding: 1rem;
    }
}