/* plant-matcher.css - Super Premium & Dynamic Styling */

:root {
    --matcher-primary: #10b981;
    --matcher-primary-glow: rgba(16, 185, 129, 0.4);
    --matcher-bg: rgba(15, 23, 42, 0.95);
    --matcher-glass-bg: rgba(255, 255, 255, 0.03);
    --matcher-glass-border: rgba(255, 255, 255, 0.1);
    --matcher-text: #f8fafc;
    --matcher-text-muted: #94a3b8;
}

.plant-matcher-modal {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15) 0%, rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
    overflow-y: auto;
    /* Allow whole modal to scroll on small screens */
}

.plant-matcher-modal.active {
    display: flex;
    opacity: 1;
}

.matcher-container {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    /* Don't exceed screen height */
    background: var(--matcher-bg);
    border: 1px solid var(--matcher-glass-border);
    border-radius: 40px;
    padding: 40px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 50px 0 rgba(16, 185, 129, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Header and Footer stay fixed, Step scrolls */
    color: var(--matcher-text);
    transform: translateY(40px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.plant-matcher-modal.active .matcher-container {
    transform: translateY(0) scale(1);
}

/* Background Animated Glows */
.matcher-container::before,
.matcher-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.matcher-container::before {
    top: -150px;
    left: -150px;
    background: var(--matcher-primary);
}

.matcher-container::after {
    bottom: -150px;
    right: -150px;
    background: #3b82f6;
}

.matcher-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    background: var(--matcher-glass-bg);
    border: 1px solid var(--matcher-glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    color: var(--matcher-text);
}

.matcher-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    color: white;
}

.matcher-header {
    text-align: center;
    margin-bottom: 30px;
    flex-shrink: 0;
}

.matcher-header .icon-box {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--matcher-primary), #34d399);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    color: #064e3b;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.matcher-header h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.matcher-header p {
    color: var(--matcher-text-muted);
    font-size: 15px;
}

.matcher-step {
    display: none;
    flex: 1;
    min-height: 320px;
    overflow-y: auto;
    /* Allow step content to scroll if it overflows */
    padding-right: 5px;
}

.matcher-step.active {
    display: flex;
    flex-direction: column;
    animation: stepIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.matcher-question {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
}

.matcher-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.matcher-option {
    background: var(--matcher-glass-bg);
    border: 1.5px solid var(--matcher-glass-border);
    padding: 20px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.matcher-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--matcher-primary);
    transform: translateY(-2px);
}

.matcher-option.selected {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--matcher-primary);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.matcher-option .option-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--matcher-primary);
    transition: inherit;
}

.matcher-option.selected .option-icon {
    background: var(--matcher-primary);
    color: #064e3b;
}

.option-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.option-details p {
    font-size: 13px;
    color: var(--matcher-text-muted);
}

.matcher-option .check-mark {
    margin-left: auto;
    width: 24px;
    height: 24px;
    background: var(--matcher-glass-bg);
    border: 2px solid var(--matcher-glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: all 0.3s ease;
}

.matcher-option.selected .check-mark {
    background: var(--matcher-primary);
    border-color: var(--matcher-primary);
    color: #064e3b;
}

.matcher-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    padding-top: 10px;
}

.matcher-progress-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.matcher-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--matcher-primary), #34d399);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px var(--matcher-primary-glow);
}

.matcher-btn {
    padding: 12px 28px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.matcher-btn.prev {
    background: var(--matcher-glass-bg);
    color: var(--matcher-text);
    border: 1px solid var(--matcher-glass-border);
}

.matcher-btn.prev:hover {
    background: rgba(255, 255, 255, 0.1);
}

.matcher-btn.next {
    background: var(--matcher-primary);
    color: #064e3b;
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.2);
}

.matcher-btn.next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(16, 185, 129, 0.3);
}

.matcher-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Loading State */
.matcher-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.loading-leaf {
    width: 80px;
    height: 80px;
    color: var(--matcher-primary);
    font-size: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    animation: pulseLeaf 2s infinite ease-in-out;
}

@keyframes pulseLeaf {

    0%,
    100% {
        transform: scale(1) rotate(0);
        filter: drop-shadow(0 0 5px var(--matcher-primary-glow));
    }

    50% {
        transform: scale(1.2) rotate(10deg);
        filter: drop-shadow(0 0 20px var(--matcher-primary-glow));
    }
}

/* Results Content */
.matcher-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 5px;
    /* Removed max-height to let the step handle scrolling */
}

.matcher-results-grid::-webkit-scrollbar {
    width: 6px;
}

.matcher-results-grid::-webkit-scrollbar-thumb {
    background: var(--matcher-glass-border);
    border-radius: 10px;
}

.result-card {
    background: var(--matcher-glass-bg);
    border: 1px solid var(--matcher-glass-border);
    border-radius: 24px;
    padding: 12px;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--matcher-primary);
    transform: translateY(-5px);
}

.result-match-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--matcher-primary);
    color: #064e3b;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.result-img-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.result-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.result-card:hover .result-img-box img {
    transform: scale(1.1);
}

.result-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
}

.result-info .price-tag {
    font-size: 14px;
    font-weight: 800;
    color: var(--matcher-primary);
}

.result-wishlist-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 32px;
    height: 32px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid var(--matcher-glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    color: white;
    transition: all 0.3s ease;
}

.result-wishlist-btn:hover {
    background: var(--matcher-primary);
    color: #064e3b;
    transform: scale(1.1);
}

.result-wishlist-btn.active {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.result-wishlist-btn.active i {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.result-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.result-view-btn {
    width: 32px;
    height: 32px;
    background: var(--matcher-primary);
    color: #064e3b;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Home Banner */
.matcher-banner {
    background: linear-gradient(135deg, #087c5b, #095c46, #032019);
    border-radius: 70px;
    padding: 25px;
    margin-top: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 120px;
    /* Precision Match: Reserve space for banner */
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 20px rgba(74, 222, 128, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Add subtle animation */
    animation: bannerGlow 3s infinite alternate;
}

.matcher-banner:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

@keyframes bannerGlow {
    0% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 20px rgba(74, 222, 128, 0.1);
    }

    100% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 30px rgba(74, 222, 128, 0.3);
    }
}

.matcher-banner-content {
    z-index: 2;
}

.matcher-banner-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.matcher-banner-content p {
    font-size: 13px;
    opacity: 0.8;
}

.matcher-banner-icon {
    font-size: 50px;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.matcher-banner-decor {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.2) 0%, transparent 70%);
    bottom: -30px;
    right: -20px;
    z-index: 0;
}

@media (max-width: 600px) {
    .matcher-container {
        padding: 30px 20px;
        border-radius: 30px;
    }

    .matcher-results-grid {
        grid-template-columns: 1fr;
    }

    .matcher-banner {
        padding: 25px;
        gap: 20px;
    }

    .matcher-banner-icon {
        width: 60px;
        height: 60px;
        font-size: 25px;
    }

    .matcher-banner-content h3 {
        font-size: 20px;
    }

    .matcher-banner-arrow {
        display: none;
    }
}
