:root {
    --primary: #6C5CE7;
    --secondary: #A29BFE;
    --accent: #FD79A8;
    --background: #0D0B1E;
    --glass-bg: rgba(13, 11, 30, 0.7);
    --glass-border: rgba(108, 92, 231, 0.25);

    --text-main: #f8fafc;
    --text-muted: #a1a1aa;

    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #ff7675;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 80% 10%, rgba(108, 92, 231, 0.15), transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(253, 121, 168, 0.1), transparent 40%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.mt-4 {
    margin-top: 2rem;
}

.hidden {
    display: none !important;
}

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

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Input Section */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: rgba(108, 92, 231, 0.2);
    color: var(--text-main);
    border-color: var(--primary);
}

textarea {
    width: 100%;
    height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #e2e8f0;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    margin-bottom: 1.5rem;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

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

.btn {
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn.small {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

.primary-btn:hover {
    background: #5a4bcf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.outline-btn:hover {
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.score-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.card-label {
    font-size: 0.85rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

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

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.highlight-success {
    color: var(--success);
}

.highlight-warning {
    color: var(--warning);
}

.highlight-danger {
    color: var(--danger);
}

/* Table */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

th {
    color: var(--secondary);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
}

th:first-child {
    border-top-left-radius: 8px;
}

th:last-child {
    border-top-right-radius: 8px;
}

td {
    color: var(--text-main);
}

.pkg-name {
    font-family: monospace;
    font-weight: 600;
    color: var(--secondary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.major {
    background: rgba(255, 118, 117, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 118, 117, 0.3);
}

.badge.minor {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.badge.patch {
    background: rgba(9, 132, 227, 0.15);
    color: #74b9ff;
    border: 1px solid rgba(9, 132, 227, 0.3);
}

.badge.fresh {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.risk-bar-container {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    margin-top: 4px;
}

.risk-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.risk-low {
    background: var(--success);
}

.risk-medium {
    background: var(--warning);
}

.risk-high {
    background: var(--danger);
}

/* Loading & Toast */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--danger);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .score-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .score-cards {
        grid-template-columns: 1fr;
    }
}