/**
 * Ticket for WP Events Manager - Styles
 * Version: 1.0.0
 */

/* General Styles */
.tfwem-tickets-wrapper {
    margin: 20px 0;
}

.tfwem-notice,
.tfwem-error {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.tfwem-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.tfwem-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Tickets Table */
.tfwem-tickets-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tfwem-tickets-table th,
.tfwem-tickets-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.tfwem-tickets-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.tfwem-tickets-table tr:hover {
    background: #f8f9fa;
}

.tfwem-tickets-table td a {
    color: #007bff;
    text-decoration: none;
}

.tfwem-tickets-table td a:hover {
    text-decoration: underline;
}

/* Status Badges */
.tfwem-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.tfwem-status-completed {
    background: #d4edda;
    color: #155724;
}

.tfwem-status-pending {
    background: #fff3cd;
    color: #856404;
}

.tfwem-status-processing {
    background: #cce5ff;
    color: #004085;
}

.tfwem-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Buttons */
.tfwem-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.tfwem-btn-print {
    background: #28a745;
    color: #fff;
}

.tfwem-btn-print:hover {
    background: #218838;
    color: #fff;
}

.tfwem-btn-download {
    background: #007bff;
    color: #fff;
}

.tfwem-btn-download:hover {
    background: #0056b3;
    color: #fff;
}

.tfwem-pending-notice {
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
}

.tfwem-no-tickets {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

/* Ticket Container */
.tfwem-ticket-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.tfwem-ticket {
    background: #fff;
    border: 2px solid #333;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Ticket Header */
.tfwem-ticket-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tfwem-logo {
    max-height: 50px;
    width: auto;
}

.tfwem-site-name {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.tfwem-ticket-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Ticket Body */
.tfwem-ticket-body {
    display: flex;
    padding: 0;
}

.tfwem-ticket-main {
    flex: 1;
    padding: 30px;
    border-right: 2px dashed #ddd;
}

.tfwem-event-name {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tfwem-event-name label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.tfwem-event-name h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

/* Ticket Details */
.tfwem-ticket-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tfwem-detail-row {
    display: flex;
    gap: 30px;
}

.tfwem-detail-item {
    flex: 1;
}

.tfwem-detail-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.tfwem-detail-item span {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* Status Badge in Ticket */
.tfwem-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* QR Code Section */
.tfwem-ticket-qr {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-width: 180px;
}

.tfwem-qr-code {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tfwem-qr-image {
    display: block;
    width: 150px;
    height: 150px;
}

.tfwem-qr-text {
    margin: 15px 0 0;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Ticket Footer */
.tfwem-ticket-footer {
    background: #f8f9fa;
    padding: 15px 30px;
    text-align: center;
    border-top: 1px solid #eee;
}

.tfwem-ticket-footer p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.tfwem-ticket-date {
    font-size: 11px !important;
    color: #999 !important;
}

/* Ticket Actions */
.tfwem-ticket-actions {
    text-align: center;
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.tfwem-ticket-actions .tfwem-btn {
    padding: 12px 30px;
    font-size: 16px;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .tfwem-ticket-container,
    .tfwem-ticket-container * {
        visibility: visible;
    }
    
    .tfwem-ticket-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    .tfwem-ticket {
        box-shadow: none;
        border: 2px solid #333;
    }
    
    .no-print {
        display: none !important;
    }
    
    .tfwem-ticket-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background: #667eea !important;
    }
    
    .tfwem-status-completed {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Modal Styles */
.tfwem-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.tfwem-modal.active {
    display: block;
}

.tfwem-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.tfwem-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: tfwemModalSlideIn 0.3s ease;
}

@keyframes tfwemModalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.tfwem-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tfwem-modal-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.tfwem-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

.tfwem-modal-content .tfwem-ticket-container {
    margin: 0;
    padding: 20px;
    max-width: none;
}

.tfwem-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    font-size: 16px;
    color: #666;
}

.tfwem-modal-loading span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tfwem-modal-loading span::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: tfwemSpin 0.8s linear infinite;
}

@keyframes tfwemSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Print Adjustments */
@media print {
    .tfwem-modal-overlay,
    .tfwem-modal-close {
        display: none !important;
    }
    
    .tfwem-modal-container {
        position: static;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: none;
        box-shadow: none;
        border-radius: 0;
    }
    
    .tfwem-modal-content {
        max-height: none;
        overflow: visible;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .tfwem-ticket-body {
        flex-direction: column;
    }
    
    .tfwem-ticket-main {
        border-right: none;
        border-bottom: 2px dashed #ddd;
    }
    
    .tfwem-ticket-qr {
        padding: 20px;
    }
    
    .tfwem-detail-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .tfwem-ticket-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .tfwem-tickets-table {
        display: block;
        overflow-x: auto;
    }
    
    .tfwem-ticket-actions {
        flex-direction: column;
    }
    
    .tfwem-ticket-actions .tfwem-btn {
        width: 100%;
    }
}
