/* RideSmart Canada - Urban Cycling Website Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --asphalt-gray: #2F2F2F;
    --signal-blue: #3AA7FF;
    --lime: #A7F542;
    --graphite: #1A2230;
    --soft-gray: #A7B0BD;
    --white: #FFFFFF;
    --black: #000000;
    --light-bg: #F8F9FA;
    
    /* Typography */
    --font-primary: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --h1-size: 3.1rem;
    --h2-size: 2.25rem;
    --h3-size: 1.5rem;
    --body-size: 1rem;
    --small-size: 0.875rem;
    
    /* Spacing */
    --container-max-width: 1200px;
    --gutter: 24px;
    --section-padding: 80px 0;
    --card-padding: 24px;
    
    /* Effects */
    --card-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    --transition-fast: 160ms ease;
    --transition-slow: 220ms ease;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--asphalt-gray);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Container and Grid System */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
}

/* Typography */
h1 {
    font-size: var(--h1-size);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--graphite);
}

h2 {
    font-size: var(--h2-size);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--graphite);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: var(--h3-size);
    font-weight: 600;
    line-height: 1.3;
    color: var(--graphite);
    margin-bottom: 1rem;
}

p {
    font-size: var(--body-size);
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--asphalt-gray);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(167, 176, 189, 0.2);
    z-index: 1000;
    transition: var(--transition-fast);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--signal-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

.logo:hover {
    color: var(--graphite);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--asphalt-gray);
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--signal-blue);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--signal-blue);
    transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--asphalt-gray);
    margin: 2px 0;
    transition: var(--transition-fast);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section with Animated Bike Grid */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--graphite) 0%, var(--asphalt-gray) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="bike-grid" patternUnits="userSpaceOnUse" width="50" height="50"><path d="M5 5 L45 5 L45 45 M25 5 L25 45 M5 25 L45 25 M10 10 L40 10 M10 20 L40 20 M10 30 L40 30 M10 40 L40 40 M15 15 L35 15 M15 25 L35 25 M15 35 L35 35" stroke="rgba(167, 245, 66, 0.3)" stroke-width="1" fill="none" stroke-dasharray="2,2"><animate attributeName="stroke-dashoffset" values="0;4" dur="2s" repeatCount="indefinite"/></path></pattern></defs><rect width="100" height="100" fill="url(%23bike-grid)"/></svg>') repeat;
    opacity: 0.4;
    animation: bikeGridMove 20s linear infinite;
}

@keyframes bikeGridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    object-fit: cover;
    opacity: 0.3;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: var(--body-size);
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--signal-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: #2B8CE8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(58, 167, 255, 0.4);
}

.btn-secondary {
    background: var(--lime);
    color: var(--graphite);
}

.btn-secondary:hover {
    background: #8FE533;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(167, 245, 66, 0.4);
}

/* Statistics Section */
.stats {
    background: var(--light-bg);
    padding: var(--section-padding);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-slow);
}

.stat-item:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--signal-blue);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: var(--small-size);
    color: var(--soft-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Advantages Section */
.advantages {
    padding: var(--section-padding);
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.advantage-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-slow);
    border: 1px solid rgba(167, 176, 189, 0.1);
}

.advantage-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.advantage-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--signal-blue), var(--lime));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.advantage-card h3 {
    margin-bottom: 1rem;
}

.advantage-card p {
    color: var(--soft-gray);
    line-height: 1.6;
}

/* Articles Sections */
.articles-section {
    padding: var(--section-padding);
}

.articles-section:nth-child(even) {
    background: var(--light-bg);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.article-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition-slow);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: var(--card-padding);
}

.article-meta {
    font-size: var(--small-size);
    color: var(--soft-gray);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.article-card h3 {
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.article-preview {
    color: var(--soft-gray);
    font-size: var(--small-size);
    line-height: 1.5;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--soft-gray);
    border-radius: 24px;
    font-size: var(--small-size);
    font-weight: 500;
    color: var(--asphalt-gray);
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--signal-blue);
    border-color: var(--signal-blue);
    color: var(--white);
}

/* Reviews Section */
.reviews {
    background: var(--graphite);
    color: var(--white);
    padding: var(--section-padding);
}

.reviews h2 {
    color: var(--white);
    text-align: center;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.review-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.review-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.review-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.review-location {
    font-size: var(--small-size);
    color: var(--soft-gray);
}

.stars {
    color: var(--lime);
    margin-bottom: 1rem;
}

/* Newsletter Section */
.newsletter {
    background: var(--signal-blue);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.newsletter h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.newsletter p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.newsletter-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: var(--body-size);
    outline: none;
}

.newsletter-form .btn {
    white-space: nowrap;
}

/* Category Page Headers */
.category-header {
    background: linear-gradient(135deg, var(--signal-blue), var(--lime));
    color: var(--white);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="bike-grid-light" patternUnits="userSpaceOnUse" width="50" height="50"><path d="M5 5 L45 5 L45 45 M25 5 L25 45 M5 25 L45 25 M10 10 L40 10 M10 20 L40 20 M10 30 L40 30 M10 40 L40 40 M15 15 L35 15 M15 25 L35 25 M15 35 L35 35" stroke="rgba(255, 255, 255, 0.2)" stroke-width="1" fill="none" stroke-dasharray="2,2"><animate attributeName="stroke-dashoffset" values="0;4" dur="3s" repeatCount="indefinite"/></path></pattern></defs><rect width="100" height="100" fill="url(%23bike-grid-light)"/></svg>') repeat;
    opacity: 0.3;
}

.category-header h1 {
    color: var(--white);
    position: relative;
    z-index: 1;
}

.category-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: var(--graphite);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.footer-section p,
.footer-section a {
    color: var(--soft-gray);
    text-decoration: none;
    line-height: 1.8;
    transition: var(--transition-fast);
}

.footer-section a:hover {
    color: var(--signal-blue);
}

.footer-bottom {
    border-top: 1px solid rgba(167, 176, 189, 0.2);
    padding-top: 2rem;
    text-align: center;
    color: var(--soft-gray);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--signal-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition-fast);
    z-index: 100;
    box-shadow: var(--card-shadow);
}

.back-to-top:hover {
    background: #2B8CE8;
    transform: translateY(-2px);
}

.back-to-top.show {
    display: flex;
}

/* Link Pulse Animation */
a:not(.btn) {
    transition: var(--transition-fast);
}

a:not(.btn):hover {
    animation: linkPulse 0.6s ease;
}

@keyframes linkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --h1-size: 2.25rem;
        --h2-size: 1.75rem;
        --gutter: 16px;
        --section-padding: 60px 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        box-shadow: var(--card-shadow);
        transition: var(--transition-slow);
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(167, 176, 189, 0.2);
        width: 100%;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        align-items: center;
    }
    
    .newsletter-form input {
        width: 100%;
        max-width: 300px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .filter-chips {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .article-card {
        margin: 0 10px;
    }
    
    .hero {
        min-height: 80vh;
    }
    
    .category-header {
        padding: 100px 0 60px;
    }
}