/**
 * FitLife Ads Elementor Widget Styles
 *
 * Modern, responsive styling for the FitLife Ads Elementor widget
 */

/* Container Styles */
.fitlife-ads-container {
    width: 100%;
    margin: 0 auto;
}

/* Grid Layout */
.fitlife-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: start;
}

/* Stack Layout */
.fitlife-ads-stack {
    display: flex;
    flex-direction: column;
}

.fitlife-ads-stack .fitlife-ad-item:not(:last-child) {
    margin-bottom: 20px;
}

/* Inline Layout */
.fitlife-ads-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.fitlife-ads-inline .fitlife-ad-item:not(:last-child) {
    margin-right: 20px;
}

/* Carousel Layout */
.fitlife-ads-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 10px;
}

.fitlife-ads-carousel .fitlife-ad-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 250px;
}

.fitlife-ads-carousel::-webkit-scrollbar {
    height: 6px;
}

.fitlife-ads-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fitlife-ads-carousel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.fitlife-ads-carousel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Individual Ad Item */
.fitlife-ad-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.fitlife-ad-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Ad Content */
.fitlife-ad-content {
    position: relative;
    width: 100%;
}

.fitlife-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fitlife-ad-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Ad Images */
.fitlife-ad-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.fitlife-ad-item:hover .fitlife-ad-image {
    transform: scale(1.02);
}

/* Ad Text Content */
.fitlife-ad-text {
    padding: 20px;
    text-align: center;
}

.fitlife-ad-text h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.fitlife-ad-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Ad HTML Content */
.fitlife-ad-html {
    padding: 15px;
}

.fitlife-ad-html * {
    max-width: 100%;
}

/* Ad Title */
.fitlife-ad-title {
    margin: 0 0 15px 0;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    line-height: 1.4;
}

/* Hover Effects */
.hover-effect-scale .fitlife-ad-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-effect-scale .fitlife-ad-item:hover {
    transform: scale(1.05);
}

.hover-effect-lift .fitlife-ad-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-effect-lift .fitlife-ad-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.hover-effect-glow .fitlife-ad-item {
    transition: box-shadow 0.3s ease;
}

.hover-effect-glow .fitlife-ad-item:hover {
    box-shadow: 0 0 25px rgba(52, 152, 219, 0.5);
}

/* Error State */
.fitlife-ad-error {
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fitlife-ads-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .fitlife-ads-inline {
        flex-direction: column;
    }
    
    .fitlife-ads-inline .fitlife-ad-item:not(:last-child) {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .fitlife-ads-carousel .fitlife-ad-item {
        min-width: 200px;
    }
    
    .fitlife-ad-text {
        padding: 15px;
    }
    
    .fitlife-ad-title {
        font-size: 14px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .fitlife-ads-carousel .fitlife-ad-item {
        min-width: 180px;
    }
    
    .fitlife-ad-text h3 {
        font-size: 16px;
    }
    
    .fitlife-ad-text p {
        font-size: 13px;
    }
}

/* Loading State */
.fitlife-ads-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.fitlife-ads-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.fitlife-ad-link:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.fitlife-ad-item:focus-within {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Print Styles */
@media print {
    .fitlife-ads-container {
        break-inside: avoid;
    }
    
    .fitlife-ad-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hover-effect-scale .fitlife-ad-item:hover,
    .hover-effect-lift .fitlife-ad-item:hover,
    .hover-effect-glow .fitlife-ad-item:hover {
        transform: none;
        box-shadow: none;
    }
}
