/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #222230;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);

    --critical: #ff4757;
    --high: #ff8c42;
    --medium: #ffd93d;
    --low: #6bcb77;
    --info: #4d9de0;

    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Background Effects ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 0%, var(--bg-primary) 100%);
    pointer-events: none;
    z-index: -1;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-brand .logo {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

.github-link {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.3s ease;
}

.github-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
}

.hero-content {
    max-width: 800px;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* ===== Scanner Box ===== */
.scanner-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.scan-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 1.25rem;
    transition: border-color 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
}

.input-icon {
    font-size: 1.25rem;
    margin-right: 1rem;
}

.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 1rem 0;
    font-family: var(--font-main);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.scan-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    font-family: var(--font-main);
}

.scan-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.scan-button:active {
    transform: translateY(0);
}

.scan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.scan-button:hover .btn-icon {
    transform: translateX(4px);
}

.scan-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
}

.option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* ===== Scan Progress ===== */
.scan-progress {
    padding: 4rem 2rem;
}

.progress-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.current-check {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Results Section ===== */
.results-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h2 {
    font-size: 1.75rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s;
    font-family: var(--font-main);
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

/* ===== Summary Cards ===== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s;
}

.summary-card:hover {
    transform: translateY(-4px);
}

.summary-card.critical {
    border-color: var(--critical);
}

.summary-card.high {
    border-color: var(--high);
}

.summary-card.medium {
    border-color: var(--medium);
}

.summary-card.low {
    border-color: var(--low);
}

.summary-card.info {
    border-color: var(--info);
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.summary-card.critical .card-value {
    color: var(--critical);
}

.summary-card.high .card-value {
    color: var(--high);
}

.summary-card.medium .card-value {
    color: var(--medium);
}

.summary-card.low .card-value {
    color: var(--low);
}

.summary-card.info .card-value {
    color: var(--info);
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Scan Info Card ===== */
.scan-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.scan-info-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    word-break: break-all;
}

/* ===== Findings Section ===== */
.findings-section {
    margin-bottom: 2rem;
}

.findings-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.findings-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.filter-btn:hover {
    background: var(--bg-card-hover);
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.findings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.finding-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s;
}

.finding-card.critical {
    border-left: 4px solid var(--critical);
}

.finding-card.high {
    border-left: 4px solid var(--high);
}

.finding-card.medium {
    border-left: 4px solid var(--medium);
}

.finding-card.low {
    border-left: 4px solid var(--low);
}

.finding-card.info {
    border-left: 4px solid var(--info);
}

.finding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    cursor: pointer;
}

.finding-header:hover {
    background: var(--bg-card-hover);
}

.finding-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: rgba(255, 71, 87, 0.2);
    color: var(--critical);
}

.severity-badge.high {
    background: rgba(255, 140, 66, 0.2);
    color: var(--high);
}

.severity-badge.medium {
    background: rgba(255, 217, 61, 0.2);
    color: var(--medium);
}

.severity-badge.low {
    background: rgba(107, 203, 119, 0.2);
    color: var(--low);
}

.severity-badge.info {
    background: rgba(77, 157, 224, 0.2);
    color: var(--info);
}

.finding-name {
    font-weight: 600;
}

.finding-toggle {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.finding-card.open .finding-toggle {
    transform: rotate(180deg);
}

.finding-details {
    display: none;
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.finding-card.open .finding-details {
    display: block;
}

.detail-row {
    margin-top: 1rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.detail-value code {
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* ===== Pages Section ===== */
.pages-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.pages-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.page-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.page-icon {
    flex-shrink: 0;
}

.page-status {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.page-status.ok {
    background: rgba(107, 203, 119, 0.2);
    color: var(--low);
}

.page-status.error {
    background: rgba(255, 71, 87, 0.2);
    color: var(--critical);
}

.page-url {
    flex: 1;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Features Section ===== */
.features-section {
    padding: 6rem 2rem;
    text-align: center;
}

.features-section h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* ===== How It Works ===== */
.how-section {
    padding: 6rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
}

.how-section h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
}

.steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    text-align: center;
    max-width: 200px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.step-arrow {
    font-size: 2rem;
    color: var(--accent-primary);
}

/* ===== Footer ===== */
.footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.footer p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .scan-form {
        flex-direction: column;
    }

    .scan-options {
        gap: 1rem;
    }

    .step-arrow {
        display: none;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Port Scan Results */
.ports-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.ports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.port-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.port-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.port-card.critical {
    border-left: 3px solid #ef4444;
}

.port-card.high {
    border-left: 3px solid #f97316;
}

.port-card.medium {
    border-left: 3px solid #eab308;
}

.port-card.low {
    border-left: 3px solid #3b82f6;
}

.port-card.info {
    border-left: 3px solid #a8a29e;
}

.port-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.port-number {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.port-service {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.port-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.4;
}

.port-ip {
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.no-ports-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}