/*
 *     __ _ _ _   __  __ ____  __  __ 
 *    / _` | | |_|  \/  |  _ \|  \/  |
 *   | (_| | | __| |\/| | | | | |\/| |
 *    \__, |_|\__|_|  |_|_| |_|_|  |_|
 *    |___/ Compliance Without Backdoors
 *
 *    Because your security posture shouldn't 
 *    require the missionary position.
 */

:root {
    /* Original colors */
    --color-canvas-default: #ffffff;
    --color-canvas-subtle: #f6f8fa;
    --color-canvas-inset: #f0f3f6;
    --color-border-default: #d1d9e0;
    --color-border-muted: #d1d9e0b3;
    --color-fg-default: #1f2328;
    --color-fg-muted: #656d76;
    --color-fg-subtle: #6e7781;
    --color-fg-on-emphasis: #ffffff;
    --color-accent-fg: #0969da;
    --color-accent-emphasis: #0969da;
    --color-success-fg: #1a7f37;
    --color-success-emphasis: #2da44e;
    --color-success-subtle: #2da44e1a;
    --color-danger-fg: #d1242f;
    --color-danger-emphasis: #cf222e;
    --color-danger-subtle: #cf222e1a;
    --color-attention-fg: #9a6700;
    --color-attention-emphasis: #bf8700;
    --color-attention-subtle: #fff8c5;
    --color-neutral-emphasis: #6e7781;
    --color-neutral-subtle: #afb8c133;
    
    /* Funky additions */
    --funk-purple: #7c3aed;
    --funk-pink: #ec4899;
    --funk-gradient: linear-gradient(135deg, var(--funk-purple), var(--funk-pink));
    --shadow-small: 0 1px 0 rgba(31, 35, 40, 0.04);
    --shadow-medium: 0 3px 6px rgba(140, 149, 159, 0.15);
    --shadow-funk: 0 10px 40px rgba(124, 58, 237, 0.15);
}

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

body {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-fg-default);
    background: var(--color-canvas-default);
    position: relative;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(124, 58, 237, 0.01) 35px, rgba(124, 58, 237, 0.01) 70px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* Page Header with funk */
.page-header {
    border-bottom: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--funk-gradient) border-box;
    padding-bottom: 16px;
    margin-bottom: 24px;
    position: relative;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--funk-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.page-subtitle {
    color: var(--color-fg-muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-style: italic;
}

/* Stats with pop */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--color-canvas-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-funk);
    border-color: var(--funk-purple);
}

.stat-card:hover::before {
    left: 100%;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 11px;
    color: var(--color-fg-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value.success { 
    color: var(--color-success-emphasis);
    text-shadow: 0 0 20px rgba(45, 164, 78, 0.3);
}

.stat-value.warning { 
    color: var(--color-attention-emphasis);
    text-shadow: 0 0 20px rgba(191, 135, 0, 0.3);
}

.stat-value.danger { 
    color: var(--color-danger-emphasis);
    text-shadow: 0 0 20px rgba(207, 34, 46, 0.3);
}

.stat-value.neutral { color: var(--color-neutral-emphasis); }

/* Controls with style */
.controls-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 2px solid var(--color-border-default);
    border-radius: 8px;
    font-size: 14px;
    background: var(--color-canvas-default);
    transition: all 0.2s;
    font-family: 'SF Mono', Monaco, monospace;
}

.search-input:focus {
    outline: none;
    border-color: var(--funk-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    transform: translateX(2px);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-fg-muted);
    pointer-events: none;
}

.filter-tabs {
    display: flex;
    background: var(--color-canvas-subtle);
    border: 2px solid var(--color-border-default);
    border-radius: 8px;
    overflow: hidden;
}

.filter-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--color-fg-default);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-family: 'SF Mono', Monaco, monospace;
}

.filter-tab:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--color-border-default);
}

.filter-tab:hover {
    background: rgba(124, 58, 237, 0.05);
}

.filter-tab.active {
    background: var(--funk-gradient);
    color: var(--color-fg-on-emphasis);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.filter-tab.active::after { display: none; }

/* Table with personality */
.devices-table {
    background: var(--color-canvas-default);
    border: 2px solid var(--color-border-default);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--color-canvas-subtle);
    border-bottom: 2px solid var(--color-border-default);
}

th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 11px;
    color: var(--funk-purple);
    text-transform: uppercase;
    letter-spacing: 1px;
}

tbody tr {
    border-bottom: 1px solid var(--color-border-muted);
    transition: all 0.2s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(124, 58, 237, 0.03) 50%, 
        transparent 100%);
    transform: translateX(2px);
}

td {
    padding: 14px 16px;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, monospace;
}

.device-link {
    color: var(--funk-purple);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.device-link:hover {
    color: var(--funk-pink);
    transform: translateX(2px);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 3px;
}

.os-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--color-neutral-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: 20px;
    font-size: 11px;
    color: var(--color-fg-muted);
    font-weight: 600;
}

.compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.compliance-badge.excellent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.compliance-badge.good {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.compliance-badge.fair {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.compliance-badge.poor {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.compliance-badge.checking {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    animation: rotate 2s linear infinite;
}

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

.time-ago {
    color: var(--color-fg-muted);
    font-size: 11px;
    font-style: italic;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--color-fg-muted);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.2;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--funk-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state-description {
    max-width: 400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--funk-gradient) border-box;
}

.pagination-btn {
    padding: 8px 16px;
    border: 2px solid var(--color-border-default);
    border-radius: 8px;
    background: var(--color-canvas-default);
    color: var(--color-fg-default);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: 'SF Mono', Monaco, monospace;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--funk-gradient);
    color: white;
    border-color: var(--funk-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.pagination-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: var(--color-fg-muted);
}

.pagination-info {
    color: var(--color-fg-muted);
    font-size: 13px;
    font-weight: 600;
    margin: 0 16px;
}

/* ASCII art header (hidden but fun) */
.ascii-header {
    display: none;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1;
    color: var(--funk-purple);
    opacity: 0.1;
    white-space: pre;
    position: absolute;
    top: 10px;
    right: 10px;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 16px; }
    .page-title { font-size: 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .controls-bar { flex-direction: column; align-items: stretch; }
    .search-box { width: 100%; }
    .table-wrapper { margin: 0 -16px; width: calc(100% + 32px); }
    th, td { padding: 10px 12px; font-size: 12px; }
    .os-badge { display: none; }
}