/* ===========================
   SmartPickPro - Global Styles
   =========================== */

/* --- Base & Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* --- Grid Background --- */
.grid-bg {
    background-image: 
        linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* --- Navigation --- */
#navbar {
    background: rgba(15,15,35,0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
#navbar.scrolled {
    background: rgba(15,15,35,0.95);
    border-bottom-color: rgba(59,130,246,0.15);
}
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}
.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(59,130,246,0.1);
}
.nav-link.active {
    color: #60a5fa;
}
.mobile-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}
.mobile-link:hover, .mobile-link.active {
    color: #fff;
    background: rgba(59,130,246,0.1);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(59,130,246,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59,130,246,0.4);
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: 1.5px solid rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-outline:hover {
    border-color: rgba(59,130,246,0.5);
    background: rgba(59,130,246,0.05);
    transform: translateY(-2px);
}

/* --- Particles --- */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.particle-1 { width:300px; height:300px; top:10%; left:-5%; background:radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%); animation: floatParticle 15s ease-in-out infinite; }
.particle-2 { width:200px; height:200px; top:60%; right:5%; background:radial-gradient(circle, rgba(34,197,94,0.1) 0%, transparent 70%); animation: floatParticle 12s ease-in-out infinite reverse; }
.particle-3 { width:150px; height:150px; top:30%; right:20%; background:radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%); animation: floatParticle 18s ease-in-out infinite 2s; }
.particle-4 { width:100px; height:100px; bottom:20%; left:15%; background:radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%); animation: floatParticle 10s ease-in-out infinite 1s; }
.particle-5 { width:250px; height:250px; bottom:10%; right:30%; background:radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%); animation: floatParticle 20s ease-in-out infinite 3s; }

@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scrollDown {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(8px); opacity: 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(59,130,246,0.3); }
    50% { box-shadow: 0 0 30px rgba(59,130,246,0.6); }
}

.animate-fadeInUp { animation: fadeInUp 0.8s ease-out both; }
.animate-scrollDown { animation: scrollDown 1.5s ease-in-out infinite; }
.animate-float { animation: float 4s ease-in-out infinite; }

.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
.animation-delay-500 { animation-delay: 0.5s; }

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Problem & Solution Cards --- */
.problem-card, .solution-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.3s;
}
.problem-card:hover {
    background: rgba(239,68,68,0.03);
    border-color: rgba(239,68,68,0.15);
    transform: translateX(4px);
}
.solution-card:hover {
    background: rgba(34,197,94,0.03);
    border-color: rgba(34,197,94,0.15);
    transform: translateX(4px);
}

/* --- Process Step Cards --- */
.process-step-card {
    position: relative;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s;
    overflow: hidden;
}
.process-step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}
.process-step-card:hover {
    border-color: rgba(59,130,246,0.2);
    transform: translateY(-6px);
    background: rgba(59,130,246,0.03);
}
.process-step-card:hover::before { opacity: 1; }
.step-number {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 3rem;
    font-weight: 900;
    color: rgba(255,255,255,0.03);
    line-height: 1;
}
.step-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* --- Stats Cards --- */
.stat-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    transform: scaleX(0);
    transition: transform 0.4s;
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(59,130,246,0.2); }
.stat-card:hover::after { transform: scaleX(1); }
.stat-icon {
    font-size: 1.5rem;
    color: #60a5fa;
    margin-bottom: 1rem;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: #fff;
    display: inline;
    line-height: 1;
}
.stat-unit {
    font-size: 0.875rem;
    color: #60a5fa;
    font-weight: 600;
    margin-top: 0.25rem;
}
.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* --- TOC Cards --- */
.toc-card {
    display: block;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
}
.toc-card:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-4px);
    background: rgba(59,130,246,0.04);
}
.toc-card.active {
    border-color: rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.05);
}
.toc-number {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    font-weight: 900;
    color: rgba(255,255,255,0.03);
}
.toc-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: rgba(59,130,246,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.toc-badge {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.04);
    border-radius: 999px;
}
.toc-badge.active { color: #60a5fa; background: rgba(59,130,246,0.1); }

/* --- Page Header (sub pages) --- */
.page-header {
    position: relative;
    padding-top: 8rem;
    padding-bottom: 4rem;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, transparent 60%);
}
.page-header-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(59,130,246,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* --- Detail Cards (sub pages) --- */
.detail-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s;
}
.detail-card:hover {
    border-color: rgba(59,130,246,0.2);
    background: rgba(59,130,246,0.02);
}

/* --- Tech Spec Table --- */
.spec-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
.spec-table thead th {
    background: rgba(59,130,246,0.1);
    color: #93c5fd;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.spec-table thead th:first-child { border-radius: 0.5rem 0 0 0; }
.spec-table thead th:last-child { border-radius: 0 0.5rem 0 0; }
.spec-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #cbd5e1;
}
.spec-table tbody tr:hover td {
    background: rgba(59,130,246,0.03);
}
.spec-table tbody tr:last-child td { border-bottom: none; }

/* --- Timeline --- */
.timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 2.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 1.75rem;
    bottom: 0;
    width: 2px;
    background: rgba(59,130,246,0.15);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(59,130,246,0.15);
    border: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeline-dot.active { background: #3b82f6; animation: pulse-glow 2s infinite; }
.timeline-dot i { font-size: 0.5rem; color: #fff; }

/* --- Flowchart Section --- */
.flow-step {
    position: relative;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s;
}
.flow-step:hover {
    border-color: rgba(59,130,246,0.25);
    transform: scale(1.02);
}
.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.5rem;
    padding: 0.5rem 0;
    opacity: 0.5;
}

/* --- Badge / Tag --- */
.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(59,130,246,0.1);
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.2);
}

/* --- Architecture Diagram --- */
.arch-layer {
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 0.5rem;
}
.arch-layer-label {
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #1a1a2e;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .stat-number { font-size: 1.8rem; }
    .step-number { font-size: 2rem; }
    .toc-number { font-size: 1.8rem; }
}

/* --- Print Styles --- */
@media print {
    body { background: #fff; color: #000; }
    #navbar, .particle, .grid-bg { display: none; }
    .btn-primary, .btn-outline { border: 1px solid #000; color: #000; }
    .stat-card, .toc-card, .detail-card, .process-step-card { border: 1px solid #ccc; }
}
