:root {
    --bg-color: #0F1219;
    --surface: #1E2230;
    --surface-glass: rgba(30, 34, 48, 0.6);
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --secondary: #818CF8;
    --accent: #F59E0B;
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --border: rgba(255, 255, 255, 0.1);
    --border-highlight: rgba(99, 102, 241, 0.5);
    
    --radius: 12px;
    --transition: 250ms ease;
    
    /* Severities */
    --sev-critical: #EF4444; /* Red */
    --sev-high: #F97316;     /* Orange */
    --sev-medium: #EAB308;   /* Yellow */
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Soft ambient background glow */
    background-image: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    background-repeat: no-repeat;
    min-height: 100vh;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header-titles h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.header-titles p {
    font-size: 0.875rem;
    color: var(--secondary);
    font-weight: 500;
}

.progress-section {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Add a little shine to the progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.glass-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

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

.glass-btn.danger:hover {
    border-color: var(--sev-critical);
    color: var(--sev-critical);
}

/* Main Content */
.checklist-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Accordion Item */
.owasp-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.owasp-item.completed {
    border-color: var(--border-highlight);
    background: rgba(30, 34, 48, 0.4);
}

.item-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.item-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Custom Checkbox */
.checkbox-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.checkbox-wrapper input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.custom-checkbox {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-wrapper input:checked + .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox::after {
    content: '';
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: var(--transition);
    margin-bottom: 2px;
}

.checkbox-wrapper input:checked + .custom-checkbox::after {
    opacity: 1;
}

.item-title-col {
    flex: 1;
}

.item-id {
    font-family: 'Fira Code', monospace;
    color: var(--secondary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    transition: color var(--transition);
}

.owasp-item.completed .item-title {
    color: var(--text-muted);
    text-decoration: line-through rgba(156, 163, 175, 0.5);
}

.item-badges {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255,255,255,0.05);
}

.sev-critical { color: var(--sev-critical); border: 1px solid rgba(239, 68, 68, 0.2); }
.sev-high     { color: var(--sev-high);     border: 1px solid rgba(249, 115, 22, 0.2); }
.sev-medium   { color: var(--sev-medium);   border: 1px solid rgba(234, 179, 8, 0.2); }

.chevron {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.owasp-item.expanded .chevron {
    transform: rotate(180deg);
}

/* Accordion Body */
.item-body {
    display: none;
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    animation: slideDown 0.3s ease;
}

.owasp-item.expanded .item-body {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section {
    margin-bottom: 1.5rem;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-section h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.content-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.content-section ul {
    list-style: none;
    color: var(--text-main);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.content-section ul li {
    position: relative;
    padding-left: 1.5rem;
}

.content-section ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Code Snippets */
pre {
    background: #0A0C10;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: #E2E8F0;
    margin-top: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

code {
    font-family: 'Fira Code', monospace;
}

/* Basic Syntax Highlighting for JS/HTML */
.token.keyword { color: #C678DD; } /* Purple */
.token.function { color: #61AFEF; } /* Blue */
.token.string { color: #98C379; } /* Green */
.token.comment { color: #5C6370; font-style: italic; } /* Gray */

/* Footer */
.app-footer {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .progress-section {
        width: 100%;
        max-width: none;
    }
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .item-badges {
        width: 100%;
        justify-content: space-between;
    }
    .chevron {
        display: none;
    }
}
