/* Ticket Grid */
.wpplanit-ticket-grid {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}
.wpplanit-ticket-grid.has-1-cols { grid-template-columns: 1fr; }
.wpplanit-ticket-grid.has-2-cols { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.wpplanit-ticket-grid.has-3-cols { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.wpplanit-ticket-grid.has-4-cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.wpplanit-empty-ticket {
    margin: 2rem 0;
}

/* Ticket Card */
.wpplanit-ticket-card {
    display: block;
    position: relative;
    /* We use filter for drop shadow because box-shadow breaks inside mask-image */
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.06));
    transition: filter 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.wpplanit-ticket-card:hover {
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.1));
    transform: translateY(-3px);
    z-index: 2;
}

.ticket-card-inner {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    border-radius: 12px;
    text-decoration: none !important;
    color: inherit !important;
    position: relative;
    
    /* THE MAGIC: mask-image creates true transparent semicircles at 90px */
    -webkit-mask-image: 
        radial-gradient(circle at 90px 0px, transparent 10px, black 11.5px),
        radial-gradient(circle at 90px 100%, transparent 10px, black 11.5px);
    -webkit-mask-size: 100% 50.1%, 100% 50.1%;
    -webkit-mask-position: top, bottom;
    -webkit-mask-repeat: no-repeat;
    
    mask-image: 
        radial-gradient(circle at 90px 0px, transparent 10px, black 11.5px),
        radial-gradient(circle at 90px 100%, transparent 10px, black 11.5px);
    mask-size: 100% 50.1%, 100% 50.1%;
    mask-position: top, bottom;
    mask-repeat: no-repeat;
}

/* Left Date Context Block */
.ticket-date-block {
    width: 90px;
    flex-shrink: 0;
    background-color: var(--ev-color, #1e73be);
    color: var(--ev-text, #fff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.5rem;
    position: relative;
}

/* Perforation Dashed Line */
.ticket-date-block::after {
    content: '';
    position: absolute;
    right: 0;
    top: 14px;
    bottom: 14px;
    border-right: 2px dashed rgba(255, 255, 255, 0.4);
    z-index: 2;
}

.ticket-day {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}

.ticket-month {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
    opacity: 0.9;
}

/* Base Content Right Block */
.ticket-content-block {
    flex-grow: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
    color: #1a1a1a;
    position: relative;
}

.ticket-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    transition: color 0.3s;
}

.wpplanit-ticket-card:hover .ticket-title {
    color: var(--ev-color, #1a1a1a);
}

.ticket-meta {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.ticket-meta .dashicons {
    font-size: 1.1rem;
    height: 1.1rem;
    width: 1.1rem;
    color: var(--ev-color, inherit);
}

/* Mobile responsive stacking */
@media screen and (max-width: 480px) {
    /* To stack it safely we have to adjust the masks */
    .ticket-card-inner {
        flex-direction: column;
        
        -webkit-mask-image: 
            radial-gradient(circle at 0px 80px, transparent 10px, black 11.5px),
            radial-gradient(circle at 100% 80px, transparent 10px, black 11.5px);
        -webkit-mask-size: 50.1% 100%, 50.1% 100%;
        -webkit-mask-position: left, right;
        
        mask-image: 
            radial-gradient(circle at 0px 80px, transparent 10px, black 11.5px),
            radial-gradient(circle at 100% 80px, transparent 10px, black 11.5px);
        mask-size: 50.1% 100%, 50.1% 100%;
        mask-position: left, right;
    }

    .ticket-date-block {
        width: 100%;
        height: 80px;
        flex-direction: row;
        gap: 0.5rem;
        align-items: baseline;
    }
    
    .ticket-date-block::after {
        right: 14px;
        left: 14px;
        top: auto;
        bottom: 0;
        border-right: none;
        border-bottom: 2px dashed rgba(255, 255, 255, 0.4);
    }
    
    .ticket-month {
        margin-top: 0;
    }
}
