/**
 * CordialTec Multipurpose plugin for AmaraTech — Components CSS
 * File:       assets/css/components.css
 * Version:    1.0.6
 * Author:     CordialTec
 *
 * Contents:
 *   1. STEP FLOW COMPONENT ([amaratech_stepflow])
 *   2. HEADER SEARCH COMPONENT ([amaratech_header_search])
 */

/* =========================================================================
 * 1. STEP FLOW COMPONENT
 * ========================================================================= */
.amaratech-stepflow-component-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

.amaratech-stepflow-component-wrapper * {
    box-sizing: border-box;
}

/* --- Desktop Stepper --- */
.amaratech-stepflow-component-stepper-desktop {
    display: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .amaratech-stepflow-component-stepper-desktop {
        display: flex;
    }
}

.amaratech-stepflow-component-step-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.amaratech-stepflow-component-step-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 9999px;
    background-color: var(--amaratech-stepflow-stepper-circle-bg, #333333);
    border: 2px solid var(--amaratech-stepflow-accent, #c9f31d);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1rem;
    color: var(--amaratech-stepflow-stepper-circle-text, #ffffff);
    margin-bottom: 10px;
}

.amaratech-stepflow-component-step-icon-circle.amaratech-active-step {
    background-color: var(--amaratech-stepflow-accent, #c9f31d);
    border-color: var(--amaratech-stepflow-accent, #c9f31d);
    color: #000000;
}

.amaratech-stepflow-component-step-icon-circle:hover {
    border-color: var(--amaratech-stepflow-accent, #c9f31d);
    color: var(--amaratech-stepflow-accent, #c9f31d);
}

.amaratech-stepflow-component-step-icon-circle.amaratech-active-step:hover {
    color: #000000;
}

.amaratech-stepflow-component-step-label {
    font-size: 0.875rem;
    color: var(--amaratech-stepflow-card-desc, #bdbdbd);
    text-align: center;
    margin-bottom: 5px;
    transition: color 0.2s;
}

.amaratech-stepflow-component-step-label.amaratech-active-label {
    color: var(--amaratech-stepflow-accent, #c9f31d);
    font-weight: 600;
}

/* Connecting Lines */
.amaratech-stepflow-component-step-line {
    position: absolute;
    top: 1.25rem;
    left: calc(50% + 1.5rem);
    width: calc(100% - 3rem);
    height: 2px;
    background-color: var(--amaratech-stepflow-card-border, #1f2937);
    transition: background-color 0.25s ease;
}

.amaratech-stepflow-component-step-line.amaratech-completed {
    background-color: var(--amaratech-stepflow-accent, #c9f31d);
}

.amaratech-stepflow-component-step-container:last-child .amaratech-stepflow-component-step-line {
    display: none;
}

/* --- Mobile Sticky Numbers --- */
.amaratech-stepflow-component-mobile-sticky {
    display: none;
    position: sticky;
    top: 0;
    background-color: var(--amaratech-stepflow-card-highlight-bg, #000000);
    z-index: 100;
    padding: 0.75rem 0;
    margin-bottom: 1.25rem;
}

@media (max-width: 767px) {
    .amaratech-stepflow-component-mobile-sticky {
        display: block;
    }
}

.amaratech-stepflow-component-mobile-steps-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.amaratech-stepflow-component-mobile-steps-row:last-child {
    margin-bottom: 0;
}

.amaratech-stepflow-component-mobile-step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.amaratech-stepflow-component-mobile-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 9999px;
    background-color: var(--amaratech-stepflow-stepper-circle-bg, #333333);
    border: 2px solid var(--amaratech-stepflow-accent, #c9f31d);
    cursor: pointer;
    font-weight: 600;
    color: var(--amaratech-stepflow-stepper-circle-text, #ffffff);
    transition: all 0.2s;
}

.amaratech-stepflow-component-mobile-step-number.amaratech-active-step-mobile {
    background-color: var(--amaratech-stepflow-accent, #c9f31d);
    border-color: var(--amaratech-stepflow-accent, #c9f31d);
    color: #000000;
}

.amaratech-stepflow-component-mobile-step-label {
    font-size: 0.7rem;
    color: var(--amaratech-stepflow-card-desc, #bdbdbd);
    text-align: center;
}

/* --- Scrollable Cards Container --- */
.amaratech-stepflow-component-cards-scroll-container {
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 767px) {
    .amaratech-stepflow-component-cards-scroll-container {
        max-height: calc(100vh - 140px);
        padding: 2px 4px 30px 2px;
    }
}

@media (min-width: 768px) {
    .amaratech-stepflow-component-cards-scroll-container {
        overflow-y: visible;
        max-height: none;
        padding: 0;
    }
}

.amaratech-stepflow-component-cards-scroll-container::-webkit-scrollbar {
    width: 5px;
}

.amaratech-stepflow-component-cards-scroll-container::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}

.amaratech-stepflow-component-cards-scroll-container::-webkit-scrollbar-thumb {
    background: var(--amaratech-stepflow-accent, #c9f31d);
    border-radius: 10px;
}

.amaratech-stepflow-component-cards-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #b0d818;
}

.amaratech-stepflow-component-cards-scroll-container {
    scrollbar-width: thin;
    scrollbar-color: var(--amaratech-stepflow-accent, #c9f31d) #1a1a1a;
}

/* --- Cards Grid --- */
.amaratech-stepflow-component-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* Desktop: 5 across */
@media (min-width: 1025px) {
    .amaratech-stepflow-component-cards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
}

/* Tablet: 3 on top, 2 stretched below */
@media (min-width: 768px) and (max-width: 1024px) {
    .amaratech-stepflow-component-cards-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.25rem;
    }

    .amaratech-stepflow-component-card:nth-child(1),
    .amaratech-stepflow-component-card:nth-child(2),
    .amaratech-stepflow-component-card:nth-child(3) {
        grid-column: span 2;
    }

    .amaratech-stepflow-component-card:nth-child(4),
    .amaratech-stepflow-component-card:nth-child(5) {
        grid-column: span 3;
    }
}

.amaratech-stepflow-component-card {
    background-color: var(--amaratech-stepflow-card-bg, #333333);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 2px solid var(--amaratech-stepflow-card-border, #1f2937);
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0;
    position: relative;
}

@media (min-width: 768px) {
    .amaratech-stepflow-component-card:hover {
        border-color: var(--amaratech-stepflow-accent, #c9f31d);
        transform: translateY(-2px);
    }
}

@media (max-width: 767px) {
    .amaratech-stepflow-component-card:active {
        transform: scale(0.99);
    }
}

.amaratech-stepflow-component-card.amaratech-card-highlight {
    background-color: var(--amaratech-stepflow-card-highlight-bg, #000000);
    border-color: var(--amaratech-stepflow-accent, #c9f31d);
}

.amaratech-stepflow-component-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.amaratech-stepflow-component-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amaratech-stepflow-component-card-icon img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    filter: brightness(0) invert(0.74);
    transition: filter 0.2s;
}

.amaratech-stepflow-component-card.amaratech-card-highlight .amaratech-stepflow-component-card-icon img {
    filter: brightness(0) invert(1);
}

.amaratech-stepflow-component-card-radio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    border: 1px solid #bdbdbd;
    background-color: transparent;
    transition: all 0.2s;
}

.amaratech-stepflow-component-card:hover .amaratech-stepflow-component-card-radio {
    border-color: var(--amaratech-stepflow-accent, #c9f31d);
}

.amaratech-stepflow-component-card.amaratech-card-highlight .amaratech-stepflow-component-card-radio {
    background-color: var(--amaratech-stepflow-accent, #c9f31d);
    border-color: var(--amaratech-stepflow-accent, #c9f31d);
}

.amaratech-stepflow-component-card-radio svg {
    width: 0.65rem;
    height: 0.65rem;
    color: #000000;
    opacity: 0;
    transition: opacity 0.2s;
}

.amaratech-stepflow-component-card.amaratech-card-highlight .amaratech-stepflow-component-card-radio svg {
    opacity: 1;
}

.amaratech-stepflow-component-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--amaratech-stepflow-card-title, #ffffff);
}

.amaratech-stepflow-component-card-description {
    font-size: 0.75rem;
    color: var(--amaratech-stepflow-card-desc, #bdbdbd);
    line-height: 1.45;
}

@media (min-width: 768px) {
    .amaratech-stepflow-component-card-title {
        font-size: 1rem;
    }
    .amaratech-stepflow-component-card-description {
        font-size: 0.8rem;
    }
}


/* =========================================================================
 * 2. HEADER SEARCH COMPONENT
 * ========================================================================= */

/* Trigger Button */
.amaratech-search-widget-trigger-btn {
    background: var(--amaratech-hs-trigger-bg, transparent) !important;
    border: 1px solid var(--amaratech-hs-trigger-border, transparent) !important;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--amaratech-hs-trigger-icon, #ffffff);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    padding: 0;
    vertical-align: middle;
}

.amaratech-search-widget-trigger-btn:hover {
    color: var(--amaratech-hs-trigger-icon-hover, #c9f31d);
    background: var(--amaratech-hs-trigger-bg, transparent) !important;
    border-color: var(--amaratech-hs-trigger-border, transparent) !important;
}

.amaratech-search-widget-trigger-btn svg {
    width: 20px;
    height: 20px;
}

/* Modal Backdrop */
.amaratech-search-widget-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 6vh;
    box-sizing: border-box;
}

.amaratech-search-widget-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.amaratech-search-widget-modal-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 680px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 0 1rem;
    box-sizing: border-box;
}

.amaratech-search-widget-modal-backdrop.active .amaratech-search-widget-modal-card {
    transform: translateY(0);
}

/* Header with Scope & Input */
.amaratech-search-widget-input-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: #ffffff;
    gap: 0.75rem;
    box-sizing: border-box;
}

.amaratech-search-widget-search-icon-svg {
    color: #64748b;
    flex-shrink: 0;
}

.amaratech-search-widget-scope-select-wrapper {
    position: relative;
    flex-shrink: 0;
}

.amaratech-search-widget-scope-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    line-height: normal;
}

.amaratech-search-widget-scope-select:focus,
.amaratech-search-widget-scope-select:hover {
    border-color: var(--amaratech-services-accent, #c9f31d);
}

.amaratech-search-widget-select-arrow {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
}

/* Blocksy Theme Immunity on Input Field */
.amaratech-search-widget-input-field {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 1.05rem !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    background: transparent !important;
    padding: 0.4rem 0 !important;
    margin: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.amaratech-search-widget-input-field::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

.amaratech-search-widget-clear-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.amaratech-search-widget-clear-btn:hover {
    color: #0f172a;
    background-color: #f1f5f9;
}

/* Spinner */
.amaratech-search-widget-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--amaratech-services-accent, #c9f31d);
    border-radius: 50%;
    animation: amaratech-search-spin 0.6s linear infinite;
    display: none;
    flex-shrink: 0;
}

@keyframes amaratech-search-spin {
    to { transform: rotate(360deg); }
}

/* Live Results Area */
.amaratech-search-widget-results-area {
    max-height: 420px;
    overflow-y: auto;
    background-color: #ffffff;
}

.amaratech-search-widget-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none !important;
    color: #0f172a !important;
    transition: background-color 0.15s;
    cursor: pointer;
}

.amaratech-search-widget-result-item:last-child {
    border-bottom: none;
}

.amaratech-search-widget-result-item:hover,
.amaratech-search-widget-result-item.selected {
    background-color: #f4fce0;
}

.amaratech-search-widget-result-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
}

.amaratech-search-widget-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    overflow: hidden;
}

.amaratech-search-widget-result-icon img.amaratech-search-widget-result-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.amaratech-search-widget-result-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.amaratech-search-widget-result-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amaratech-search-widget-result-snippet {
    font-size: 0.825rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amaratech-search-widget-highlight {
    background-color: var(--amaratech-services-accent, #c9f31d);
    color: #000000;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Category Badges */
.amaratech-search-widget-result-tag {
    font-size: 0.725rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    background-color: #e2e8f0;
    color: #475569;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.amaratech-search-widget-tag-services { background-color: #dcfce7; color: #166534; }
.amaratech-search-widget-tag-projects { background-color: #fef3c7; color: #92400e; }
.amaratech-search-widget-tag-posts    { background-color: #dbeafe; color: #1e40af; }
.amaratech-search-widget-tag-page     { background-color: #f3e8ff; color: #6b21a8; }

/* Empty / Initial State */
.amaratech-search-widget-state-msg {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #64748b;
}

.amaratech-search-widget-state-msg svg {
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

.amaratech-search-widget-state-msg h4 {
    color: #0f172a;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.amaratech-search-widget-state-msg p {
    font-size: 0.875rem;
    color: #64748b;
}

/* Modal Footer Info Bar */
.amaratech-search-widget-footer {
    padding: 0.6rem 1.25rem;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
}

.amaratech-search-widget-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.85rem;
}

.amaratech-search-widget-footer-brand-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

