/* Frontend Styles for Ticket Print & Check-in for WooCommerce */

/* Main check-in form container */
#ticket-checkin-form,
.ticket-checkin-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #007cba;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 124, 186, 0.1);
    position: relative;
    overflow: hidden;
}

#ticket-checkin-form::before,
.ticket-checkin-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007cba, #005a87, #007cba);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

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

#ticket-checkin-form h3,
.ticket-checkin-container h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #1d2327;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tab system for check-in modes */
.checkin-tabs {
    display: flex;
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #6c757d;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-button.active {
    background: #007cba;
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkin-tab-content {
    display: none;
}

.checkin-tab-content.active {
    display: block;
}

/* Input styling */
#ticket-checkin-form input[type="text"],
#manual-ticket-code,
#ticket-code {
    width: 70%;
    padding: 15px 20px;
    font-size: 18px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin-right: 15px;
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

#ticket-checkin-form input[type="text"]:focus,
#manual-ticket-code:focus,
#ticket-code:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Button styling */
#ticket-checkin-form button,
.ticket-checkin-container button:not(.tab-button) {
    width: 25%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

#ticket-checkin-form button:hover,
.ticket-checkin-container button:not(.tab-button):hover {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

#ticket-checkin-form button:active,
.ticket-checkin-container button:not(.tab-button):active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 124, 186, 0.3);
}

#ticket-checkin-form button:disabled,
.ticket-checkin-container button:not(.tab-button):disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Message styling */
#checkin-message,
#scanner-result {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#checkin-message .success,
#scanner-result .success {
    background: linear-gradient(135deg, #d1f2eb 0%, #a3e4d7 100%);
    color: #00695c;
    border: 2px solid #4caf50;
    border-radius: 8px;
    padding: 20px;
    font-weight: 600;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#checkin-message .success::before,
#scanner-result .success::before {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

#checkin-message .error,
#scanner-result .error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 20px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

#checkin-message .error::before,
#scanner-result .error::before {
    content: '⚠';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

/* QR Scanner styling */
.ticket-scanner-container {
    background: #fff;
    border: 2px solid #007cba;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.1);
}

.scanner-modes {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scanner-mode-btn {
    flex: 1;
    padding: 12px 20px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #6c757d;
}

.scanner-mode-btn:hover {
    background: #e9ecef;
}

.scanner-mode-btn.active {
    background: #007cba;
    color: #fff;
}

.scanner-section {
    display: none;
}

.scanner-section.active {
    display: block;
}

#qr-video {
    width: 100%;
    max-width: 400px;
    height: 300px;
    border: 3px solid #007cba;
    border-radius: 12px;
    background: #000;
    object-fit: cover;
}

.scanner-status {
    margin: 15px 0;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.scanner-status.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 2px solid #2196f3;
}

.scanner-status.success {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.scanner-status.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 2px solid #f44336;
}

/* My Account Tickets Table */
.my-tickets-container .woocommerce-MyAccount-content table {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.my-tickets-container .woocommerce-MyAccount-content .woocommerce-orders-table__header {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
    font-weight: 700;
    padding: 15px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-tickets-container .woocommerce-MyAccount-content .woocommerce-orders-table__cell {
    padding: 15px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.my-tickets-container .woocommerce-MyAccount-content tr:nth-child(even) {
    background-color: #f8f9fa;
}

.my-tickets-container .woocommerce-MyAccount-content tr:hover {
    background-color: #e3f2fd;
    transition: background-color 0.3s ease;
}

.ticket-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
    color: #007cba;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* Ticket status badges */
.ticket-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ticket-status-valid {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.ticket-status-used {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(158, 158, 158, 0.3);
}

.ticket-status-expired {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

/* Action buttons */
.ticket-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.print-ticket-frontend,
.email-ticket-frontend {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.email-ticket-frontend {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.print-ticket-frontend:hover,
.email-ticket-frontend:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.email-ticket-frontend:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.print-ticket-frontend:active,
.email-ticket-frontend:active {
    transform: translateY(0);
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #007cba;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Pulse animation for active elements */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 124, 186, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 124, 186, 0); }
}

/* Confetti animation container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Success celebration animation */
@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.celebrate {
    animation: celebrate 0.6s ease-in-out;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #ticket-checkin-form,
    .ticket-checkin-container {
        padding: 20px;
        margin: 20px 0;
    }
    
    #ticket-checkin-form input[type="text"],
    #manual-ticket-code,
    #ticket-code {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    #ticket-checkin-form button,
    .ticket-checkin-container button:not(.tab-button) {
        width: 100%;
        padding: 12px 20px;
    }
    
    .ticket-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .print-ticket-frontend,
    .email-ticket-frontend {
        text-align: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .checkin-tabs,
    .scanner-modes {
        flex-direction: column;
    }
    
    .tab-button,
    .scanner-mode-btn {
        border-radius: 0;
    }
    
    .tab-button:first-child,
    .scanner-mode-btn:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .tab-button:last-child,
    .scanner-mode-btn:last-child {
        border-radius: 0 0 8px 8px;
    }
    
    #qr-video {
        height: 250px;
    }
}

@media screen and (max-width: 480px) {
    #ticket-checkin-form,
    .ticket-checkin-container {
        padding: 15px;
        margin: 10px 0;
    }
    
    #ticket-checkin-form h3,
    .ticket-checkin-container h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .ticket-code {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .my-tickets-container .woocommerce-MyAccount-content .woocommerce-orders-table__header,
    .my-tickets-container .woocommerce-MyAccount-content .woocommerce-orders-table__cell {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .print-ticket-frontend,
    .email-ticket-frontend {
        padding: 6px 12px;
        font-size: 10px;
    }
    
    .ticket-status {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    #qr-video {
        height: 200px;
    }
    
    .scanner-status {
        font-size: 12px;
        padding: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #ticket-checkin-form,
    .ticket-checkin-container {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: #4299e1;
        color: #e2e8f0;
    }
    
    #ticket-checkin-form h3,
    .ticket-checkin-container h3 {
        color: #e2e8f0;
    }
    
    #ticket-checkin-form input[type="text"],
    #manual-ticket-code,
    #ticket-code {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .tab-button {
        background: #4a5568;
        color: #a0aec0;
    }
    
    .tab-button.active {
        background: #4299e1;
        color: #1a202c;
    }
}

/* Print styles */
@media print {
    #ticket-checkin-form,
    .ticket-checkin-container,
    .scanner-modes,
    .checkin-tabs,
    .ticket-actions {
        display: none;
    }
    
    .my-tickets-container .woocommerce-MyAccount-content table {
        width: 100%;
        font-size: 12px;
    }
    
    .ticket-code {
        background: none;
        border: 1px solid #000;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #ticket-checkin-form,
    .ticket-checkin-container {
        border-width: 3px;
    }
    
    #ticket-checkin-form input[type="text"],
    #manual-ticket-code,
    #ticket-code {
        border-width: 2px;
    }
    
    .print-ticket-frontend,
    .email-ticket-frontend {
        border: 2px solid currentColor;
    }
}/* Frontend Styles for Ticket Print & Check-in for WooCommerce */

#ticket-checkin-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    max-width: 500px;
}

#ticket-checkin-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

#ticket-checkin-form input[type="text"] {
    width: 70%;
    padding: 12px;
    font-size: 16px;
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}

#ticket-checkin-form input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

#ticket-checkin-form button {
    width: 25%;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: bold;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#ticket-checkin-form button:hover {
    background-color: #005a87;
}

#ticket-checkin-form button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#checkin-message {
    margin-top: 15px;
}

#checkin-message .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 12px;
}

#checkin-message .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
}

/* My Account Tickets Table */
.my-tickets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.my-tickets-table th,
.my-tickets-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.my-tickets-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.my-tickets-table .ticket-code {
    font-family: monospace;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
}

.print-ticket-frontend {
    background-color: #28a745;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    transition: background-color 0.3s;
}

.print-ticket-frontend:hover {
    background-color: #218838;
    color: white;
    text-decoration: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #ticket-checkin-form input[type="text"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    #ticket-checkin-form button {
        width: 100%;
    }
    
    .my-tickets-table {
        font-size: 14px;
    }
    
    .my-tickets-table th,
    .my-tickets-table td {
        padding: 8px;
    }
}

@media screen and (max-width: 480px) {
    #ticket-checkin-form {
        padding: 15px;
        margin: 10px 0;
    }
    
    .my-tickets-table {
        font-size: 12px;
    }
    
    .print-ticket-frontend {
        padding: 6px 10px;
        font-size: 11px;
    }
}