/* sora.markets — Neomorphism Soft UI Marketplace Aggregator */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #E8ECF0;
    color: #4A5568;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Neomorphic Utility Classes ===== */
.neu-surface {
    background: #E8ECF0;
}

.neu-raised {
    background: #E8ECF0;
    border-radius: 16px;
    box-shadow: 6px 6px 12px #c8ccd0, -6px -6px 12px #ffffff;
}

.neu-inset {
    border-radius: 12px;
    box-shadow: inset 4px 4px 8px #c8ccd0, inset -4px -4px 8px #ffffff;
    border: none;
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #2D3748;
    background: #E8ECF0;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.neu-inset:focus {
    box-shadow: inset 5px 5px 10px #c8ccd0, inset -5px -5px 10px #ffffff;
}

.neu-pill {
    display: inline-block;
    background: #E8ECF0;
    box-shadow: 2px 2px 4px #c8ccd0, -2px -2px 4px #ffffff;
    border-radius: 8px;
    padding: 2px 10px;
    font-size: 0.75rem;
    color: #4A5568;
    font-family: 'Inter', sans-serif;
}

/* ===== Section Headings ===== */
.section-heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2rem);
    color: #2D3748;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.3;
}

/* ===== Hero Zone ===== */
.hero {
    max-width: 860px;
    margin: 0 auto;
    padding: 5rem 2rem 3rem;
}

.neu-panel {
    padding: 2.5rem 2rem;
    text-align: center;
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 2.8rem);
    color: #2D3748;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.hero-dot {
    color: #6366F1;
}

.hero-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #4A5568;
    margin-bottom: 2rem;
    font-weight: 400;
}

.search-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 520px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.category-select {
    width: auto;
    min-width: 150px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.search-status {
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #6366F1;
    min-height: 1.2em;
    transition: opacity 0.3s ease;
}

/* ===== Trending Products ===== */
.trending {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
}

.product-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0.5rem 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c8ccd0 #E8ECF0;
}

.product-scroll::-webkit-scrollbar {
    height: 6px;
}

.product-scroll::-webkit-scrollbar-track {
    background: #E8ECF0;
    border-radius: 3px;
}

.product-scroll::-webkit-scrollbar-thumb {
    background: #c8ccd0;
    border-radius: 3px;
}

.product-card {
    min-width: 240px;
    max-width: 260px;
    padding: 1.5rem;
    scroll-snap-align: start;
    flex-shrink: 0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-card:hover {
    box-shadow: 8px 8px 16px #c8ccd0, -8px -8px 16px #ffffff;
    transform: translateY(-2px);
}

.product-card.hidden {
    display: none;
}

.product-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #2D3748;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.price-range {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.vendor {
    color: #4A5568;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.price-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: #4A5568;
}

.price-best {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #10B981;
}

.vendor-badge {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.72rem;
}

.compare-btn {
    display: inline-block;
    background: #6366F1;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.45rem 1.2rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    box-shadow: 3px 3px 6px #c8ccd0, -3px -3px 6px #ffffff;
}

.compare-btn:hover {
    background: #5558e6;
    transform: translateY(-1px);
    box-shadow: 4px 4px 8px #c8ccd0, -4px -4px 8px #ffffff;
}

.compare-btn:active {
    transform: translateY(0);
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.1);
}

.scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.scroll-hint .scroll-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #4A5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scroll-hint .scroll-arrow {
    font-size: 0.8rem;
    color: #6366F1;
}

/* ===== Market Directory ===== */
.directory {
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

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

.market-card {
    padding: 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.market-card:hover {
    box-shadow: 8px 8px 16px #c8ccd0, -8px -8px 16px #ffffff;
    transform: translateY(-2px);
}

.market-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #2D3748;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.market-count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.8rem;
    color: #4A5568;
    display: block;
    margin-bottom: 0.5rem;
}

.rating-dots {
    display: flex;
    gap: 2px;
    margin-bottom: 0.6rem;
    align-items: center;
}

.rating-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366F1;
    display: inline-block;
    margin: 0 1px;
}

.rating-dot.dim {
    background: #D1D5DB;
}

.market-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    transition: box-shadow 0.2s ease;
}

.tag:hover {
    box-shadow: 3px 3px 6px #c8ccd0, -3px -3px 6px #ffffff;
}

/* ===== Price Alerts ===== */
.alerts {
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.alert-row:hover {
    box-shadow: 8px 8px 16px #c8ccd0, -8px -8px 16px #ffffff;
    transform: translateY(-1px);
}

.alert-product {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2D3748;
    flex: 1;
    min-width: 0;
}

.alert-prices {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-original {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    color: #4A5568;
    text-decoration: line-through;
}

.alert-deal {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #10B981;
}

.alert-savings {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #10B981;
    background: #E8ECF0;
    box-shadow: 2px 2px 4px #c8ccd0, -2px -2px 4px #ffffff;
    border-radius: 8px;
    padding: 3px 10px;
    white-space: nowrap;
}

/* ===== Footer ===== */
.footer {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.footer-inner {
    padding: 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.flink {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6366F1;
    text-decoration: none;
    transition: color 0.25s ease;
}

.flink:hover {
    color: #5558e6;
}

.footer-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #4A5568;
    margin-bottom: 0.5rem;
}

.footer-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #2D3748;
}

/* ===== Compare Modal ===== */
.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 55, 72, 0.25);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.compare-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.compare-modal-inner {
    width: 90%;
    max-width: 420px;
    padding: 2rem;
    transform: translateY(20px);
    transition: transform 0.35s ease;
}

.compare-modal.active .compare-modal-inner {
    transform: translateY(0);
}

.compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.compare-modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #2D3748;
}

.compare-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4A5568;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.compare-close:hover {
    color: #2D3748;
}

.compare-modal-body .compare-product-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #2D3748;
    margin-bottom: 1rem;
}

.compare-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #D1D5DB;
}

.compare-row:last-child {
    border-bottom: none;
}

.compare-vendor {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #4A5568;
}

.compare-price {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.95rem;
    color: #4A5568;
}

.compare-price.best {
    color: #10B981;
    font-weight: 600;
}

/* ===== Fade-in Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Stagger children animation ===== */
.product-card,
.market-card,
.alert-row {
    opacity: 0;
    transform: translateY(12px);
}

.fade-in.visible .product-card,
.fade-in.visible .market-card,
.fade-in.visible .alert-row {
    animation: stagger-in 0.5s ease forwards;
}

.fade-in.visible .product-card:nth-child(1),
.fade-in.visible .market-card:nth-child(1),
.fade-in.visible .alert-row:nth-child(1) { animation-delay: 0s; }
.fade-in.visible .product-card:nth-child(2),
.fade-in.visible .market-card:nth-child(2),
.fade-in.visible .alert-row:nth-child(2) { animation-delay: 0.07s; }
.fade-in.visible .product-card:nth-child(3),
.fade-in.visible .market-card:nth-child(3),
.fade-in.visible .alert-row:nth-child(3) { animation-delay: 0.14s; }
.fade-in.visible .product-card:nth-child(4),
.fade-in.visible .market-card:nth-child(4),
.fade-in.visible .alert-row:nth-child(4) { animation-delay: 0.21s; }
.fade-in.visible .product-card:nth-child(5),
.fade-in.visible .market-card:nth-child(5),
.fade-in.visible .alert-row:nth-child(5) { animation-delay: 0.28s; }
.fade-in.visible .product-card:nth-child(6),
.fade-in.visible .market-card:nth-child(6) { animation-delay: 0.35s; }
.fade-in.visible .product-card:nth-child(7) { animation-delay: 0.42s; }
.fade-in.visible .product-card:nth-child(8) { animation-delay: 0.49s; }

@keyframes stagger-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .market-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 3rem 1.25rem 2rem;
    }

    .trending,
    .directory,
    .alerts,
    .footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        max-width: none;
    }

    .category-select {
        min-width: auto;
    }

    .alert-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .alert-prices {
        gap: 0.5rem;
    }

    .product-card {
        min-width: 220px;
    }
}
