:root {
    --primary: #10B981;
    --primary-dim: rgba(16, 185, 129, 0.15);
    --secondary: #6EE7B7;
    --accent: #F59E0B;
    --bg-dark: #0A1A12;
    --bg-panel: rgba(16, 25, 20, 0.7);
    --bg-panel-hover: rgba(20, 35, 28, 0.8);
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --border-color: rgba(16, 185, 129, 0.2);
    --border-radius: 12px;
    --danger: #EF4444;
    --warning: #F59E0B;
    --safe: #10B981;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(110, 231, 183, 0.05), transparent 25%);
}

.app-container {
    max-width: 1000px;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-dim);
    color: var(--primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.header-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Main Score Panel */
.main-score-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

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

.score-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    background: var(--primary-dim);
    color: var(--primary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.badge.danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.badge.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); border-color: rgba(245, 158, 11, 0.3); }
.badge.safe { background: rgba(16, 185, 129, 0.15); color: var(--safe); border-color: rgba(16, 185, 129, 0.3); }

.score-display {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--primary) 0%, transparent 0%);
    position: relative;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
    transition: background 1s ease-out;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: var(--bg-dark);
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.score-label {
    position: relative;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.score-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.fingerprint-hash {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    color: var(--secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    word-break: break-all;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.fingerprint-hash:hover {
    background: rgba(16, 185, 129, 0.1);
}

.score-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.card-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
    font-weight: 700;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.metric-count {
    margin-left: auto;
    background: var(--primary-dim);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.feature-content {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    flex-grow: 1;
}

/* Fonts specific */
.font-list-container {
    max-height: 200px;
    overflow-y: auto;
}

.font-list-container::-webkit-scrollbar {
    width: 6px;
}

.font-list-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.font-list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.font-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.font-list li {
    background: rgba(255,255,255,0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.loading-item {
    color: var(--text-muted);
    font-style: italic;
    background: none !important;
    border: none !important;
}

/* Canvas specific */
.canvas-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.preview-canvas {
    background: #fff;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    max-width: 100%;
    /* Keep the visual representation isolated */
}

/* Data Lists */
.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    color: var(--text-muted);
}

.data-value {
    color: var(--text-main);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.8rem;
    color: var(--secondary);
}

/* Mitigation */
.mitigation-panel {
    border-color: rgba(245, 158, 11, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: var(--accent);
}

.mitigation-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mitigation-item {
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.mitigation-item.critical { border-left-color: var(--danger); }
.mitigation-item.good { border-left-color: var(--safe); }

.mitigation-text h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.mitigation-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .score-display {
        flex-direction: column;
        text-align: center;
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .data-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .data-value {
        max-width: 100%;
        text-align: left;
    }
}
