/**
 * MG Events Manager - Frontend Styles
 * Brand Colors: Teal #2ba896, Orange #f39237
 */

/* ==========================================================================
   EVENT CARDS - GRID LAYOUT
   ========================================================================== */

.mg-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.mg-event-card-grid {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mg-event-card-grid:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.mg-event-card-grid .mg-event-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.mg-event-card-grid .mg-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-event-card-grid .mg-event-content {
    padding: 20px;
}

/* ==========================================================================
   EVENT CARDS - LIST LAYOUT
   ========================================================================== */

.mg-events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.mg-event-card-list {
    display: flex;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
}

.mg-event-card-list:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mg-event-card-list .mg-event-image {
    flex: 0 0 200px;
    position: relative;
}

.mg-event-card-list .mg-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-event-card-list .mg-event-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ==========================================================================
   EVENT CARDS - MINIMAL LAYOUT
   ========================================================================== */

.mg-events-minimal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.mg-event-card-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #2ba896;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.mg-event-card-minimal .mg-event-title {
    margin: 0;
    font-size: 16px;
}

.mg-event-card-minimal .mg-event-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

/* ==========================================================================
   SHARED CARD ELEMENTS
   ========================================================================== */

.mg-event-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.mg-badge-cancelled {
    background: #dc3545;
    color: #fff;
}

.mg-badge-postponed {
    background: #ffc107;
    color: #000;
}

.mg-badge-featured {
    background: #f39237;
    color: #fff;
}

.mg-event-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.mg-event-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.mg-event-title a:hover {
    color: #2ba896;
}

.mg-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.mg-event-venue,
.mg-event-price {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.mg-event-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.mg-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.mg-btn-primary {
    background: #2ba896;
    color: #fff !important;
}

.mg-btn-primary:hover {
    background: #239382;
    color: #fff !important;
    transform: translateY(-2px);
}

.mg-btn-secondary {
    background: #f5f5f5;
    color: #333 !important;
}

.mg-btn-secondary:hover {
    background: #e8e8e8;
    color: #333 !important;
}

.mg-btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* ==========================================================================
   POWERED BY BADGE
   ========================================================================== */

.mg-powered-by {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    padding: 6px 12px;
    background: #026cdf;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

/* ==========================================================================
   TICKET WIDGET
   ========================================================================== */

.mg-ticket-widget {
    background: linear-gradient(135deg, #2ba896 0%, #239382 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    color: #fff;
}

.mg-ticket-prices {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.mg-ticket-widget .mg-btn-primary {
    background: #fff;
    color: #2ba896 !important;
    font-size: 18px;
    padding: 15px 40px;
}

.mg-ticket-widget .mg-btn-primary:hover {
    background: #f5f5f5;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.mg-ticket-widget .mg-powered-by {
    background: rgba(255,255,255,0.2);
    margin-top: 20px;
}

.mg-ticket-status {
    display: block;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 16px;
}

.mg-status-cancelled {
    background: rgba(220,53,69,0.2);
}

.mg-status-postponed {
    background: rgba(255,193,7,0.2);
}

/* ==========================================================================
   SINGLE EVENT PAGE
   ========================================================================== */

.mg-single-event {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.mg-event-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
}

.mg-event-hero img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.mg-event-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.mg-event-hero h1 {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 700;
}

.mg-event-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 16px;
}

.mg-event-hero-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mg-event-status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 15px;
}

.mg-status-onsale {
    background: #28a745;
    color: #fff;
}

.mg-status-offsale {
    background: #6c757d;
    color: #fff;
}

.mg-status-cancelled {
    background: #dc3545;
    color: #fff;
}

.mg-status-postponed {
    background: #ffc107;
    color: #000;
}

/* Content Sections */
.mg-event-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mg-event-section h2 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-event-section p {
    margin: 0 0 15px 0;
    line-height: 1.7;
    color: #444;
}

.mg-event-section ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
    color: #444;
}

/* Map */
.mg-event-map {
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
}

.mg-event-map iframe {
    width: 100%;
    height: 300px;
    border: none;
}

/* Related Listings */
.mg-related-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.mg-listing-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s ease;
}

.mg-listing-card:hover {
    background: #e9ecef;
}

.mg-listing-card img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.mg-listing-info h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: #1a1a1a;
}

.mg-listing-info span {
    font-size: 13px;
    color: #666;
}

/* ==========================================================================
   ARCHIVE PAGE
   ========================================================================== */

.mg-events-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.mg-archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.mg-archive-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.mg-archive-header p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Filter Bar */
.mg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.mg-filter-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 150px;
}

/* Featured Section */
.mg-featured-section {
    margin-bottom: 40px;
}

.mg-featured-section h2 {
    font-size: 24px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mg-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.mg-featured-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 280px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.mg-featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-featured-card .mg-featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
}

.mg-featured-card h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
}

.mg-featured-card h3 a {
    color: #fff;
    text-decoration: none;
}

.mg-featured-card .mg-event-meta {
    color: rgba(255,255,255,0.9);
}

/* Category Sections */
.mg-category-section {
    margin-bottom: 40px;
}

.mg-category-section h2 {
    font-size: 22px;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2ba896;
}

/* No Events */
.mg-no-events {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #666;
    font-size: 16px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .mg-events-grid {
        grid-template-columns: 1fr;
    }

    .mg-event-card-list {
        flex-direction: column;
    }

    .mg-event-card-list .mg-event-image {
        flex: 0 0 180px;
    }

    .mg-event-card-minimal {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mg-event-hero img {
        height: 250px;
    }

    .mg-event-hero h1 {
        font-size: 24px;
    }

    .mg-event-hero-meta {
        flex-direction: column;
        gap: 10px;
    }

    .mg-featured-grid {
        grid-template-columns: 1fr;
    }

    .mg-featured-card {
        height: 220px;
    }

    .mg-filter-bar {
        flex-direction: column;
    }

    .mg-filter-bar select {
        width: 100%;
    }

    .mg-event-actions {
        flex-direction: column;
    }

    .mg-btn {
        width: 100%;
    }
}

/* ==========================================================================
   ELEMENTOR COMPATIBILITY
   ========================================================================== */

.elementor-widget-container .mg-events-grid,
.elementor-widget-container .mg-events-list,
.elementor-widget-container .mg-events-minimal {
    margin: 0;
}

.elementor-widget-container .mg-event-card-grid,
.elementor-widget-container .mg-event-card-list {
    margin-bottom: 0 !important;
}

/* Override theme styles */
.mg-event-title a,
.mg-featured-card h3 a {
    text-decoration: none !important;
    box-shadow: none !important;
}

.mg-btn {
    text-decoration: none !important;
    box-shadow: none !important;
}
