/* Simple, Clean Design for Better Understanding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a0000 100%);
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 80px; /* Space for fixed progress indicator */
    padding-bottom: 140px; /* Increased space for fixed navigation and footer */
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 0, 0, 0.1);
    border-bottom: 3px solid #ff0000;
}

.header h1 {
    font-size: 2.5rem;
    color: #ff0000;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: #ff9999;
    font-weight: normal;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px); /* Adjusted for fixed elements */
}

/* Steps */
.step {
    display: none;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

/* Network Visualization */
.network-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.3);
}

.network-image {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.9;
    transition: all 0.3s ease;
    animation: networkPulse 4s ease-in-out infinite;
}

.network-image:hover {
    opacity: 1;
}

.network-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(255,255,255,0.95));
    color: #333333;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 0, 0, 0.2);
}

.network-overlay h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    color: #ff0000;
    font-weight: bold;
}

.network-overlay p {
    font-size: 0.9rem;
    color: #666666;
    line-height: 1.4;
}

/* Global Particles Container */
.global-particles-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff0000;
    border-radius: 50%;
    opacity: 0.6;
    animation: floatParticle 10s infinite linear;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

.particle:nth-child(2n) {
    background: #ff3333;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
    animation-duration: 12s;
    width: 3px;
    height: 3px;
}

.particle:nth-child(3n) {
    background: #ff6666;
    box-shadow: 0 0 6px rgba(255, 102, 102, 0.5);
    animation-duration: 8s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(4n) {
    background: #cc0000;
    box-shadow: 0 0 10px rgba(204, 0, 0, 0.7);
    animation-duration: 14s;
    width: 2px;
    height: 2px;
}

.particle:nth-child(5n) {
    background: #ff9999;
    box-shadow: 0 0 4px rgba(255, 153, 153, 0.4);
    animation-duration: 9s;
    width: 3px;
    height: 3px;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes networkPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(0.9);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

.step.active {
    display: block;
}

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

.step-header {
    text-align: center;
    margin-bottom: 3rem;
}

.step-header h2 {
    font-size: 2.2rem;
    color: #ff0000;
    margin-bottom: 1rem;
}

.simple-explanation {
    font-size: 1.3rem;
    color: #ff9999;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* Visualizations */
.visualization {
    margin-bottom: 3rem;
}

/* Step 1: Internet */
.internet-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.website-card {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.website-card:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.2);
}

.website-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.website-card h3 {
    font-size: 1.4rem;
    color: #ff6666;
    margin-bottom: 0.5rem;
}

.website-card p {
    color: #cccccc;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.links-out {
    font-size: 0.9rem;
    color: #ff9999;
    font-style: italic;
}

/* Step 2: Crawler */
.crawler-demo {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.crawler-robot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 250px;
}

.robot-head {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: robotFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px #ff0000);
}

.robot-body {
    text-align: center;
}

.robot-name {
    font-size: 1.8rem;
    color: #ff0000;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.robot-status {
    color: #ff9999;
    font-size: 1.1rem;
}

.what-crawler-does {
    flex: 2;
    min-width: 300px;
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    padding: 2rem;
}

.what-crawler-does h4 {
    color: #ff0000;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.crawler-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
}

.task-icon {
    font-size: 1.5rem;
}

.task-text {
    color: #ffffff;
    font-size: 1.1rem;
}

@keyframes robotFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* Step 3: Crawling */
.crawling-demo {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.pages-being-crawled {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(100, 100, 100, 0.2);
    border: 2px solid #666;
    border-radius: 10px;
    transition: all 0.5s ease;
}

.page-item.crawling {
    background: rgba(255, 165, 0, 0.2);
    border-color: #ffa500;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.3);
}

.page-item.crawled {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.page-icon {
    font-size: 2rem;
}

.page-info h4 {
    color: #ffffff;
    margin-bottom: 0.3rem;
}

.page-info p {
    color: #cccccc;
    margin-bottom: 0.5rem;
}

.page-status {
    font-size: 0.9rem;
    color: #ff9999;
    font-weight: bold;
}

.page-item.crawling .page-status {
    color: #ffa500;
}

.page-item.crawled .page-status {
    color: #00ff00;
}

.crawl-info {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    padding: 2rem;
}

.crawl-info h4 {
    color: #ff0000;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.crawl-data {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 5px;
}

.label {
    color: #ff9999;
    font-weight: bold;
}

.value {
    color: #ffffff;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

.crawl-progress {
    margin-top: 2rem;
}

.progress-text {
    color: #ff6666;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.progress-bar {
    background: rgba(100, 100, 100, 0.3);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #ff0000, #ff6666);
    height: 100%;
    width: 0%;
    transition: width 0.8s ease;
    border-radius: 10px;
}

/* Step 4: Indexing */
.indexing-demo {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.processing-zone {
    flex: 1;
    min-width: 250px;
}

.processing-zone h4 {
    color: #ff0000;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.processing-list {
    background: rgba(255, 0, 0, 0.05);
    border: 2px dashed rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    min-height: 200px;
}

.processing-item {
    background: rgba(255, 165, 0, 0.2);
    border: 1px solid #ffa500;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    animation: processing 2s ease-in-out;
}

.processing-item h5 {
    color: #ffa500;
    margin-bottom: 0.3rem;
}

.processing-item p {
    color: #ffffff;
    font-size: 0.9rem;
}

.arrow-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.arrow {
    font-size: 2rem;
    color: #ff0000;
    animation: arrowPulse 2s ease-in-out infinite;
}

.arrow-text {
    color: #ff6666;
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.index-library {
    flex: 2;
    min-width: 300px;
}

.index-library h4 {
    color: #ff0000;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.library-shelves {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.shelf {
    background: linear-gradient(135deg, #1a0000, #330000);
    border: 2px solid #ff0000;
    border-radius: 10px;
    padding: 1rem;
    min-height: 120px;
}

.shelf-label {
    color: #ff0000;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.shelf-books {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.indexed-book {
    background: rgba(255, 0, 0, 0.3);
    border-radius: 3px;
    padding: 0.3rem;
    font-size: 0.7rem;
    color: #ffffff;
    animation: bookAppear 0.5s ease-out;
}

.index-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.stat-label {
    color: #ff9999;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Step 5: Search */
.search-demo {
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
}

.search-box input {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    font-size: 1.1rem;
    background: transparent;
    color: #333;
    outline: none;
}

.search-box input::placeholder {
    color: #666;
}

.search-box button {
    background: #ff0000;
    border: none;
    padding: 1.2rem 2rem;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: bold;
}

.search-box button:hover {
    background: #cc0000;
}

.search-suggestions {
    text-align: center;
    margin-bottom: 2rem;
}

.suggestion-item {
    display: inline-block;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    margin: 0.3rem;
    color: #ff9999;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.suggestion-item:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff6666;
}

.search-process {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 0, 0, 0.05);
    border-radius: 10px;
    min-width: 150px;
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.step-text {
    color: #ff9999;
    font-size: 0.9rem;
}

.search-results {
    margin-top: 2rem;
}

.result-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
    animation: resultAppear 0.5s ease-out;
    border-left: 4px solid #ff0000;
}

.result-rank {
    color: #ff0000;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.result-title {
    color: #1a0dab;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.result-url {
    color: #006621;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.result-description {
    color: #545454;
    line-height: 1.4;
}

/* Info Boxes */
.info-box {
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-box h4 {
    color: #ff0000;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.info-box p {
    color: #cccccc;
    line-height: 1.5;
}

/* Footer Section */
.footer-section {
    background: linear-gradient(135deg, #000000 0%, #330000 100%);
    border-top: 2px solid #ff0000;
    padding: 2rem 1rem;
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-branding {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-text {
    color: #cccccc;
    font-size: 0.9rem;
    font-weight: normal;
}

.footer-company {
    color: #ff0000;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: #ff6666;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.footer-link:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ffffff;
    border-color: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
}

/* Navigation */
.navigation {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    border-radius: 25px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.nav-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1rem;
    background: transparent;
    border: 1px solid #ff0000;
    color: #ff0000;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    min-width: 70px;
}

.nav-step:hover,
.nav-step.active {
    background: #ff0000;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.step-number {
    font-size: 1.2rem;
    font-weight: bold;
}

.step-name {
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    text-align: center;
    z-index: 1000;
}

.progress-track {
    background: rgba(255, 0, 0, 0.2);
    border-radius: 10px;
    height: 6px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-current {
    background: linear-gradient(90deg, #ff0000, #ff6666);
    height: 100%;
    width: 20%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    color: #ff9999;
    font-size: 0.9rem;
}

/* Animations */
@keyframes processing {
    0% { opacity: 0; transform: translateX(-20px); }
    50% { opacity: 1; transform: translateX(0); background: rgba(255, 165, 0, 0.3); }
    100% { opacity: 0.8; transform: translateX(20px); }
}

@keyframes arrowPulse {
    0%, 100% { transform: scale(1); color: #ff0000; }
    50% { transform: scale(1.2); color: #ff6666; }
}

@keyframes bookAppear {
    0% { opacity: 0; transform: scaleY(0); }
    100% { opacity: 1; transform: scaleY(1); }
}

@keyframes resultAppear {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 70px; /* Reduced top padding on mobile */
        padding-bottom: 100px; /* Reduced bottom padding on mobile */
    }
    
    .network-container {
        margin: 1rem auto;
    }
    
    .network-overlay {
        padding: 1.5rem 1rem;
    }
    
    .network-overlay h3 {
        font-size: 1.1rem;
    }
    
    .network-overlay p {
        font-size: 0.85rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .step-header h2 {
        font-size: 1.8rem;
    }
    
    .simple-explanation {
        font-size: 1.1rem;
    }
    
    .internet-simple {
        grid-template-columns: 1fr;
    }
    
    .crawler-demo {
        flex-direction: column;
        gap: 2rem;
    }
    
    .crawling-demo {
        flex-direction: column;
    }
    
    .indexing-demo {
        flex-direction: column;
    }
    
    .arrow-flow .arrow {
        transform: rotate(90deg);
    }
    
    .library-shelves {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-process {
        flex-direction: column;
        gap: 1rem;
    }
    
    .index-stats {
        gap: 1rem;
    }
    
    .navigation {
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.8rem;
    }
    
    .nav-step {
        min-width: 60px;
        padding: 0.6rem 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 65px; /* Further reduced top padding on small mobile */
        padding-bottom: 90px; /* Further reduced bottom padding on small mobile */
    }
    
    .network-overlay {
        padding: 1rem;
    }
    
    .network-overlay h3 {
        font-size: 1rem;
    }
    
    .network-overlay p {
        font-size: 0.8rem;
    }
    
    .particle {
        width: 3px;
        height: 3px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-company {
        font-size: 1.2rem;
    }
    
    .footer-links {
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .step-header h2 {
        font-size: 1.5rem;
    }
    
    .simple-explanation {
        font-size: 1rem;
    }
    
    .website-card {
        padding: 1.5rem;
    }
    
    .robot-head {
        font-size: 3rem;
    }
    
    .what-crawler-does {
        padding: 1.5rem;
    }
    
    .library-shelves {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 15px;
    }
    
    .search-box button {
        border-radius: 0 0 15px 15px;
    }
    
    .progress-indicator {
        padding: 0.5rem;
    }
    
    .step-number {
        font-size: 1rem;
    }
    
    .step-name {
        font-size: 0.6rem;
    }
}