:root {
    --primary: #2a64ad;
    --primary-hover: #1e4b85;
    --bg-app: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --input-focus: #3b82f6;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --bg-app: #0f172a;
    --bg-sidebar: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

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

/* Sidebar Styling */
.sidebar {
    width: 380px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 10px 0 30px rgba(0,0,0,0.02);
}

.sidebar-header {
    margin-bottom: 2.5rem;
}

.sidebar-header h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.disclaimer {
    background: #fff7ed;
    color: #9a3412;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid #ffedd5;
    font-weight: 600;
    font-size: 0.75rem;
    margin: 0.5rem 0;
    display: inline-block;
}

[data-theme="dark"] .disclaimer {
    background: #431407;
    color: #fb923c;
    border-color: #7c2d12;
}

.read-more {
    display: block;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.read-more:hover {
    color: var(--primary-hover);
    transform: translateX(2px);
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid var(--border);
    background: var(--bg-app);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 40px;
    border-radius: 0.5rem;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
}

/* Actions */
.actions {
    margin-top: auto;
    padding-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(42, 100, 173, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(42, 100, 173, 0.3);
}

.btn-secondary {
    background: var(--bg-app);
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Preview Area */
.preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: center;
}

.label-container {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 100%;
}

.label-container:hover {
    transform: scale(1.02);
}

.label-svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Layout Utilities */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 1rem;
}

/* Checkbox Styling */
.checkbox-group {
    margin-bottom: 0.75rem !important;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    user-select: none;
    min-height: 1.25rem;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 1.25rem;
    width: 1.25rem;
    background-color: white;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #f1f5f9;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Pills Multi-select */
.pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pill {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    background: var(--bg-app);
    border: 1.5px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    color: var(--text-muted);
}

.pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(42, 100, 173, 0.2);
}

/* Status Messages */
.status-msg {
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.status-msg.visible {
    opacity: 1;
}

.status-msg.success {
    color: #10b981;
    background: #ecfdf5;
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    background: #f1f5f9;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.label-id {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.close-btn {
    background: white;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.close-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.modal-content {
    padding: 2rem;
    overflow-y: auto;
}

.modal-hero-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem; /* Reduced from 2rem */
    padding: 1.5rem 2.5rem; /* Reduced padding */
    background: #fff;
    min-height: 280px;
    overflow: hidden;
}

/* Technical Orange Accents */
.technical-item {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid #f97316; /* Orange */
    position: relative;
    margin-bottom: 0.75rem;
}

.cve-context.internal {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    display: table;
    margin-bottom: 0.5rem;
}

/* Stats Footer */
.stats-footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    border-top: 1px dashed var(--border);
    padding-top: 0.75rem;
}

/* Share Section */
.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    border-color: var(--accent);
    background: #f0f9ff;
    transform: translateY(-2px);
}

.share-icon {
    font-size: 1.5rem;
}

.share-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.hero-col {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-trustmark-v.large {
    width: 80%; /* Scaled down slightly */
    max-width: 320px;
    height: auto;
    filter: none; /* Remove shadow */
}

.product-preview {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
}

.product-img {
    height: 180px;
    width: auto;
    border-radius: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.detail-row.highlighting {
    color: var(--primary);
    font-weight: 700;
}

.detail-row .label {
    color: var(--text-muted);
    font-weight: 600;
}

.detail-row .value {
    color: var(--text-main);
    font-weight: 700;
}

.spec-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hygiene-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hygiene-item {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid #f1f5f9;
}

.hygiene-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.hygiene-item strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.hygiene-item p {
    font-size: 0.7rem;
    line-height: 1.3;
    margin: 0;
}

.openness-section {
    background: #f0f9ff;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #bae6fd;
}

.openness-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: #0369a1;
}

.openness-section p {
    font-size: 0.75rem;
    margin: 0.25rem 0;
    color: #075985;
}

.banner-link {
    color: #166534;
    font-weight: 700;
    text-decoration: underline;
    margin-left: 0.25rem;
}

.cve-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cve-item {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--primary);
}

.cve-item strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cve-item p {
    font-size: 0.8rem;
    margin: 0;
}

.cve-context {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    margin-bottom: 0.3rem;
}

.cve-context.this-product {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.cve-context.related-product {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.link-btn {
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    padding: 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-btn.primary-btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.highlight {
    color: var(--primary);
    font-weight: 800;
}

.status-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.status-banner.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.info-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.2s;
}

.info-card h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.cve-item {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid #ef4444;
}

.cve-id { font-weight: 700; font-size: 0.9rem; }

.tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.tag.high { background: #fee2e2; color: #b91c1c; }
.tag.patched { background: #dcfce7; color: #166534; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

.accreditations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    font-weight: 700;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.link-btn {
    text-align: center;
    background: white;
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-btn.primary-btn {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
    background: #f8fafc;
}

.manufacturer-declaration {
    background: #fff;
    border: 2px dashed var(--border);
    padding: 1.5rem;
    border-radius: 1rem;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-footer {
    padding: 2rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 60%;
}

.modal-trustmark-v {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 320px;
    }
}

@media (max-width: 850px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        height: auto;
        position: relative;
        padding: 1.5rem;
    }

    .preview {
        padding: 2rem 1rem;
        min-height: 100vh;
    }

    .label-container {
        padding: 1rem;
    }

    .modal-hero-split {
        flex-direction: column;
        padding: 1.5rem;
        min-height: auto;
    }

    .modal-trustmark-v.large {
        width: 100%;
        max-width: 280px;
    }

    .product-img {
        height: 140px;
    }
}

@media (max-width: 640px) {
    .modal-header {
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .close-btn {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .link-grid, .share-grid, .stats-grid {
        grid-template-columns: 1fr;
    }

    .hygiene-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.5rem 1rem;
    }
}

