/* ===== Index Page Styles ===== */

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8f4fc 50%, #fef3e8 100%);
    z-index: -2;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%);
    z-index: -1;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-2xl);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.hero-badge i {
    color: var(--accent-color);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Hero Visual */
.hero-visual {
    position: relative;
}

.visual-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform var(--transition-slow);
}

.visual-card:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
}

.step-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step.active {
    background: var(--primary-color);
    color: white;
}

.step-line {
    height: 2px;
    width: 40px;
    background: var(--border-color);
}

.code-preview {
    background: #1e1e2e;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.code-line {
    color: #cdd6f4;
    line-height: 1.8;
    padding: 0.125rem 0;
}

.code-line.highlight {
    background: rgba(99, 102, 241, 0.2);
    margin: 0 -1.5rem;
    padding: 0.125rem 1.5rem;
    border-left: 3px solid var(--primary-color);
}

.code-line .keyword { color: #cba6f7; }
.code-line .function { color: #89b4fa; }

.visual-annotation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(14, 165, 233, 0.1));
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.visual-annotation i {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

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

    .hero-visual {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Value Section */
.value-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.value-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.value-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.value-card h3 {
    margin-bottom: 0.75rem;
}

.value-card p {
    font-size: 0.95rem;
}

@media (max-width: 992px) {
    .value-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .value-grid {
        grid-template-columns: 1fr;
    }
}

/* Concepts Section */
.concepts-section {
    background: var(--bg-secondary);
}

.concepts-grid {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.concept-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.concept-card.reverse {
    direction: rtl;
}

.concept-card.reverse > * {
    direction: ltr;
}

.concept-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.concept-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

/* Concept Visual Cards (CSS-based) */
.concept-visual {
    height: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.concept-visual.code-visual {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

.concept-visual.algo-visual {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #14b8a6 100%);
}

.concept-visual.finance-visual {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
}

.concept-visual.math-visual {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
}

.visual-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem;
    gap: 0.75rem;
}

.visual-center-icon {
    position: relative;
    z-index: 2;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Code Visual - Floating Elements */
.code-visual .visual-decoration {
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
}

.floating-element {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    animation: float 3s ease-in-out infinite;
}

.floating-element:nth-child(1) { animation-delay: 0s; }
.floating-element:nth-child(2) { animation-delay: 0.5s; }
.floating-element:nth-child(3) { animation-delay: 1s; }

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

/* Algo Visual - Bars */
.algo-visual .visual-decoration {
    align-items: flex-end;
    padding-bottom: 2.5rem;
}

.floating-bar {
    width: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    animation: barGrow 2s ease-in-out infinite;
}

.floating-bar:nth-child(1) { animation-delay: 0s; }
.floating-bar:nth-child(2) { animation-delay: 0.2s; }
.floating-bar:nth-child(3) { animation-delay: 0.4s; }
.floating-bar:nth-child(4) { animation-delay: 0.6s; }
.floating-bar:nth-child(5) { animation-delay: 0.8s; }

@keyframes barGrow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Finance Visual - Chart Line */
.finance-visual .visual-decoration {
    padding: 0;
}

.chart-line {
    position: absolute;
    bottom: 30%;
    left: 10%;
    right: 10%;
    height: 40%;
}

/* Math Visual - Symbols */
.math-visual .visual-decoration {
    flex-wrap: wrap;
    align-content: center;
    gap: 1rem;
    padding: 2rem;
}

.math-symbol {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    animation: symbolPulse 2s ease-in-out infinite;
}

.math-symbol:nth-child(1) { animation-delay: 0s; }
.math-symbol:nth-child(2) { animation-delay: 0.3s; }
.math-symbol:nth-child(3) { animation-delay: 0.6s; }
.math-symbol:nth-child(4) { animation-delay: 0.9s; }

@keyframes symbolPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.concept-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.concept-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.concept-content > p {
    margin-bottom: 1.5rem;
}

.concept-features {
    margin-bottom: 1.5rem;
}

.concept-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.concept-features i {
    color: var(--success-color);
    font-size: 0.875rem;
}

.concept-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.concept-link:hover i {
    transform: translateX(5px);
}

.concept-link i {
    transition: transform var(--transition-fast);
}

@media (max-width: 992px) {
    .concept-card,
    .concept-card.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 2rem;
    }

    .concept-image img {
        height: 250px;
    }
}

/* Tools Section */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.tool-card {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: all var(--transition-normal);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    margin-bottom: 1rem;
}

.tool-icon.algo {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.tool-icon.search {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

.tool-icon.code {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.tool-icon.finance {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.tool-icon.math {
    background: linear-gradient(135deg, #ec4899, #f472b6);
}

.tool-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tool-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-2xl);
}

.tools-cta {
    text-align: center;
    margin-top: 3rem;
}

@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Step Demo Section */
.step-demo-section {
    background: var(--bg-secondary);
}

.step-demo {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.demo-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.demo-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.demo-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.demo-progress {
    font-weight: 600;
    color: var(--text-primary);
}

.demo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.demo-visual {
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.demo-array {
    display: flex;
    gap: 0.75rem;
}

.demo-item {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: white;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.demo-item.comparing {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.demo-item.swapping {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.demo-item.sorted {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.demo-explanation {
    padding: 2rem;
    border-left: 1px solid var(--border-color);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.explanation-content p {
    line-height: 1.8;
}

@media (max-width: 768px) {
    .demo-content {
        grid-template-columns: 1fr;
    }

    .demo-explanation {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .demo-item {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

/* Errors Section */
.errors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.error-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: white;
}

.error-header.wrong {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.error-header.right {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.error-content {
    padding: 1.5rem;
}

.error-content h4 {
    margin-bottom: 1rem;
}

.code-block {
    background: #1e1e2e;
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: #cdd6f4;
    white-space: pre;
}

@media (max-width: 768px) {
    .errors-grid {
        grid-template-columns: 1fr;
    }
}

/* Use Cases Section */
.usecases-section {
    background: var(--bg-secondary);
}

.usecases-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.usecase-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.usecase-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.usecase-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.usecase-card h4 {
    margin-bottom: 0.5rem;
}

.usecase-card p {
    font-size: 0.9rem;
}

@media (max-width: 992px) {
    .usecases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .usecases-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Section */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: all var(--transition-fast);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question i {
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-secondary);
}

/* Trust Section */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-xl);
}

.trust-item {
    text-align: center;
    color: white;
}

.trust-item i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.trust-item h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.trust-item p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 992px) {
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .trust-grid {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
}

/* CTA Section */
.cta-section {
    background: var(--bg-secondary);
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content > p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@media (max-width: 576px) {
    .cta-content h2 {
        font-size: 1.75rem;
    }

    .cta-actions {
        flex-direction: column;
    }
}
