/* VTS Events Elementor Widget Styles */

/* Import Lato Font */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

/* Reset and Base Styles for Elementor Widget */
.vts-elementor-widget {
    font-family: 'Lato', sans-serif;
    width: 100%;
}

/* Header Styles */
.vts-events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.vts-events-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.vts-view-all {
    color: #D2691E;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.vts-view-all:hover {
    color: #B8860B;
}

/* Events Grid - Base Styles */
.vts-events-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

/* Event Card Base Styles */
.vts-event-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.vts-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Image Container */
.vts-event-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.vts-event-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.vts-event-placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

/* Date/Time Overlay */
.vts-event-datetime-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Event Content */
.vts-event-content {
    background: #4A2C1F;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.vts-event-title {
    color: #F5F5DC;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    margin: 0 0 15px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.vts-event-yellow-border {
    width: 100%;
    height: 2px;
    background: #FFD700;
    margin-top: auto;
    margin-bottom: 15px;
    position: absolute;
    bottom: 15px;
    left: 20px;
    right: 20px;
}

.vts-event-link {
    color: #F5F5DC;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    margin-top: auto;
    padding-top: 10px;
}

.vts-event-link:hover {
    color: #FFD700;
}

.vts-arrow {
    color: #FFD700;
    margin-left: 5px;
    font-weight: bold;
}

/* Card Link Styles */
.vts-event-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.vts-event-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Layout Classes - Desktop (Default) */
.vts-layout-side_by_side .vts-events-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.vts-layout-one_after_one .vts-events-grid {
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Layout Classes - Tablet */
@media (max-width: 1024px) and (min-width: 768px) {
    .vts-layout-tablet-side_by_side .vts-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .vts-layout-tablet-one_after_one .vts-events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .vts-events-title {
        font-size: 24px;
    }
    
    .vts-event-title {
        font-size: 16px;
    }
    
    .vts-event-datetime-overlay {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Layout Classes - Mobile */
@media (max-width: 767px) {
    .vts-layout-mobile-side_by_side .vts-events-grid {
        grid-template-columns: 1fr; /* Force single column for mobile */
        gap: 15px;
    }
    
    .vts-layout-mobile-one_after_one .vts-events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Force single column for fallback cards on mobile */
    .vts-fallback-card {
        grid-column: 1;
    }
    
    .vts-events-container {
        padding: 15px;
    }
    
    .vts-events-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .vts-events-title {
        font-size: 20px;
        font-family: 'Lato', sans-serif;
        font-weight: 700;
    }
    
    .vts-event-title {
        font-size: 14px;
        font-weight: 700;
        font-family: 'Lato', sans-serif;
        margin-bottom: 12px;
        line-height: 1.2;
    }
    
    .vts-event-datetime-overlay {
        font-size: 10px;
        font-weight: 700;
        font-family: 'Lato', sans-serif;
        padding: 4px 6px;
    }
    
    .vts-event-link {
        font-size: 10px;
        font-weight: 700;
        font-family: 'Lato', sans-serif;
    }
    
    .vts-event-content {
        padding: 15px;
    }
}

/* Extra small mobile screens - force single column */
@media (max-width: 480px) {
    .vts-events-grid {
        grid-template-columns: 1fr !important;
    }
    
    .vts-event-title {
        font-size: 12px;
    }
    
    .vts-event-datetime-overlay {
        font-size: 8px;
        padding: 3px 5px;
    }
    
    .vts-event-link {
        font-size: 8px;
    }
}

/* Fix for white space issue in desktop 3-column layout */
.vts-layout-side_by_side .vts-events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    justify-items: stretch;
}

.vts-layout-side_by_side .vts-event-card {
    width: 100%;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Ensure proper spacing and alignment */
.vts-events-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Responsive adjustments for different screen sizes */
@media (min-width: 1200px) {
    .vts-events-container {
        max-width: 1200px;
    }
    
    .vts-layout-side_by_side .vts-events-grid {
        gap: 40px;
    }
}

@media (min-width: 1400px) {
    .vts-layout-side_by_side .vts-events-grid {
        gap: 50px;
    }
}

/* Hover effects */
.vts-event-card.hovered {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
}

.vts-event-card.hovered .vts-event-link {
    color: #FFD700 !important;
}

/* Loading animation */
.vts-events-container.loaded .vts-event-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.vts-events-container.loaded .vts-event-card:nth-child(2) {
    animation-delay: 0.1s;
}

.vts-events-container.loaded .vts-event-card:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Date/Time overlay position adjustments */
.vts-event-datetime-overlay.below-image {
    position: static !important;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: none !important;
}

/* Ensure proper image aspect ratios */
.vts-event-image-container {
    aspect-ratio: 16/9;
    min-height: 150px;
}

/* Fix for Elementor editor preview */
.elementor-editor .vts-events-container {
    min-height: 200px;
}

/* Ensure cards fill available space properly */
.vts-layout-side_by_side .vts-event-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vts-layout-side_by_side .vts-event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Fallback card styles */
.vts-fallback-card {
    opacity: 0.8;
}

.vts-fallback-card .vts-event-placeholder-image {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #666;
    font-size: 16px;
}

/* Ensure fallback cards maintain 3-card layout on desktop */
@media (min-width: 768px) {
    .vts-fallback-card {
        grid-column: auto;
    }
    
    .vts-events-grid:has(.vts-fallback-card) {
        grid-template-columns: repeat(3, 1fr);
    }
}
