/* ==========================================
   ShieldMyRepo — Design System
   Premium dark theme with glassmorphism
   ========================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --green: #22c55e;
    --green-glow: rgba(34, 197, 94, 0.15);
    --yellow: #eab308;
    --yellow-glow: rgba(234, 179, 8, 0.15);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.15);
    --orange: #f97316;
    --blue: #3b82f6;
    --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --gradient-text: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
    --radius: 12px;
    --radius-lg: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   Navigation
   ========================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-github {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.nav-github:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

/* ==========================================
   Hero Section
   ========================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 28px;
    animation: fade-in-up 0.6s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    animation: fade-in-up 0.6s ease 0.1s both;
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
    animation: fade-in-up 0.6s ease 0.2s both;
}

.grade {
    display: inline-block;
    font-weight: 800;
    font-size: 1rem;
    padding: 1px 8px;
    border-radius: 4px;
    font-family: var(--mono);
}

.grade-a { background: var(--green-glow); color: var(--green); }
.grade-f { background: var(--red-glow); color: var(--red); }

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Scanner Input
   ========================================== */

.scanner-box {
    animation: fade-in-up 0.6s ease 0.3s both;
}

.scanner-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 6px 6px 18px;
    gap: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
    max-width: 600px;
    margin: 0 auto;
}

.scanner-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.scanner-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.scanner-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--mono);
    font-size: 0.9rem;
    min-width: 0;
}

.scanner-input::placeholder {
    color: var(--text-muted);
    font-family: var(--font);
}

.scan-btn {
    flex-shrink: 0;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font);
}

.scan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.scan-btn:active {
    transform: translateY(0);
}

.scan-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

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

.scanner-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.error-msg {
    max-width: 600px;
    margin: 16px auto 0;
    padding: 12px 16px;
    background: var(--red-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--red);
    font-size: 0.9rem;
    text-align: left;
}

/* ==========================================
   Floating Cards
   ========================================== */

.floating-cards {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-card {
    position: absolute;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    animation: float 8s ease-in-out infinite;
    opacity: 0.5;
}

.card-1 { top: 20%; left: 5%; animation-delay: 0s; }
.card-2 { top: 35%; right: 5%; animation-delay: 2s; }
.card-3 { bottom: 30%; left: 8%; animation-delay: 4s; }
.card-4 { bottom: 20%; right: 8%; animation-delay: 6s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-12px) rotate(1deg); }
    75% { transform: translateY(8px) rotate(-1deg); }
}

/* ==========================================
   Results Section
   ========================================== */

.results-section {
    padding: 60px 24px 100px;
    animation: fade-in-up 0.5s ease;
}

.results-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Grade Display */
.grade-display {
    display: flex;
    align-items: center;
    gap: 32px;
    justify-content: center;
    margin-bottom: 48px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    animation: scale-in 0.5s ease;
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.grade-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid;
    position: relative;
    flex-shrink: 0;
}

.grade-circle.grade-A { border-color: var(--green); box-shadow: 0 0 40px var(--green-glow); background: rgba(34, 197, 94, 0.05); }
.grade-circle.grade-B { border-color: var(--blue); box-shadow: 0 0 40px rgba(59, 130, 246, 0.15); background: rgba(59, 130, 246, 0.05); }
.grade-circle.grade-C { border-color: var(--yellow); box-shadow: 0 0 40px var(--yellow-glow); background: rgba(234, 179, 8, 0.05); }
.grade-circle.grade-D { border-color: var(--orange); box-shadow: 0 0 40px rgba(249, 115, 22, 0.15); background: rgba(249, 115, 22, 0.05); }
.grade-circle.grade-F { border-color: var(--red); box-shadow: 0 0 40px var(--red-glow); background: rgba(239, 68, 68, 0.05); }

.grade-letter {
    font-size: 2.8rem;
    font-weight: 800;
    font-family: var(--mono);
    line-height: 1;
}

.grade-circle.grade-A .grade-letter { color: var(--green); }
.grade-circle.grade-B .grade-letter { color: var(--blue); }
.grade-circle.grade-C .grade-letter { color: var(--yellow); }
.grade-circle.grade-D .grade-letter { color: var(--orange); }
.grade-circle.grade-F .grade-letter { color: var(--red); }

.grade-score {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.grade-info h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.grade-repo {
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 0.9rem;
}

/* Results Table */
.results-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.results-table th {
    text-align: left;
    padding: 16px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.results-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tr {
    transition: background 0.2s;
}

.results-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.status-pass { color: var(--green); font-weight: 600; }
.status-warn { color: var(--yellow); font-weight: 600; }
.status-fail { color: var(--red); font-weight: 600; }

/* Findings Detail */
.findings-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.finding-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.finding-group-header {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.finding-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.finding-item:last-child {
    border-bottom: none;
}

.finding-severity {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--mono);
    margin-right: 8px;
}

.severity-critical { background: var(--red-glow); color: var(--red); }
.severity-high { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.severity-medium { background: var(--yellow-glow); color: var(--yellow); }
.severity-low { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.severity-info { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.finding-message {
    color: var(--text-primary);
}

.finding-file {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
}

.finding-recommendation {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 12px;
    border-left: 2px solid var(--border);
    margin-top: 4px;
}

.scan-again-btn {
    display: block;
    margin: 40px auto 0;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.scan-again-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* ==========================================
   Features Grid
   ========================================== */

.features {
    padding: 100px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 56px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==========================================
   CTA Section
   ========================================== */

.cta {
    text-align: center;
    padding: 80px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.cta h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.cta-code {
    display: inline-block;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 28px;
    margin-bottom: 32px;
}

.cta-code code {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--accent);
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--font);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

/* ==========================================
   Footer
   ========================================== */

.footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .nav-links a:not(.nav-github) { display: none; }
    .hero-title { font-size: 2rem; }
    .scanner-input-wrapper { flex-direction: column; padding: 12px; }
    .scanner-input { width: 100%; text-align: center; padding: 8px; }
    .scan-btn { width: 100%; }
    .grade-display { flex-direction: column; text-align: center; gap: 20px; }
    .floating-cards { display: none; }
    .features-grid { grid-template-columns: 1fr; }
}
