/* Modal Styles */
.analix-fg-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.analix-fg-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: analixFgModalIn 0.4s ease-out;
}

@keyframes analixFgModalIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.analix-fg-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.analix-fg-close:hover,
.analix-fg-close:focus {
    color: #333;
    text-decoration: none;
}

.analix-fg-modal-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: analixFgBounce 2s infinite;
}

@keyframes analixFgBounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

.analix-fg-modal h2 {
    color: #6D28D9;
    margin-top: 0;
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.analix-fg-modal p {
    color: #555;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.analix-fg-btn {
    display: inline-block;
    background-color: #6D28D9;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
}

.analix-fg-btn:hover {
    background-color: #5b21b6;
    color: white;
}

.analix-fg-btn:active {
    transform: scale(0.97);
}

.analix-fg-locked-qty {
    display: inline-block;
    padding: 5px 10px;
    background: #f1f1f1;
    border-radius: 4px;
    font-weight: bold;
    color: #555;
}

.analix-fg-cart-price-display {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.25;
}

.analix-fg-cart-original-price {
    color: #777;
    font-size: 0.92em;
}

.analix-fg-cart-free-price {
    color: #10b981;
    font-weight: 700;
}

/* Progress Bar */
.analix-fg-progress-wrapper {
    background: #f9f9fc;
    border: 1px solid #e1e1f0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.analix-fg-progress-wrapper.has-timeline {
    overflow: visible;
    padding-bottom: 22px;
}

.analix-fg-progress-text {
    font-size: 16px;
    color: #444;
    margin-bottom: 12px;
}

.analix-fg-progress-text strong {
    color: #6D28D9;
}

.analix-fg-progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.analix-fg-progress-fill {
    background: linear-gradient(90deg, #8B5CF6 0%, #6D28D9 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
    width: 0; /* Animated via inline style */
}

.analix-fg-progress-track {
    position: relative;
}

.analix-fg-progress-wrapper.has-timeline .analix-fg-progress-track {
    padding: 30px 0 34px;
}

.analix-fg-progress-milestones {
    position: absolute;
    inset: 30px 0 0;
    z-index: 2;
}

.analix-fg-progress-milestone {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
}

.analix-fg-timeline-peek {
    position: absolute;
    left: 50%;
    top: -32px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #6D28D9;
    border-radius: 50%;
    background: #fff;
    color: #6D28D9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.analix-fg-timeline-peek:hover,
.analix-fg-progress-milestone.is-open .analix-fg-timeline-peek {
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 5px 14px rgba(0,0,0,0.18);
}

.analix-fg-eye-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.analix-fg-timeline-point {
    position: absolute;
    left: 50%;
    top: -4px;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #6D28D9;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
}

.analix-fg-progress-milestone.is-achieved .analix-fg-timeline-point {
    background: #6D28D9;
}

.analix-fg-timeline-label {
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translateX(-50%);
    color: #555;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.analix-fg-progress-milestone.is-first .analix-fg-timeline-label {
    left: 0;
    transform: translateX(0);
}

.analix-fg-progress-milestone.is-last .analix-fg-timeline-label {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.analix-fg-timeline-popover {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 42px;
    transform: translateX(-50%);
    width: 240px;
    max-width: min(240px, calc(100vw - 36px));
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(15,23,42,0.18);
    padding: 12px;
    text-align: left;
    z-index: 20;
}

.analix-fg-progress-milestone.is-first .analix-fg-timeline-popover {
    left: 0;
    transform: translateX(0);
}

.analix-fg-progress-milestone.is-last .analix-fg-timeline-popover {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.analix-fg-progress-milestone.is-open .analix-fg-timeline-popover {
    display: block;
}

.analix-fg-timeline-popover-title {
    color: #333;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.analix-fg-timeline-gift {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.analix-fg-timeline-gift + .analix-fg-timeline-gift {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.analix-fg-timeline-gift-img,
.analix-fg-timeline-gift-img img,
.analix-fg-timeline-placeholder {
    width: 54px;
    height: 54px;
}

.analix-fg-timeline-gift-img img {
    display: block;
    object-fit: cover;
    border-radius: 6px;
}

.analix-fg-timeline-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 22px;
}

.analix-fg-timeline-gift-info {
    min-width: 0;
}

.analix-fg-timeline-gift-info strong {
    display: block;
    color: #222;
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.analix-fg-original-price {
    text-decoration: line-through;
    margin-right: 5px;
    color: #666;
}

.analix-fg-gratis-badge {
    color: #10b981;
    font-weight: 700;
}

.analix-fg-timeline-price {
    margin-top: 3px;
    font-size: 12px;
}

.analix-fg-timeline-qty {
    display: block;
    color: #64748b;
    font-size: 11px;
    margin-top: 2px;
}

@media (max-width: 767px) {
    .analix-fg-progress-wrapper.has-timeline {
        padding-left: 14px;
        padding-right: 14px;
    }

    .analix-fg-timeline-label {
        font-size: 10px;
    }

    .analix-fg-timeline-popover {
        width: 220px;
    }
}

/* Gift Cards */
.analix-fg-cards-section {
    margin-top: 40px;
    margin-bottom: 30px;
}

.analix-fg-cards-section h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #6D28D9;
    display: inline-block;
    padding-bottom: 5px;
}

/* Grid is now generated dynamically via inline CSS in class-analix-fg-frontend.php */

.analix-fg-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.analix-fg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.analix-fg-card.selected {
    border-color: #6D28D9;
    background: #fcfaff;
}

.analix-fg-card-img img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

.analix-fg-card h4 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #333;
}

.analix-fg-add-manual-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    width: 100%;
}

.analix-fg-add-manual-btn:hover:not(:disabled) {
    background: #059669;
}

.analix-fg-add-manual-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.analix-fg-card.selected .analix-fg-add-manual-btn {
    background: #6D28D9;
}

/* Unlocked Modal Gift Cards & View Button */
.analix-fg-modal-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.analix-fg-modal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
}
.analix-fg-modal-card.selected {
    border-color: #6D28D9 !important;
    background-color: #fbf8ff !important;
}
.analix-fg-progress-view-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}
.analix-fg-progress-view-btn:active {
    transform: scale(0.95);
}
.analix-fg-btn-close-scroll {
    background-color: #10b981 !important;
}
.analix-fg-btn-close-scroll:hover {
    background-color: #059669 !important;
}
