/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2847;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f59e0b);
    --gradient-safe: linear-gradient(135deg, #10b981, #06b6d4);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 10px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* ===== Particles ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 50%;
    opacity: 0.3;
    animation: float linear infinite;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s;
}

.navbar.scrolled {
    padding: 10px 0;
    background: rgba(10, 14, 26, 0.95);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
}

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

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.hero-stats {
    display: flex;
    align-items: center;
    gap: 32px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* Shield Animation */
.hero-visual {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-animation {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shield-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring-1 {
    width: 100%;
    height: 100%;
    border-top-color: var(--accent-blue);
    border-right-color: rgba(59, 130, 246, 0.3);
    animation: spin 8s linear infinite;
}

.ring-2 {
    width: 80%;
    height: 80%;
    border-bottom-color: var(--accent-cyan);
    border-left-color: rgba(6, 182, 212, 0.3);
    animation: spin 6s linear infinite reverse;
}

.ring-3 {
    width: 60%;
    height: 60%;
    border-top-color: var(--accent-green);
    border-right-color: rgba(16, 185, 129, 0.3);
    animation: spin 4s linear infinite;
}

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

.shield-center {
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 60px rgba(59, 130, 246, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

.shield-center svg {
    width: 50px;
    height: 50px;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 60px rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 100px rgba(59, 130, 246, 0.6); }
}

/* ===== Section Header ===== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ===== Scanner Section ===== */
.scanner-section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.scanner-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.scanner-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 6px;
    transition: border-color 0.3s;
}

.scanner-input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-icon {
    padding: 12px 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

#urlInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.05rem;
    color: var(--text-primary);
    padding: 12px 8px;
    direction: ltr;
    text-align: right;
}

#urlInput::placeholder {
    color: var(--text-muted);
}

.scan-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.scan-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.quick-examples {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.quick-examples span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quick-examples button {
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: var(--accent-blue);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-examples button:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* ===== Loading ===== */
.loading-container {
    text-align: center;
    padding: 60px 0;
}

.scanner-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    position: relative;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    overflow: hidden;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.3), transparent);
    animation: scanMove 1.5s ease-in-out infinite;
    border-radius: 50% 50% 0 0;
}

@keyframes scanMove {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(100%); }
}

.scan-dots {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.scan-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}

.scan-dots span:nth-child(2) { animation-delay: 0.2s; }
.scan-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.loading-container p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== Results ===== */
.results-container {
    margin-top: 32px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.result-header.safe {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-header.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.result-header.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.8rem;
}

.safe .result-icon { background: rgba(16, 185, 129, 0.15); }
.warning .result-icon { background: rgba(245, 158, 11, 0.15); }
.danger .result-icon { background: rgba(239, 68, 68, 0.15); }

.result-title {
    flex: 1;
}

.result-title h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Score Circle */
.result-score {
    text-align: center;
    flex-shrink: 0;
}

.circular-chart {
    width: 80px;
    height: 80px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 3;
}

.circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.safe .circle { stroke: var(--accent-green); }
.warning .circle { stroke: var(--accent-yellow); }
.danger .circle { stroke: var(--accent-red); }

.percentage {
    fill: var(--text-primary);
    font-size: 0.55rem;
    font-weight: 700;
    text-anchor: middle;
    font-family: 'Tajawal', sans-serif;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Checks Grid */
.result-details {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}

.result-details h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.check-status {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.check-status.pass {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.check-status.fail {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.check-status.warn {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.check-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.check-text strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

/* Result Info */
.result-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.result-info h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.result-info ul {
    list-style: none;
    padding: 0;
}

.result-info li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.result-info li::before {
    content: '\2022';
    color: var(--accent-blue);
    font-weight: bold;
    flex-shrink: 0;
}

.scan-again {
    display: block;
    margin: 0 auto;
}

/* ===== Features Section ===== */
.features-section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
    background: var(--bg-card-hover);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: color-mix(in srgb, var(--accent, #3b82f6) 15%, transparent);
    color: var(--accent, #3b82f6);
}

.feature-icon svg {
    width: 26px;
    height: 26px;
}

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

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

/* ===== Tips Section ===== */
.tips-section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.tip-card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.3);
}

.tip-number {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.15;
    position: absolute;
    top: 10px;
    left: 20px;
    line-height: 1;
}

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

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

/* ===== Stats Section ===== */
.stats-section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
    padding: 60px 0 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 0.95rem;
    max-width: 350px;
}

.footer-links h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-links a {
    display: block;
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-bottom {
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .features-grid, .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu { display: flex; }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 14, 26, 0.98);
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 100px 24px 60px;
        gap: 40px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .shield-animation {
        width: 220px;
        height: 220px;
    }

    .shield-center {
        width: 80px;
        height: 80px;
    }

    .shield-center svg {
        width: 35px;
        height: 35px;
    }

    .features-grid, .tips-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .scanner-input-wrapper {
        flex-direction: column;
    }

    .scan-btn {
        width: 100%;
        justify-content: center;
    }

    #urlInput {
        text-align: center;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .checks-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        max-width: 100%;
    }

    .footer .logo {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }

    .hero-stat-divider {
        width: 40px;
        height: 1px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
