/**
 * Enhanced Seed Card Styles
 */

/* Seed List Grid Layout */
.esc-enhanced-catalog .esc-seed-list,
.esc-enhanced-catalog .esc-seed-list.esc-enhanced-grid,
.esc-seed-grid.esc-enhanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
    width: 100%;
}

/* Enhanced Seed Card */
.esc-enhanced-catalog .esc-seed-card {
    position: relative;
    border: none !important;
    border-radius: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

.esc-enhanced-catalog .esc-seed-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Card Image Container */
.esc-enhanced-catalog .esc-seed-image-container {
    position: relative !important;
    width: 100% !important;
    height: 180px !important;
    overflow: hidden !important;
    background-color: #f8f9fa !important;
    margin: 0 !important;
    padding: 0 !important;
}

.esc-enhanced-catalog .esc-seed-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    display: block !important;
}

.esc-enhanced-catalog .esc-seed-card:hover .esc-seed-image {
    transform: scale(1.05) !important;
}

/* No Image Placeholder and Error States */
.esc-enhanced-catalog .esc-image-error {
    position: relative !important;
    border: 2px solid #e53e3e !important;
    background-color: #fff8f8 !important;
}

.esc-enhanced-catalog .esc-image-error::after {
    content: '⚠️ Image Error' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: rgba(229, 62, 62, 0.8) !important;
    color: white !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
    text-align: center !important;
}

/* Image Loaded State */
.esc-enhanced-catalog .esc-image-loaded {
    border: 2px solid #48bb78 !important;
}

.esc-enhanced-catalog .esc-no-image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #f0f4f8 !important;
    color: #a0aec0 !important;
    font-size: 40px !important;
}

/* Card Content */
.esc-enhanced-catalog .esc-card-content {
    padding: 20px !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    background-color: #fff !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Card Header */
.esc-enhanced-catalog .esc-seed-card h3 {
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    line-height: 1.3 !important;
    padding: 0 !important;
    text-align: left !important;
    border: none !important;
    background: none !important;
}

.esc-enhanced-catalog .esc-card-description {
    margin: 0 0 15px 0 !important;
    font-size: 14px !important;
    color: #4a5568 !important;
    line-height: 1.5 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
}

.esc-enhanced-catalog .esc-seed-card .esc-variety-name {
    color: #4a5568 !important;
    font-weight: normal !important;
    font-style: italic !important;
    display: inline-block !important;
    margin-left: 5px !important;
}

/* Card Fields */
.esc-enhanced-catalog .esc-seed-card .esc-field {
    margin-bottom: 10px !important;
    font-size: 14px !important;
    display: flex !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.esc-enhanced-catalog .esc-seed-card .esc-field-label {
    color: #718096 !important;
    font-weight: 500 !important;
    min-width: 80px !important;
    margin-right: 8px !important;
    text-align: left !important;
}

.esc-enhanced-catalog .esc-seed-card .esc-field-value {
    color: #4a5568 !important;
    flex: 1 !important;
    text-align: left !important;
}

/* Categories */
.esc-enhanced-catalog .esc-seed-card .esc-categories {
    margin-top: auto !important;
    padding-top: 15px !important;
    border-top: 1px solid #edf2f7 !important;
    font-size: 13px !important;
    color: #718096 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    width: 100% !important;
}

.esc-enhanced-catalog .esc-seed-card .esc-category-tag {
    display: inline-block !important;
    padding: 3px 8px !important;
    background-color: #ebf8ff !important;
    color: #3182ce !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    margin: 2px !important;
    border: none !important;
}

.esc-enhanced-catalog .esc-seed-card .esc-category-tag:hover {
    background-color: #bee3f8 !important;
    color: #2c5282 !important;
    text-decoration: none !important;
}

/* Card Actions */
.esc-enhanced-catalog .esc-card-actions {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    display: flex !important;
    gap: 5px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: 10 !important;
}

.esc-enhanced-catalog .esc-seed-card:hover .esc-card-actions {
    opacity: 1 !important;
}

.esc-enhanced-catalog .esc-card-action-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #4a5568 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.esc-enhanced-catalog .esc-card-action-btn:hover {
    background-color: #fff !important;
    color: #3182ce !important;
    transform: scale(1.1) !important;
}

/* Card Badges */
.esc-enhanced-catalog .esc-card-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: white !important;
    background-color: #4299e1 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    z-index: 10 !important;
    border: none !important;
    margin: 0 !important;
}

.esc-enhanced-catalog .esc-card-badge.new {
    background-color: #48bb78 !important;
}

.esc-enhanced-catalog .esc-card-badge.featured {
    background-color: #ed8936 !important;
}

/* Enhanced Modal Styles */
.esc-enhanced-catalog .esc-modal,
.esc-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(5px) !important;
}

.esc-enhanced-catalog .esc-modal-content,
.esc-modal-content {
    position: relative !important;
    background: #fff !important;
    margin: 30px auto !important;
    padding: 0 !important;
    max-width: 1000px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(30px) !important;
    opacity: 0 !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
    overflow: hidden !important;
}

.esc-enhanced-catalog .esc-modal.show,
.esc-modal.show {
    display: block !important;
}

.esc-enhanced-catalog .esc-modal.show .esc-modal-content,
.esc-modal.show .esc-modal-content {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

.esc-enhanced-catalog .esc-modal-close,
.esc-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    font-size: 24px !important;
    cursor: pointer !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    text-align: center !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #4a5568 !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.esc-enhanced-catalog .esc-modal-close:hover,
.esc-modal-close:hover {
    background: #fff !important;
    color: #e53e3e !important;
    transform: rotate(90deg) !important;
}

/* Enhanced Seed Detail Styles */
.esc-seed-detail {
    color: #2d3748;
}

.esc-seed-detail-header {
    position: relative;
    padding: 0;
    margin-bottom: 0;
    display: block;
}

.esc-seed-detail-banner {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: #f7fafc;
    overflow: hidden;
}

.esc-seed-detail-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.esc-seed-detail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
}

.esc-seed-detail-overlay h2 {
    margin: 0 0 5px 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.esc-seed-detail-overlay .esc-variety-name {
    font-weight: 400;
}

.esc-seed-detail-brand {
    font-size: 16px;
    opacity: 0.9;
}

.esc-seed-detail-content {
    padding: 30px;
}

.esc-seed-detail-description {
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
    color: #4a5568;
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

.esc-seed-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.esc-seed-detail-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #edf2f7;
}

.esc-seed-detail-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    color: #2d3748;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
}

.esc-seed-detail-field {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.esc-seed-detail-field:last-child {
    margin-bottom: 0;
}

.esc-seed-detail-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
    font-size: 14px;
}

.esc-seed-detail-value {
    color: #2d3748;
    font-size: 15px;
    line-height: 1.5;
}

/* Category Tags in Detail View */
.esc-seed-detail-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.esc-seed-detail-category {
    padding: 5px 12px;
    background-color: #ebf8ff;
    color: #3182ce;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.esc-seed-detail-category:hover {
    background-color: #bee3f8;
    color: #2c5282;
    text-decoration: none;
}

/* Loading State */
.esc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #4a5568;
    font-size: 16px;
}

.esc-loading:before {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    margin-right: 10px;
    animation: esc-spin 1s linear infinite;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
    .esc-enhanced-catalog .esc-seed-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 15px !important;
    }

    .esc-enhanced-catalog .esc-seed-image-container {
        height: 150px !important;
    }

    .esc-enhanced-catalog .esc-card-content {
        padding: 15px !important;
    }

    .esc-enhanced-catalog .esc-seed-card h3 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .esc-seed-detail-banner {
        height: 200px;
    }

    .esc-seed-detail-overlay {
        padding: 20px;
    }

    .esc-seed-detail-overlay h2 {
        font-size: 24px;
    }

    .esc-seed-detail-content {
        padding: 20px;
    }

    .esc-seed-detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Print Styles */
@media print {
    .esc-seed-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .esc-card-actions,
    .esc-modal-close {
        display: none;
    }

    .esc-seed-detail-grid {
        display: block;
    }

    .esc-seed-detail-section {
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
