/**
 * WooCommerce Integration Styles
 * 
 * @package TicketManager
 * @version 1.0.0
 */

/* WooCommerce My Account Integration - Follow exact WooCommerce pattern */

/* Add My Tickets icon using multiple selector approaches */
.woocommerce-MyAccount-navigation-link--my-tickets a:before,
.woocommerce-MyAccount-navigation li a[href*="my-tickets"]:before,
.woocommerce-MyAccount-navigation li[class*="my-tickets"] a:before,
nav.woocommerce-MyAccount-navigation li a[href*="tickets"]:before {
    content: "\E018" !important;
    font-family: "ETModules", "ET-Modules", ETModules !important;
    margin-right: 0.5em !important;
    font-size: 17px !important;
    color: #515151 !important;
    display: inline-block !important;
    speak: none !important;
    font-style: normal !important;
    font-weight: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.woocommerce-account .woocommerce-MyAccount-content .tm-my-tickets-container {
    background: transparent;
    border: none;
    padding: 0;
}

.woocommerce-account .tm-tickets-header h2 {
    color: inherit;
    font-family: inherit;
    font-size: 1.5em;
    margin-bottom: 1em;
    color: #515151 !important;
}

.et_pb_text_0 h4 {
    color: #515151 !important;
}

/* Fix for tm-event-title specifically - override Divi theme white text */
.woocommerce-MyAccount-content .tm-ticket-card .tm-event-title,
.et_pb_text_0 .tm-ticket-card .tm-event-title,
.et_pb_text_0 .tm-event-title {
    color: #333333 !important;
}

.woocommerce-account .tm-tickets-grid {
    margin-bottom: 1.5em;
}

.woocommerce-account .tm-ticket-card {
    background: #f8f9fa;
    border: 1px solid #e2e2e2;
    transition: all 0.3s ease;
}

.woocommerce-account .tm-ticket-card:hover {
    border-color: #a46497;
    box-shadow: 0 2px 8px rgba(164, 100, 151, 0.15);
}

.woocommerce-account .tm-ticket-actions .button {
    background: #a46497;
    color: #fff;
    border: 1px solid #a46497;
    padding: 0.618em 1em;
    font-size: 0.875em;
    line-height: 1;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woocommerce-account .tm-ticket-actions .button:hover {
    background: #935187;
    border-color: #935187;
    color: #fff;
    transform: translateY(-1px);
}

.woocommerce-account .tm-ticket-actions .button:active {
    transform: translateY(0);
}

.woocommerce-account .tm-ticket-actions .tm-view-wc-order {
    background: transparent;
    color: #a46497;
    border: 1px solid #a46497;
}

.woocommerce-account .tm-ticket-actions .tm-view-wc-order:hover {
    background: #a46497;
    color: #fff;
}

/* WooCommerce Order Details Integration */
.woocommerce-order-details .tm-order-tickets-section {
    margin-top: 2em;
    background: #f8f9fa;
    border: 1px solid #e2e2e2;
    padding: 1.5em;
    border-radius: 4px;
}

.woocommerce-order-details .tm-section-title {
    color: inherit;
    font-family: inherit;
    font-size: 1.25em;
    margin-bottom: 1em;
    border-bottom: 1px solid #e2e2e2;
    padding-bottom: 0.5em;
}

.woocommerce-order-details .tm-order-tickets-summary {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
}

.woocommerce-order-details .tm-ticket-item {
    background: #fff;
    border: 1px solid #e2e2e2;
}

.woocommerce-order-details .tm-ticket-actions .button {
    background: #a46497;
    color: #fff;
    border: 1px solid #a46497;
    padding: 0.618em 1em;
    font-size: 0.875em;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woocommerce-order-details .tm-ticket-actions .button:hover {
    background: #935187;
    border-color: #935187;
    color: #fff;
}

/* WooCommerce Email Compatibility */
.woocommerce-email .tm-order-tickets-section {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
}

.woocommerce-email .tm-section-title {
    color: #2c3e50;
}

.woocommerce-email .tm-ticket-actions a {
    background: #a46497 !important;
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    font-weight: 600 !important;
}

/* Status Badge Color Coordination */
.woocommerce .tm-status-active {
    background: #c8d4b6;
    color: #638421;
}

.woocommerce .tm-status-used {
    background: #f7f1d9;
    color: #94660c;
}

.woocommerce .tm-status-expired {
    background: #f4c2c2;
    color: #8a2424;
}

.woocommerce .tm-status-cancelled {
    background: #e8e8e8;
    color: #666;
}

/* Progress Bar WooCommerce Theme Integration */
.woocommerce .tm-progress-fill {
    background: linear-gradient(90deg, #a46497, #935187);
}

/* Mobile Responsive Adjustments for WooCommerce */
@media (max-width: 768px) {
    .woocommerce-account .tm-tickets-stats {
        justify-content: space-between;
        gap: 1rem;
    }

    .woocommerce-account .tm-ticket-card {
        margin-bottom: 1rem;
    }

    .woocommerce-account .tm-ticket-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .woocommerce-account .tm-ticket-actions .button {
        width: 100%;
        text-align: center;
    }

    .woocommerce-order-details .tm-summary-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .woocommerce-order-details .tm-ticket-actions {
        flex-direction: column;
    }

    .woocommerce-order-details .tm-ticket-actions .button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .woocommerce .tm-ticket-card {
        border: 2px solid #000;
    }

    .woocommerce .tm-ticket-actions .button {
        border: 2px solid #000;
        background: #000;
        color: #fff;
    }

    .woocommerce .tm-status-badge {
        border: 1px solid #000;
        font-weight: bold;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .woocommerce .tm-ticket-card,
    .woocommerce .tm-ticket-actions .button,
    .woocommerce .tm-progress-fill {
        transition: none;
    }

    .woocommerce .tm-ticket-card:hover {
        transform: none;
    }

    .woocommerce .tm-ticket-actions .button:hover {
        transform: none;
    }
}

/* WooCommerce Admin Integration */
.woocommerce_page_wc-orders .tm-order-tickets-section,
.post-type-shop_order .tm-order-tickets-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    margin-top: 15px;
}

.woocommerce_page_wc-orders .tm-section-title,
.post-type-shop_order .tm-section-title {
    color: #23282d;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Print Styles for WooCommerce */
@media print {
    .woocommerce .tm-ticket-actions {
        display: none;
    }

    .woocommerce .tm-modal {
        display: none !important;
    }

    .woocommerce .tm-ticket-card {
        border: 1px solid #000;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .woocommerce .tm-section-title {
        color: #000;
        font-weight: bold;
    }

    .woocommerce .tm-order-tickets-section {
        background: transparent;
        border: 1px solid #000;
        margin: 20px 0;
        page-break-inside: avoid;
    }
}