/**
 * Platform Integration & Polish Styles
 * Week 12: Complete design system integration
 */

/* ==========================================================================
   Navigation Enhancement
   ========================================================================== */

.main-navigation .menu-item-connect > a {
    position: relative;
    font-weight: 600;
}

.main-navigation .menu-item-connect > a::after {
    content: '•';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-green);
    font-size: 1.2em;
}

/* Highlight CONNECT in navigation */
.main-navigation .menu-item-connect > a:hover {
    color: var(--accent-green);
}

/* ==========================================================================
   Journey Flow Indicators
   ========================================================================== */

.journey-breadcrumb {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.journey-breadcrumb .breadcrumb-separator {
    color: var(--accent-green);
}

.journey-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s ease;
}

.journey-indicator:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Smooth Transitions Between Sections
   ========================================================================== */

.page-transition {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section transitions in CONNECT */
.connect-section {
    animation: sectionFade 0.4s ease-out;
}

@keyframes sectionFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================================================
   Enhanced CTA Buttons
   ========================================================================== */

.cta-button,
.journey-cta {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cta-button::before,
.journey-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before,
.journey-cta:hover::before {
    width: 300px;
    height: 300px;
}

/* Primary CTA animations */
.cta-button.primary {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(201, 204, 104, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(201, 204, 104, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(201, 204, 104, 0);
    }
}

/* ==========================================================================
   Impact Visualization Enhancements
   ========================================================================== */

.impact-amount,
.stat-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

.stat-card:hover::before {
    animation: shimmer 0.6s ease-out;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

/* ==========================================================================
   Connector Cards Polish
   ========================================================================== */

.connector-card,
.featured-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.connector-card:hover .connector-avatar img,
.featured-card:hover .featured-avatar img {
    transform: scale(1.1);
}

.connector-avatar img,
.featured-avatar img {
    transition: transform 0.3s ease;
}

/* Relationship indicators */
.connection-indicators {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   Form Enhancements
   ========================================================================== */

input[type="text"],
input[type="email"],
textarea,
select {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 204, 104, 0.2);
}

/* Calculator form */
#impact-calculator-form select {
    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='%237E5D4C' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading-spinner {
    position: relative;
    display: inline-block;
}

.loading-spinner::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-green);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Success States
   ========================================================================== */

.success-message {
    animation: successPop 0.4s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Mobile Optimizations
   ========================================================================== */

@media (max-width: 768px) {
    /* Touch-friendly tap targets */
    .cta-button,
    .journey-cta,
    .nav-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Reduce animations on mobile */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Stack journey indicators */
    .journey-indicator {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .connect-navigation,
    .journey-indicator,
    .cta-button,
    .loading-spinner {
        display: none !important;
    }
    
    .stat-value {
        color: black !important;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus visible for keyboard navigation */
.cta-button:focus-visible,
.journey-cta:focus-visible,
.nav-item:focus-visible {
    outline: 3px solid var(--accent-green);
    outline-offset: 2px;
}

/* Skip links */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999999;
    background: var(--primary-brown);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stat-card,
    .connector-card,
    .featured-card {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Easter Eggs & Delighters
   ========================================================================== */

/* Coffee bean cursor on CONNECT section */
.connect-section-container {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><text y="20" font-size="20">☕</text></svg>'), auto;
}

/* Hover effect on stats */
.stat-value:hover {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* Success celebration */
.journey-complete {
    position: relative;
}

.journey-complete::before {
    content: '🎉';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: celebrate 1s ease-out;
}

@keyframes celebrate {
    0% {
        transform: translateX(-50%) translateY(0) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-20px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-10px) scale(1);
        opacity: 1;
    }
}