/* Premium Frontend CSS for Krafty Gift Finder */

:root {
    --kfgf-primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --kfgf-secondary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --kfgf-dark-slate: #0f172a;
    --kfgf-card-bg: rgba(255, 255, 255, 0.85);
    --kfgf-glass-border: rgba(255, 255, 255, 0.4);
    --kfgf-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    --kfgf-text-dark: #1e293b;
    --kfgf-text-muted: #64748b;
    --kfgf-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.kfgf-wizard-container {
    font-family: var(--kfgf-font);
    max-width: 100%;
    margin: 40px auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
}

.kfgf-wizard-container *,
.kfgf-wizard-container *::before,
.kfgf-wizard-container *::after {
    box-sizing: border-box;
}

.kfgf-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    position: relative;
    overflow: visible;
}

/* Progress bar styling */
.kfgf-progress-wrapper {
    margin-bottom: 30px;
}

.kfgf-progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 12px;
}

.kfgf-progress-fill {
    height: 100%;
    background: var(--kfgf-primary-gradient);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.kfgf-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100*);
    animation: kfgf-progress-shine 2s infinite linear;
}

.kfgf-step-info {
    display: flex;
    justify-content: flex-end;
}

.kfgf-step-counter {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

/* Question Title */
.kfgf-question-title {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
    line-height: 1.2;
}

/* Choices Grid */
.kfgf-choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
    min-height: 150px;
    justify-content: center;
}

/* On mobile, force 2 columns for clean alignment */
@media (max-width: 480px) {
    .kfgf-choices-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.kfgf-choice-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.kfgf-choice-card:hover {
    transform: translateY(-2px);
    border-color: #a855f7;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
}

.kfgf-choice-card.selected {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.02);
    box-shadow: 0 0 0 1px #a855f7, 0 4px 12px rgba(168, 85, 247, 0.12);
}

.kfgf-choice-label {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Loader */
.kfgf-spinner-wrapper {
    grid-column: span 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.kfgf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.05);
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    animation: kfgf-spin 0.8s linear infinite;
}

/* Navigation Buttons */
.kfgf-navigation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 24px;
    margin-top: 10px;
}

.kfgf-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.kfgf-btn-back {
    background: transparent;
    color: var(--kfgf-text-muted);
}

.kfgf-btn-back:hover {
    color: var(--kfgf-text-dark);
    background: rgba(0, 0, 0, 0.03);
}

.kfgf-btn-next {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.25);
    margin-left: auto;
    padding: 12px 32px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
}

.kfgf-btn-next:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.kfgf-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Template */
.kfgf-results-header {
    text-align: center;
    margin-bottom: 30px;
}

.kfgf-results-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--kfgf-text-dark);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.kfgf-results-desc {
    font-size: 15px;
    color: var(--kfgf-text-muted);
    margin: 0;
}

/* Results Grid */
.kfgf-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 580px) {
    .kfgf-results-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Card */
.kfgf-product-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.kfgf-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.08);
}

.kfgf-product-image-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    margin-bottom: 12px;
    background: #f8fafc;
}

.kfgf-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.kfgf-product-card:hover .kfgf-product-image {
    transform: scale(1.06);
}

.kfgf-product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.kfgf-product-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--kfgf-text-dark);
    margin: 0 0 6px 0;
    line-height: 1.3;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kfgf-product-price {
    font-size: 16px;
    font-weight: 800;
    color: #a855f7;
    margin-bottom: 12px;
}

.kfgf-product-meta {
    font-size: 12px;
    color: var(--kfgf-text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kfgf-product-meta strong {
    color: var(--kfgf-text-dark);
}

.kfgf-product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.kfgf-product-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.kfgf-btn-view {
    background: #f1f5f9;
    color: #475569;
}

.kfgf-btn-view:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.kfgf-btn-cart {
    background: var(--kfgf-primary-gradient);
    color: #fff;
}

.kfgf-btn-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.kfgf-btn-whatsapp {
    background: #25d366;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.kfgf-btn-whatsapp:hover {
    background: #20ba5a;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.35);
}

/* Fallback contact section */
.kfgf-fallback-banner {
    background: #fff;
    border: 1px dashed rgba(0, 0, 0, 0.12);
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    margin-top: 30px;
}

.kfgf-fallback-banner h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--kfgf-text-dark);
}

.kfgf-fallback-banner p {
    font-size: 14px;
    color: var(--kfgf-text-muted);
    margin: 0 0 16px 0;
}

.kfgf-results-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* Keyframes */
@keyframes kfgf-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes kfgf-progress-shine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* Card layout when it contains an image (Rokomari layout) */
.kfgf-choice-card.has-image {
    padding: 16px 8px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Circular choice image/icon container (Rokomari style) */
.kfgf-choice-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    /* Perfect circular avatars/badges */
    object-fit: cover;
    margin-bottom: 12px;
    background-color: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

/* Zoom/Bounce effect on hover */
.kfgf-choice-card.has-image:hover .kfgf-choice-image {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* Adjust label size inside image-based cards */
.kfgf-choice-card.has-image .kfgf-choice-label {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
}

/* Hide navigation footer and progress bar when disabled in settings */
.kfgf-hide-navigation .kfgf-navigation-footer,
.kfgf-hide-navigation .kfgf-progress-wrapper {
    display: none !important;
}