/* Frontend Styles for Bandsintown Pro */

/* Container Styles */
.bandsintown-events-container {
    font-family: inherit;
    line-height: 1.6;
    position: relative;
}

.bandsintown-events-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* List Layout - Full Width with Right-Aligned Buttons */
.bandsintown-layout-list {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

/* Force layout on live sites with high specificity */
.elementor-widget-bandsintown-events .bandsintown-layout-list .bandsintown-event-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 16px !important;
    min-height: 100px !important;
}

.elementor-widget-bandsintown-events .bandsintown-layout-list .bandsintown-event-content {
    flex: 1 !important;
    display: block !important;
}

.elementor-widget-bandsintown-events .bandsintown-layout-list .bandsintown-event-buttons {
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
}

.bandsintown-layout-list .bandsintown-event-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100% !important;
    padding: 16px;
    background: #fff;
    transition: background-color 0.2s ease;
    gap: 16px !important;
    min-height: 100px;
}

.bandsintown-layout-list .bandsintown-event-separator {
    border: none;
    border-top: 1px solid #eee;
    margin: 0;
    width: 100%;
}

.bandsintown-layout-list .bandsintown-event-item:hover {
    background: #f8f9fa;
}

.bandsintown-layout-list .bandsintown-event-item:last-child {
    border-bottom: none;
}

.bandsintown-layout-list .bandsintown-event-image {
    width: 80px !important;
    height: 100% !important;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0 !important;
    background: #f5f5f5;
    display: block !important;
    align-self: stretch !important;
}

.bandsintown-layout-list .bandsintown-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bandsintown-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 0.8em;
    text-align: center;
}

.bandsintown-layout-list .bandsintown-event-content {
    flex: 1 !important;
    min-width: 0 !important;
    padding-top: 4px;
    display: block !important;
}

.bandsintown-layout-list .bandsintown-event-title {
    font-size: 1.1em;
    margin: 0 0 2px 0;
    font-weight: 600;
    line-height: 1.2;
}

.bandsintown-layout-list .bandsintown-event-date {
    font-size: 0.9em;
    margin: 0 0 2px 0;
    color: #666;
    line-height: 1.2;
}

.bandsintown-layout-list .bandsintown-event-time {
    margin-left: 8px;
}

.bandsintown-layout-list .bandsintown-event-venue {
    font-size: 0.9em;
    margin: 0;
    color: #666;
    line-height: 1.2;
}

.bandsintown-layout-list .bandsintown-event-location {
    display: none;
}

.bandsintown-layout-list .bandsintown-event-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    align-self: flex-start !important;
}

.bandsintown-layout-list .bandsintown-event-buttons .bandsintown-button {
    margin: 0;
    white-space: nowrap;
}

/* Separate button styling */
.bandsintown-tickets-button {
    /* Default styling - will be overridden by Elementor controls */
}

.bandsintown-rsvp-button {
    /* Default styling - will be overridden by Elementor controls */
}

/* Grid Layout */
.bandsintown-layout-grid {
    display: grid;
    gap: 20px;
}

.bandsintown-columns-1 {
    grid-template-columns: 1fr;
}

.bandsintown-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bandsintown-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bandsintown-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.bandsintown-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.bandsintown-layout-grid .bandsintown-event-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bandsintown-layout-grid .bandsintown-event-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007cba, #27ae60, #e74c3c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bandsintown-layout-grid .bandsintown-event-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #007cba;
}

.bandsintown-layout-grid .bandsintown-event-item:hover::before {
    opacity: 1;
}

.bandsintown-layout-grid .bandsintown-event-image {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f5f5f5;
}

.bandsintown-layout-grid .bandsintown-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Calendar Layout */
.bandsintown-layout-calendar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bandsintown-layout-calendar .bandsintown-event-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f9f9f9, #ffffff);
    border-left: 4px solid #007cba;
    padding: 18px 24px;
    border-radius: 0 12px 12px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bandsintown-layout-calendar .bandsintown-event-item:hover {
    background: linear-gradient(135deg, #ffffff, #f0f8ff);
    border-left-color: #27ae60;
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.bandsintown-layout-calendar .bandsintown-event-date {
    min-width: 120px;
    font-weight: 600;
    color: #007cba;
}

.bandsintown-layout-calendar .bandsintown-event-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 16px;
    background: #f5f5f5;
}

.bandsintown-layout-calendar .bandsintown-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bandsintown-layout-calendar .bandsintown-event-details {
    flex: 1;
    margin-left: 20px;
}

/* Event Item Elements */
.bandsintown-event-title {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.3;
}

.bandsintown-event-date {
    font-size: 1em;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
}

.bandsintown-event-time {
    font-weight: 400;
    opacity: 0.8;
}

.bandsintown-event-venue {
    font-size: 1.1em;
    font-weight: 500;
    color: #444;
    margin-bottom: 5px;
}

.bandsintown-event-location {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
}

/* Button Styles */
.bandsintown-event-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    justify-content: flex-start;
}

.bandsintown-button {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.bandsintown-button:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Track Artist Container */
.bandsintown-track-artist-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.bandsintown-track-artist-container .bandsintown-button {
    width: 100%;
    text-align: center;
}

/* No Events Message */
.bandsintown-no-events {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Loading State */
.bandsintown-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.bandsintown-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: bandsintown-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Error Message */
.bandsintown-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bandsintown-columns-2,
    .bandsintown-columns-3,
    .bandsintown-columns-4,
    .bandsintown-columns-6 {
        grid-template-columns: 1fr;
    }
    
    .bandsintown-layout-calendar .bandsintown-event-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bandsintown-layout-calendar .bandsintown-event-details {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .bandsintown-event-buttons {
        justify-content: center;
    }
    
    .bandsintown-button {
        flex: 1;
        min-width: 120px;
    }
    
    /* List layout mobile adjustments */
    .bandsintown-layout-list .bandsintown-event-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .bandsintown-layout-list .bandsintown-event-image {
        width: 100%;
        height: 200px;
        align-self: center;
        max-width: 300px;
    }
    
    .bandsintown-layout-list .bandsintown-event-content {
        order: 2;
    }
    
    .bandsintown-layout-list .bandsintown-event-buttons {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        margin-left: 0;
        order: 3;
    }
}

@media (max-width: 480px) {
    .bandsintown-event-item {
        padding: 15px !important;
    }
    
    .bandsintown-event-title {
        font-size: 1.2em;
    }
    
    .bandsintown-event-buttons {
        flex-direction: column;
    }
    
    .bandsintown-button {
        width: 100%;
        text-align: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bandsintown-layout-grid .bandsintown-event-item {
        background: #2c2c2c;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .bandsintown-event-title {
        color: #f0f0f0;
    }
    
    .bandsintown-event-date,
    .bandsintown-event-location {
        color: #bbb;
    }
    
    .bandsintown-event-venue {
        color: #ddd;
    }
    
    .bandsintown-layout-calendar .bandsintown-event-item {
        background: #2c2c2c;
        color: #e0e0e0;
    }
}

/* Accessibility */
.bandsintown-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.bandsintown-event-item:focus-within {
    outline: 1px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .bandsintown-event-buttons {
        display: none;
    }
    
    .bandsintown-layout-grid {
        grid-template-columns: 1fr !important;
    }
    
    .bandsintown-event-item {
        break-inside: avoid;
        border: 1px solid #000 !important;
        margin-bottom: 15px;
    }
}