/* ==========================================
   MORPH LIBRARY STYLES
   Searchable/Filterable Morph Database UI
   ========================================== */

/* Morph Library Section */
.morph-library {
    background: linear-gradient(180deg, rgba(120, 200, 80, 0.05), hsl(220, 15%, 10%));
}

/* Library Controls (Search + Filters) */
.library-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    align-items: center;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    background: hsl(220, 15%, 12%);
    color: hsl(0, 0%, 95%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: hsl(120, 65%, 45%);
    box-shadow: 0 0 0 3px rgba(120, 200, 80, 0.1);
}

.search-input::placeholder {
    color: hsl(0, 0%, 50%);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: hsl(220, 15%, 15%);
    color: hsl(0, 0%, 70%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    border-color: hsl(120, 65%, 45%);
    color: hsl(0, 0%, 95%);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, hsl(120, 65%, 45%), hsl(35, 85%, 55%));
    color: hsl(220, 15%, 10%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(120, 200, 80, 0.3);
}

/* Morph Grid */
.morph-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Morph Card */
.morph-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.morph-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(120, 200, 80, 0.2);
    border-color: hsl(120, 65%, 45%);
}

/* Morph Image Container */
.morph-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(120, 200, 80, 0.1), rgba(255, 165, 60, 0.1));
}

/* Actual Morph Image */
.morph-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.morph-card:hover .morph-image {
    transform: scale(1.05);
}

/* Morph Image Placeholder */
.morph-image-placeholder {
    background: linear-gradient(135deg, rgba(120, 200, 80, 0.2), rgba(255, 165, 60, 0.2));
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.morph-image-placeholder span {
    font-size: 4rem;
    opacity: 0.6;
    animation: pulse 3s infinite;
}

.morph-placeholder-text {
    color: hsl(0, 0%, 70%);
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    margin-top: 0.5rem;
    text-align: center;
    opacity: 0.8;
}

/* Morph Card Content */
.morph-card-content {
    padding: 1.5rem;
}

.morph-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.morph-card-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: hsl(0, 0%, 95%);
    flex: 1;
    line-height: 1.3;
}

.warning-icon {
    margin-left: 0.5rem;
    font-size: 1.2rem;
    cursor: help;
    animation: pulse 2s infinite;
}

.morph-card-description {
    color: hsl(0, 0%, 70%);
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.super-form {
    color: hsl(35, 85%, 55%);
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    margin-bottom: 0.5rem;
}

.morph-market-value {
    color: hsl(0, 0%, 50%);
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    margin-bottom: 1.5rem;
}

/* Add to Calculator Button */
.btn-add-to-calc {
    width: 100%;
    padding: 1rem;
    background: hsl(220, 15%, 15%);
    color: hsl(120, 65%, 45%);
    border: 2px solid hsl(120, 65%, 45%);
    border-radius: 8px;
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-to-calc:hover {
    background: hsl(120, 65%, 45%);
    color: hsl(220, 15%, 10%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(120, 200, 80, 0.3);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: hsl(0, 0%, 70%);
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    grid-column: 1 / -1;
}

.no-results p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .morph-library-grid {
        grid-template-columns: 1fr;
    }

    .library-controls {
        width: 100%;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        min-width: 100px;
    }

    .morph-image-placeholder {
        height: 180px;
    }

    .morph-image-placeholder span {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .morph-library-grid {
        gap: 1.5rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Flash animation for already-selected feedback */
@keyframes flash {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(120, 200, 80, 0.3);
    }
}