/**
 * Concept Flow Widget Styles
 * Premium visual journey from idea to product
 */

/* ==========================================
   Main Container
   ========================================== */

.cf-concept-flow {
    width: 100%;
    padding: 40px 20px;
    position: relative;
}

.cf-flow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    position: relative;
    flex-wrap: wrap;
}

/* ==========================================
   Layout Styles
   ========================================== */

/* Timeline Layout */
.cf-layout-timeline .cf-flow-container {
    flex-direction: column;
    align-items: flex-start;
    max-width: 800px;
    margin: 0 auto;
}

.cf-layout-timeline .cf-step-item {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.cf-layout-timeline .cf-step-item:nth-child(even) {
    flex-direction: row-reverse;
}

.cf-layout-timeline .cf-connector {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 4px;
    height: 60px;
    transform: translateX(-50%);
}

/* Zig-Zag Layout */
.cf-layout-zigzag .cf-flow-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 80px 40px;
    align-items: start;
}

.cf-layout-zigzag .cf-step-item:nth-child(even) {
    margin-top: 60px;
}

/* Grid Layout */
.cf-layout-grid .cf-flow-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

/* Straight Layout */
.cf-layout-straight .cf-flow-container {
    flex-direction: row;
    justify-content: space-between;
}

/* ==========================================
   Step Items
   ========================================== */

.cf-step-item {
    position: relative;
    flex: 0 0 auto;
}

.cf-step-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.cf-step-link:hover {
    transform: translateY(-5px);
}

.cf-step-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.cf-step-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0066cc, #00a8ff);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.cf-step-box:hover::before {
    transform: scaleX(1);
}

.cf-step-box:hover {
    box-shadow: 0 12px 40px rgba(0, 102, 204, 0.15);
    transform: translateY(-8px);
}

/* ==========================================
   Step Content
   ========================================== */

.cf-step-number {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #0066cc;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    z-index: 2;
}

.cf-step-icon {
    font-size: 48px;
    color: #0066cc;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.cf-step-icon i,
.cf-step-icon svg {
    width: 1em;
    height: 1em;
    display: block;
}

.cf-step-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px;
    line-height: 1.3;
}

.cf-step-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================
   Connectors & Arrows
   ========================================== */

.cf-connector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-connector-svg {
    width: 100%;
    height: 60px;
    fill: none;
    stroke: #0066cc;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cf-layout-zigzag .cf-connector {
    position: absolute;
    right: -60px;
    top: 50%;
    width: 80px;
    height: 80px;
    transform: translateY(-50%);
    pointer-events: none;
}

.cf-layout-straight .cf-connector {
    flex: 0 0 60px;
    height: 2px;
}

.cf-layout-straight .cf-connector-svg {
    height: 2px;
}

.cf-arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    fill: #0066cc;
}

/* ==========================================
   Animations
   ========================================== */

.cf-animated .cf-step-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.cf-animated .cf-step-item:nth-child(1) { animation-delay: 0.1s; }
.cf-animated .cf-step-item:nth-child(2) { animation-delay: 0.2s; }
.cf-animated .cf-step-item:nth-child(3) { animation-delay: 0.3s; }
.cf-animated .cf-step-item:nth-child(4) { animation-delay: 0.4s; }
.cf-animated .cf-step-item:nth-child(5) { animation-delay: 0.5s; }
.cf-animated .cf-step-item:nth-child(6) { animation-delay: 0.6s; }
.cf-animated .cf-step-item:nth-child(7) { animation-delay: 0.7s; }
.cf-animated .cf-step-item:nth-child(8) { animation-delay: 0.8s; }
.cf-animated .cf-step-item:nth-child(9) { animation-delay: 0.9s; }

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

.cf-animated .cf-connector-svg path,
.cf-animated .cf-connector-svg line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 1s ease forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 1024px) {
    .cf-layout-zigzag .cf-flow-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 60px 30px;
    }
    
    .cf-layout-zigzag .cf-step-item:nth-child(even) {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .cf-concept-flow {
        padding: 30px 15px;
    }
    
    .cf-flow-container {
        gap: 40px;
    }
    
    /* All layouts become vertical on mobile */
    .cf-layout-zigzag .cf-flow-container,
    .cf-layout-grid .cf-flow-container,
    .cf-layout-straight .cf-flow-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    
    .cf-layout-timeline .cf-step-item {
        flex-direction: column !important;
        text-align: center;
    }
    
    .cf-step-box {
        padding: 25px 20px;
    }
    
    .cf-step-icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    .cf-step-title {
        font-size: 18px;
    }
    
    .cf-step-description {
        font-size: 13px;
    }
    
    /* Simplified connectors on mobile */
    .cf-connector {
        position: relative;
        width: 4px;
        height: 40px;
        left: 50%;
        transform: translateX(-50%);
        margin: 20px auto;
    }
    
    .cf-connector-svg {
        height: 40px;
    }
    
    .cf-arrow {
        bottom: -10px;
        top: auto;
        left: 50%;
        transform: translateX(-50%) rotate(90deg);
    }
}

@media (max-width: 480px) {
    .cf-step-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
        top: -12px;
        right: -12px;
    }
    
    .cf-step-box {
        padding: 20px 15px;
    }
    
    .cf-step-icon {
        font-size: 36px;
    }
    
    .cf-step-title {
        font-size: 16px;
    }
}

/* ==========================================
   Dark Mode Support
   ========================================== */

@media (prefers-color-scheme: dark) {
    .cf-step-box {
        background: #1f2937;
        border-color: #374151;
    }
    
    .cf-step-title {
        color: #f9fafb;
    }
    
    .cf-step-description {
        color: #d1d5db;
    }
}

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

@media print {
    .cf-connector {
        display: none;
    }
    
    .cf-step-box {
        box-shadow: none;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}
