/* Responsive, Animations, Pages, Utilities */

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay p {
    color: var(--color-white);
    font-weight: 600;
    margin: 0;
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-card {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.contact-card-icon {
    width: 56px;
    height: 56px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.contact-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.contact-card p {
    color: var(--color-text-light);
    margin: 0;
}

.contact-card a {
    color: var(--color-primary);
    font-weight: 600;
}

.contact-form-wrapper {
    background: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.contact-form .form-input {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.contact-form .form-input:focus {
    background: var(--color-white);
}

.contact-form textarea.form-input {
    min-height: 150px;
    resize: vertical;
}

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    padding: 160px 0 80px;
    text-align: center;
}

.page-hero h1 {
    color: var(--color-white);
    margin-bottom: 1rem;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

/* About */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.about-text h2 {
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--color-text-light);
}

.certifications {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.cert-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-surface);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-secondary);
}

.cert-badge svg {
    width: 20px;
    height: 20px;
    color: var(--color-accent);
}

/* Team */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.team-member {
    text-align: center;
}

.team-member-image {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    margin: 0 auto 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.team-member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member h4 {
    margin-bottom: 0.25rem;
}

.team-member p {
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Legal */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 0;
}

.legal-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.legal-content p,
.legal-content li {
    color: var(--color-text-light);
    line-height: 1.8;
}

.legal-content ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.legal-content li {
    list-style: disc;
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease forwards;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    z-index: 999;
    padding-top: 100px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav-links a {
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto 2rem;
    }

    .hero-features {
        align-items: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid,
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .activity-content,
    .contact-grid,
    .about-content {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-phone {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-bar {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    body {
        padding-bottom: 80px;
    }

    .hero {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 4rem;
    }

    .form-card {
        margin-top: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .steps-grid::before {
        display: none;
    }

    .services-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Logo mobile fix */
    .logo-text {
        font-size: 1rem;
    }

    /* Province grid mobile */
    .province-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* FAQ cards stack on mobile */
    .faq-grid {
        gap: 0.75rem;
    }

    /* Header CTA hidden on mobile */
    .header-cta {
        display: none !important;
    }

    /* Two column forms on mobile */
    .registration-form [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Mobile UX: Smaller search button */
    .form-card .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        width: auto;
        min-width: 180px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    /* Mobile UX: Prevent placeholder text truncation */
    .form-card .form-input::placeholder {
        font-size: 0.8125rem;
    }

    .form-card .form-input {
        font-size: 0.9rem;
    }

    .form-input-icon input {
        padding-left: 2.25rem;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-white {
    color: var(--color-white);
}

.mt-md {
    margin-top: 1rem;
}

.mt-lg {
    margin-top: 1.5rem;
}

.mt-xl {
    margin-top: 2rem;
}

.mb-md {
    margin-bottom: 1rem;
}

.mb-lg {
    margin-bottom: 1.5rem;
}

.hidden {
    display: none !important;
}

/* ===== MOBILE UX/UI IMPROVEMENTS v6 ===== */

@media (max-width: 768px) {

    /* Provider Registration - Vertical Stack */
    .provider-reg-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
    }

    /* Contact Cards - Vertical Stack */
    .contact-options-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    /* Section Spacing Improvements */
    .section {
        padding: 3rem 0;
    }

    .section+.section {
        margin-top: 0.5rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .footer {
        padding-top: 2.5rem;
        margin-top: 1.5rem;
    }

    .footer-bottom {
        padding: 1.5rem 0;
    }

    /* Province Links Enhancement */
    .province-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .province-link {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        align-items: center !important;
        padding: 1.25rem 1rem !important;
        border-left: 4px solid var(--color-accent) !important;
        background: var(--color-white);
        position: relative;
    }

    .province-link::after {
        content: '→';
        color: var(--color-accent);
        font-size: 1.25rem;
        font-weight: bold;
        transition: transform 0.2s ease;
        margin-left: 1rem;
    }

    .province-link:hover::after {
        transform: translateX(4px);
    }

    .province-link .province-name {
        font-size: 1rem;
        font-weight: 600;
        display: block;
        margin-bottom: 0.125rem;
        grid-column: 1;
    }

    .province-link .province-city {
        font-size: 0.8125rem;
        display: block;
        color: var(--color-text-light);
        grid-column: 1;
    }

    /* Mobile Bar Redesign */
    .mobile-bar {
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .mobile-bar .btn-text {
        background: rgba(22, 163, 74, 0.08);
        color: var(--color-accent);
        border: 1px solid var(--color-accent);
        font-size: 0.8125rem;
    }

    .mobile-bar .btn-call {
        background: var(--color-primary);
        color: var(--color-white);
        font-size: 0.8125rem;
    }

    /* Map height on mobile - increased for full Canada visibility */
    #canadaMap {
        height: 350px !important;
        min-height: 350px !important;
    }

    /* Form fields on mobile */
    .registration-form .form-input,
    .registration-form select {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Search input placeholder - smaller for mobile */
    #postalCode {
        font-size: 14px !important;
    }

    #postalCode::placeholder {
        font-size: 12px !important;
        letter-spacing: -0.3px;
    }

    /* Form card on mobile - ensure full width */
    .form-card {
        padding: 1.5rem !important;
    }

    .form-card .form-input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem !important;
    }

    /* Pricing card mobile */
    .pricing-card {
        padding: 1.5rem;
    }

    .pricing-amount {
        font-size: 2.5rem;
    }
}

/* Results section spacing */
.provider-results {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
}

/* Ensure hero section has proper spacing when results shown */
.hero .form-card {
    margin-bottom: 0;
}