/**
 * Listing Image Widget Styles
 * Professional & Light Responsive Design with Custom Fields
 */

.mcl-listing-wrapper {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.mcl-listing-image {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px;
    overflow: hidden;
    background: #d8d8d8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mcl-listing-image:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.mcl-listing-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mcl-listing-image:hover img {
    transform: scale(1.02);
}

/* No Image Placeholder */
.mcl-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

/* Section Title */
.mcl-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    margin: 20px 0 15px 0;
    padding: 0;
    line-height: 1.4;
}

/* Custom Fields Container */
.mcl-custom-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mcl-fields-above {
    margin-bottom: 20px;
}

.mcl-fields-below {
    margin-top: 20px;
}

.mcl-fields-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
}

/* Field Item */
.mcl-field-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mcl-field-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mcl-field-icon {
    font-size: 18px;
    color: #666666;
    min-width: 20px;
    text-align: center;
}

.mcl-field-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
}

.mcl-field-value {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    white-space: nowrap;
}

/* Responsive Design */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .mcl-listing-image {
        min-height: 250px;
    }
    
    .mcl-custom-fields {
        gap: 12px;
        padding: 12px 15px;
    }
    
    .mcl-field-item {
        padding: 6px 10px;
    }
    
    .mcl-field-icon {
        font-size: 16px;
    }
    
    .mcl-field-value {
        font-size: 13px;
    }
}

/* Mobile (480px - 768px) */
@media (max-width: 768px) {
    .mcl-listing-image {
        min-height: 200px;
        border-radius: 8px;
    }
    
    .mcl-custom-fields {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 6px;
    }
    
    .mcl-fields-above {
        margin-bottom: 15px;
    }
    
    .mcl-fields-below {
        margin-top: 15px;
    }
    
    .mcl-field-item {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .mcl-field-icon {
        font-size: 14px;
        min-width: 16px;
    }
    
    .mcl-field-value {
        font-size: 12px;
    }
    
    .mcl-no-image {
        font-size: 16px;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .mcl-listing-image {
        min-height: 180px;
        border-radius: 6px;
    }
    
    .mcl-custom-fields {
        gap: 8px;
        padding: 8px 10px;
    }
    
    .mcl-fields-above {
        margin-bottom: 12px;
    }
    
    .mcl-fields-below {
        margin-top: 12px;
    }
    
    .mcl-field-item {
        padding: 4px 6px;
        gap: 6px;
    }
    
    .mcl-field-icon {
        font-size: 12px;
        min-width: 14px;
    }
    
    .mcl-field-value {
        font-size: 11px;
    }
    
    .mcl-no-image {
        font-size: 14px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mcl-listing-wrapper {
    animation: fadeIn 0.5s ease-in-out;
}

/* Hover Effects */
.mcl-listing-image:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Description Section */
.mcl-description-section {
    margin-top: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mcl-description-title {
    margin-top: 0;
    margin-bottom: 15px;
}

.mcl-description-content {
    font-size: 15px;
    line-height: 1.8;
    color: #555555;
    text-align: justify;
}

.mcl-description-content p {
    margin-bottom: 15px;
}

.mcl-description-content p:last-child {
    margin-bottom: 0;
}

.mcl-description-content h1,
.mcl-description-content h2,
.mcl-description-content h3,
.mcl-description-content h4,
.mcl-description-content h5,
.mcl-description-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333333;
}

.mcl-description-content ul,
.mcl-description-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.mcl-description-content li {
    margin-bottom: 8px;
}

.mcl-description-content a {
    color: #4A90E2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mcl-description-content a:hover {
    color: #357ABD;
    text-decoration: underline;
}

.mcl-description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

.mcl-description-content blockquote {
    border-left: 4px solid #4A90E2;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666666;
}

/* RTL Support */
[dir="rtl"] .mcl-field-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .mcl-description-content {
    text-align: justify;
    direction: rtl;
}

[dir="rtl"] .mcl-description-content ul,
[dir="rtl"] .mcl-description-content ol {
    padding-left: 0;
    padding-right: 25px;
}

[dir="rtl"] .mcl-description-content blockquote {
    border-left: none;
    border-right: 4px solid #4A90E2;
    padding-left: 0;
    padding-right: 20px;
}

/* Print Styles */
@media print {
    .mcl-listing-image {
        box-shadow: none;
    }
    
    .mcl-custom-fields {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .mcl-field-item {
        background: #fff;
        border: 1px solid #eee;
    }
}

/* Loading State */
.mcl-listing-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility */
.mcl-field-item:focus-within {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mcl-custom-fields {
        background-color: #2d2d2d;
    }
    
    .mcl-field-item {
        background: #3a3a3a;
    }
    
    .mcl-field-item:hover {
        background: #454545;
    }
    
    .mcl-field-icon {
        color: #aaaaaa;
    }
    
    .mcl-field-value {
        color: #e0e0e0;
    }
}
