/**
 * EventHex WordPress Connector - Tickets Widget Styles
 * Version: 2.0.0 - Enhanced Modern Design
 */

/* ================================
   TICKETS WIDGET - BASE STYLES
================================ */

/* Wrapper Grid Layout */
.eventhex-tickets-wrapper {
    display: grid;
    gap: 30px;
    width: 100%;
}

/* Column Configurations */
.eventhex-tickets-wrapper.eventhex-columns-1 {
    grid-template-columns: 1fr;
}

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

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

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

/* ================================
   TICKET CARD - BASE STYLES
================================ */

.eventhex-ticket-card {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    will-change: transform, box-shadow;
}

.eventhex-ticket-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(102, 126, 234, 0.15);
}

/* Ticket Image */
.eventhex-ticket-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.eventhex-ticket-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When using object-fit contain, ensure proper centering */
.eventhex-ticket-image img[style*="object-fit: contain"],
.eventhex-ticket-image img[style*="object-fit:contain"] {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.eventhex-ticket-card:hover .eventhex-ticket-image img {
    transform: scale(1.1);
}

/* Image Hover Effects */
.eventhex-tickets-wrapper[data-image-hover="none"] .eventhex-ticket-card:hover .eventhex-ticket-image img {
    transform: none;
}

.eventhex-tickets-wrapper[data-image-hover="zoom"] .eventhex-ticket-card:hover .eventhex-ticket-image img {
    transform: scale(1.15);
}

.eventhex-tickets-wrapper[data-image-hover="zoom-out"] .eventhex-ticket-card:hover .eventhex-ticket-image img {
    transform: scale(0.95);
}

.eventhex-tickets-wrapper[data-image-hover="rotate"] .eventhex-ticket-card:hover .eventhex-ticket-image img {
    transform: scale(1.1) rotate(3deg);
}

.eventhex-tickets-wrapper[data-image-hover="slide"] .eventhex-ticket-card:hover .eventhex-ticket-image img {
    transform: scale(1.1) translateX(10px);
}

/* Ticket Content */
.eventhex-ticket-content {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(248, 250, 252, 0.5) 100%);
}

/* Status Badge */
.eventhex-ticket-status-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    z-index: 10;
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.eventhex-ticket-card:hover .eventhex-ticket-status-badge {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.eventhex-badge-open {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    color: #ffffff;
}

.eventhex-badge-closed {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: #ffffff;
}

.eventhex-badge-sold-out {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.95) 0%, rgba(75, 85, 99, 0.95) 100%);
    color: #ffffff;
}

/* Title */
.eventhex-ticket-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.8px;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eventhex-ticket-card:hover .eventhex-ticket-title {
    color: #667eea;
}

/* Description */
.eventhex-ticket-description {
    font-size: 15px;
    line-height: 1.75;
    color: #64748b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    letter-spacing: 0.1px;
}

/* Price */
.eventhex-ticket-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 40px;
    font-weight: 900;
    color: #1e293b;
    margin: 12px 0;
    letter-spacing: -1.5px;
    transition: transform 0.3s ease;
}

.eventhex-ticket-card:hover .eventhex-ticket-price {
    transform: scale(1.03);
}

.eventhex-ticket-price .eventhex-currency {
    font-size: 22px;
    font-weight: 700;
    color: #64748b;
    vertical-align: top;
}

.eventhex-ticket-price .eventhex-free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 34px;
    font-weight: 900;
}

/* Availability */
.eventhex-ticket-availability {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    font-size: 14px;
    color: #334155;
    font-weight: 700;
    border: 2px solid rgba(148, 163, 184, 0.15);
    transition: all 0.3s ease;
    margin-top: 4px;
}

.eventhex-ticket-card:hover .eventhex-ticket-availability {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.eventhex-ticket-availability i {
    font-size: 16px;
}

.eventhex-ticket-availability .fa-check-circle {
    color: #10b981;
}

.eventhex-ticket-availability .fa-times-circle {
    color: #f56565;
}

.eventhex-ticket-availability .fa-infinity {
    color: #667eea;
}

/* Button */
.eventhex-ticket-button {
    display: block;
    width: 100%;
    padding: 18px 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.35), 0 2px 8px rgba(102, 126, 234, 0.2);
    margin-top: auto;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.eventhex-ticket-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.eventhex-ticket-button:hover::before {
    width: 300px;
    height: 300px;
}

.eventhex-ticket-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 36px rgba(102, 126, 234, 0.45), 0 4px 16px rgba(118, 75, 162, 0.3);
    color: #ffffff;
}

.eventhex-ticket-button:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* ================================
   LAYOUT 1: CLASSIC CARD (Enhanced)
================================ */

.eventhex-design-card .eventhex-ticket-card {
    /* Uses base styles with enhancements */
}

/* ================================
   LAYOUT 2: MODERN CARD
================================ */

.eventhex-design-modern .eventhex-ticket-card {
    border: 2px solid #e2e8f0;
    box-shadow: none;
}

.eventhex-design-modern .eventhex-ticket-card:hover {
    border-color: #667eea;
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.2);
}

.eventhex-design-modern .eventhex-ticket-image {
    height: 200px;
    border-radius: 16px;
    margin: 20px 20px 0 20px;
    width: calc(100% - 40px);
}

.eventhex-design-modern .eventhex-ticket-status-badge {
    top: 32px;
    right: 32px;
}

/* ================================
   LAYOUT 3: PRICING TABLE
================================ */

.eventhex-design-pricing .eventhex-ticket-card {
    text-align: center;
    border: 3px solid #e2e8f0;
}

.eventhex-design-pricing .eventhex-ticket-image {
    display: none;
}

.eventhex-design-pricing .eventhex-ticket-content {
    padding: 40px 32px;
    align-items: center;
}

.eventhex-design-pricing .eventhex-ticket-title {
    font-size: 28px;
    margin-bottom: 16px;
}

.eventhex-design-pricing .eventhex-ticket-price {
    font-size: 48px;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0;
}

.eventhex-design-pricing .eventhex-ticket-status-badge {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 16px;
}

/* Featured/Popular Pricing Card */
.eventhex-design-pricing .eventhex-ticket-card:nth-child(2) {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
    z-index: 1;
}

.eventhex-design-pricing .eventhex-ticket-card:nth-child(2)::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    letter-spacing: 1px;
}

/* ================================
   LAYOUT 4: MINIMAL
================================ */

.eventhex-design-minimal .eventhex-ticket-card {
    background: transparent;
    border: none;
    border-left: 5px solid #667eea;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.eventhex-design-minimal .eventhex-ticket-card:hover {
    background: #f7fafc;
    border-left-color: #764ba2;
    transform: translateX(8px);
}

.eventhex-design-minimal .eventhex-ticket-image {
    display: none;
}

.eventhex-design-minimal .eventhex-ticket-content {
    padding: 24px 28px;
}

.eventhex-design-minimal .eventhex-ticket-status-badge {
    position: relative;
    top: auto;
    right: auto;
    display: inline-block;
    margin-bottom: 12px;
}

/* ================================
   LAYOUT 5: IMAGE OVERLAY
================================ */

.eventhex-design-overlay .eventhex-ticket-card {
    position: relative;
    min-height: 400px;
}

.eventhex-design-overlay .eventhex-ticket-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.eventhex-design-overlay .eventhex-ticket-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 100%);
}

.eventhex-design-overlay .eventhex-ticket-content {
    position: relative;
    z-index: 2;
    padding: 32px;
    color: #ffffff;
    justify-content: flex-end;
    min-height: 400px;
}

.eventhex-design-overlay .eventhex-ticket-title {
    color: #ffffff;
    font-size: 28px;
}

.eventhex-design-overlay .eventhex-ticket-description {
    color: rgba(255, 255, 255, 0.9);
}

.eventhex-design-overlay .eventhex-ticket-price {
    color: #ffffff;
}

.eventhex-design-overlay .eventhex-ticket-price .eventhex-currency {
    color: rgba(255, 255, 255, 0.8);
}

.eventhex-design-overlay .eventhex-ticket-availability {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #ffffff;
}

.eventhex-design-overlay .eventhex-ticket-button {
    background: #ffffff;
    color: #667eea;
    font-weight: 800;
}

.eventhex-design-overlay .eventhex-ticket-button:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #764ba2;
}

/* ================================
   LAYOUT 6: BORDERED STYLE
================================ */

.eventhex-design-bordered .eventhex-ticket-card {
    border: 2px solid #e2e8f0;
    box-shadow: none;
}

.eventhex-design-bordered .eventhex-ticket-card:hover {
    border-color: #667eea;
    border-width: 3px;
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
}

.eventhex-design-bordered .eventhex-ticket-image {
    height: 180px;
    border-radius: 0;
}

.eventhex-design-bordered .eventhex-ticket-content {
    padding: 28px;
}

.eventhex-design-bordered .eventhex-ticket-button {
    border-radius: 8px;
    background: #ffffff;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

.eventhex-design-bordered .eventhex-ticket-button:hover {
    background: #667eea;
    color: #ffffff;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .eventhex-tickets-wrapper.eventhex-columns-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .eventhex-tickets-wrapper.eventhex-columns-tablet-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .eventhex-tickets-wrapper {
        gap: 24px;
    }
    
    .eventhex-tickets-wrapper.eventhex-columns-mobile-1 {
        grid-template-columns: 1fr;
    }
    
    .eventhex-tickets-wrapper.eventhex-columns-mobile-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .eventhex-ticket-card {
        border-radius: 20px;
        box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
    }
    
    .eventhex-ticket-card:hover {
        transform: translateY(-6px) scale(1.01);
    }
    
    .eventhex-ticket-image {
        height: 220px;
    }
    
    .eventhex-ticket-content {
        padding: 28px 24px;
        gap: 14px;
    }
    
    .eventhex-ticket-title {
        font-size: 22px;
        letter-spacing: -0.6px;
    }
    
    .eventhex-ticket-description {
        font-size: 14px;
        line-height: 1.7;
    }
    
    .eventhex-ticket-price {
        font-size: 32px;
        margin: 10px 0;
    }
    
    .eventhex-ticket-button {
        padding: 16px 28px;
        font-size: 13px;
        letter-spacing: 0.6px;
    }
    
    .eventhex-ticket-status-badge {
        top: 18px;
        right: 18px;
        font-size: 10px;
        padding: 8px 14px;
    }
    
    .eventhex-ticket-availability {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Pricing table adjustments */
    .eventhex-design-pricing .eventhex-ticket-card:nth-child(2) {
        transform: scale(1);
    }
    
    .eventhex-design-pricing .eventhex-ticket-price {
        font-size: 38px;
    }
    
    /* Overlay design mobile adjustments */
    .eventhex-design-overlay .eventhex-ticket-content {
        min-height: 350px;
        padding: 28px;
    }
    
    .eventhex-design-overlay .eventhex-ticket-title {
        font-size: 24px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .eventhex-tickets-wrapper {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .eventhex-ticket-card {
        border-radius: 18px;
    }
    
    .eventhex-ticket-image {
        height: 200px;
    }
    
    .eventhex-ticket-content {
        padding: 24px 20px;
        gap: 12px;
    }
    
    .eventhex-ticket-title {
        font-size: 20px;
        letter-spacing: -0.5px;
    }
    
    .eventhex-ticket-description {
        font-size: 13px;
    }
    
    .eventhex-ticket-price {
        font-size: 28px;
        margin: 8px 0;
    }
    
    .eventhex-ticket-button {
        padding: 14px 24px;
        font-size: 12px;
    }
    
    .eventhex-ticket-status-badge {
        top: 14px;
        right: 14px;
        font-size: 9px;
        padding: 6px 12px;
        letter-spacing: 1px;
    }
    
    .eventhex-ticket-availability {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    /* Minimal design adjustments */
    .eventhex-design-minimal .eventhex-ticket-content {
        padding: 20px 24px;
    }
    
    /* Bordered design button */
    .eventhex-design-bordered .eventhex-ticket-button {
        padding: 12px 20px;
    }
}

/* ================================
   ACCESSIBILITY ENHANCEMENTS
================================ */

/* Focus states for keyboard navigation */
.eventhex-ticket-card:focus-within {
    outline: 3px solid #667eea;
    outline-offset: 4px;
    border-radius: 24px;
}

.eventhex-ticket-button:focus {
    outline: 3px solid #764ba2;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

.eventhex-ticket-button:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .eventhex-ticket-card {
        border: 2px solid currentColor;
    }
    
    .eventhex-ticket-button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .eventhex-ticket-card,
    .eventhex-ticket-image img,
    .eventhex-ticket-button,
    .eventhex-ticket-status-badge,
    .eventhex-ticket-availability,
    .eventhex-ticket-price,
    .eventhex-ticket-title {
        transition: none !important;
        animation: none !important;
    }
    
    .eventhex-ticket-card:hover {
        transform: none;
    }
    
    .eventhex-ticket-button::before {
        transition: none;
    }
}

/* ================================
   LOADING AND SKELETON STATES
================================ */

.eventhex-tickets-loading {
    display: grid;
    gap: 30px;
    width: 100%;
}

.eventhex-ticket-skeleton {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.eventhex-skeleton-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.eventhex-skeleton-content {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.eventhex-skeleton-title,
.eventhex-skeleton-description,
.eventhex-skeleton-price,
.eventhex-skeleton-button {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.eventhex-skeleton-title {
    height: 28px;
    width: 70%;
}

.eventhex-skeleton-description {
    height: 20px;
    width: 100%;
}

.eventhex-skeleton-price {
    height: 36px;
    width: 40%;
    margin: 12px 0;
}

.eventhex-skeleton-button {
    height: 54px;
    width: 100%;
    margin-top: auto;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ================================
   PRINT STYLES
================================ */

@media print {
    .eventhex-ticket-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .eventhex-ticket-image {
        height: auto;
        max-height: 200px;
    }
    
    .eventhex-ticket-button {
        display: none;
    }
    
    .eventhex-ticket-status-badge {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000;
    }
}
