/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #141126 0%, #241c4d 50%, #141126 100%);
    min-height: 100vh;
    color: #e8eaed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(100, 181, 246, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8b5cf6;
    text-decoration: none;
    letter-spacing: 1px;
    font-family: 'Lexend Peta', sans-serif;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.request-audit-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.3);
}

.request-audit-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 181, 246, 0.4);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 6.5rem; /* Account for fixed navbar */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero */
.hero {
    position: relative;
    text-align: center;
    padding: 4.5rem 0 2.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden; /* contain visual effects */
}

.hero::before {
    content: '';
    position: absolute;
    inset: -20px 0 auto 0;
    height: 240px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.35), rgba(139, 92, 246, 0) 60%);
    filter: blur(20px);
    pointer-events: none;
}

/* Enhanced hero heading effects */
.header-content { position: relative; }

.header-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #c4b5fd, #a78bfa, #8b5cf6, #a78bfa, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 22px rgba(139, 92, 246, 0.35);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-transform: uppercase;
    background-size: 200% 100%;
    animation: headingGradient 3s ease-in-out infinite;
    position: relative;
}

.header-content h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0), rgba(255,255,255,0.28), rgba(255,255,255,0));
    transform: skewX(-20deg);
    filter: blur(0.5px);
    animation: shineSweep 6s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -40px;
    transform: translateX(-50%);
    width: 120%;
    height: 220px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0) 65%);
    filter: blur(30px);
    opacity: 0.7;
    animation: breathe 8s ease-in-out infinite;
    pointer-events: none;
}

.header-content p {
    font-size: 1.2rem;
    color: #b0bec5;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.5;
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    flex: 1; /* Grow to push footer to bottom */
}

/* Scanner Form */
.scanner-form {
    max-width: 700px;
    margin: 0 auto 2rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #e8eaed;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    border-radius: 8px;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.scan-button {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.3);
}

.scan-button:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 181, 246, 0.4);
}

.audit-message {
    margin-top: 1.5rem;
    text-align: center;
}

.audit-message p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
}

.audit-message a {
    color: #b794f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.audit-message a:hover {
    color: #9f7aea;
    text-decoration: underline;
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(26, 26, 26, 0.9);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* New animations */
@keyframes headingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shineSweep {
    0% { left: -30%; }
    60% { left: 130%; }
    100% { left: 130%; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.85; transform: translateX(-50%) scale(1.05); }
}

.loading-section h3 {
    color: #e8eaed;
    margin: 1.5rem 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.loading-section p {
    color: #b0bec5;
    margin: 0 0 2rem;
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Results Section */
.results-section {
    background: rgba(26, 26, 26, 0.9);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 2rem 0;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 2rem;
}

.results-header h2 {
    color: #e8eaed;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.new-scan-button {
    background: linear-gradient(135deg, #34c759, #30b04a);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3);
}

.new-scan-button:hover {
    background: linear-gradient(135deg, #30b04a, #2a9d3f);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.summary-card.danger { background: rgba(255, 59, 48, 0.1); color: #ff3b30; border-color: rgba(255, 59, 48, 0.3); }
.summary-card.warning { background: rgba(255, 149, 0, 0.1); color: #ff9500; border-color: rgba(255, 149, 0, 0.3); }
.summary-card.success { background: rgba(52, 199, 89, 0.1); color: #34c759; border-color: rgba(52, 199, 89, 0.3); }
.summary-card.info { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; border-color: rgba(139, 92, 246, 0.3); }

.card-content h3 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.card-content p { font-size: 0.9rem; opacity: 0.9; font-weight: 500; }

/* Tabs */
.results-tabs {
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: sticky;
    top: 72px;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(8px);
    padding: 0.5rem 2rem;
    z-index: 5;
}

.tab-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #b0bec5;
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-button.active {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.3);
}

.tab-button:hover { background: rgba(255, 255, 255, 0.1); color: #e8eaed; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Tab content wrapper */
.tab-content { padding: 0 2rem 1.5rem; }

/* Results List */
.results-list { max-height: 500px; overflow-y: auto; }

.result-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.result-item:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }

.result-item.malware { border-color: rgba(255, 59, 48, 0.3); background: rgba(255, 59, 48, 0.05); }
.result-item.suspicious { border-color: rgba(255, 149, 0, 0.3); background: rgba(255, 149, 0, 0.05); }
.result-item.clean { border-color: rgba(52, 199, 89, 0.3); background: rgba(52, 199, 89, 0.05); }

.result-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }

.package-name { font-size: 1.2rem; font-weight: 700; color: #e8eaed; margin-bottom: 0.5rem; }

.package-version { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; display: inline-block; }

.package-file { color: #94a3b8; font-size: 0.9rem; margin-top: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }

.result-reason { padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.result-reason.malware { background: rgba(255, 59, 48, 0.2); color: #ff3b30; }
.result-reason.suspicious { background: rgba(255, 149, 0, 0.2); color: #ff9500; }
.result-reason.clean { background: rgba(52, 199, 89, 0.2); color: #34c759; }

/* Raw Output */
.raw-output {
    background: #1a1a1a;
    color: #e8eaed;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Error Section */
.error-section {
    background: rgba(26, 26, 26, 0.9);
    border: 2px solid rgba(255, 59, 48, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.error-content h3 { color: #e8eaed; font-size: 1.5rem; margin-bottom: 1rem; font-weight: 600; }
.error-content p { color: #b0bec5; font-size: 1rem; margin-bottom: 1.5rem; }

.retry-button {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.3);
}

.retry-button:hover { background: linear-gradient(135deg, #7c3aed, #6d28d9); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4); }

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    margin-top: 3rem;
}

.footer p { margin: 0; font-weight: 400; }
.footer a { color: #b794f6; text-decoration: none; transition: color 0.3s ease; }
.footer a:hover { color: #9f7aea; text-decoration: underline; }

/* Responsive Design */
@media (max-width: 768px) {
    .container { padding: 1rem; padding-top: 5rem; }
    .header-content h1 { font-size: 2.5rem; }
    .header-content p { font-size: 1rem; }
    .main-content { padding: 2rem 1rem; }
    .search-container { flex-direction: column; gap: 0.75rem; }
    .search-input { padding: 0.75rem 1rem; }
    .scan-button { width: 100%; padding: 0.75rem 1rem; }
    .summary-cards { grid-template-columns: 1fr; gap: 1rem; }
    .results-header { flex-direction: column; align-items: stretch; gap: 1rem; }
    .new-scan-button { width: 100%; }
    .results-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .tab-button { flex-shrink: 0; padding: 0.75rem 1rem; }
}

@media (max-width: 480px) {
    .header-content h1 { font-size: 2rem; }
    .nav-container { padding: 0 1rem; }
    .main-content { padding: 1.5rem 1rem; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.5s ease-out; }

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.5); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.7); }


