/**
 * Ticketeria EFT - My Account Styles
 * Salvar em: assets/css/my-account.css
 */

/* ==========================================================================
   Página Meus Ingressos
   ========================================================================== */


.ticketeria-my-tickets h2 {
    margin-bottom: 30px;
    font-size: 28px;
    color: #333;
}

/* Grid de Ingressos */
.ticketeria-tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Card do Ingresso */
.ticket-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
}

.ticket-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Header do Card */
.ticket-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.ticket-id {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Variações de cor por status */
.ticket-status-wc-pending .ticket-header {
    background: linear-gradient(135deg, #ffb900 0%, #ff8c00 100%);
}

.ticket-status-wc-processing .ticket-header {
    background: linear-gradient(135deg, #00a0d2 0%, #0073aa 100%);
}

.ticket-status-wc-cancelled .ticket-header,
.ticket-status-wc-refunded .ticket-header {
    background: linear-gradient(135deg, #999 0%, #666 100%);
}

/* Body do Card */
.ticket-body {
    padding: 20px;
}

.ticket-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ticket-info .info-row:last-child {
    border-bottom: none;
}

.ticket-info .label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.ticket-info .value {
    color: #333;
    font-size: 14px;
    text-align: right;
}

/* Badges de Status */
.ticket-status-badge {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #46b450;
    color: white;
}

.badge-warning {
    background: #ffb900;
    color: white;
}

.badge-info {
    background: #00a0d2;
    color: white;
}

.badge-danger {
    background: #dc3232;
    color: white;
}

.badge-secondary {
    background: #ddd;
    color: #666;
}

/* Ações do Card */
.ticket-actions {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.ticket-actions .btn,
.modal-footer .btn {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    background-color: #5e5df0;
    border-radius: 999px;
    box-shadow: 0 10px 20px -10px #5e5df0;
    color: #ffffff;
    text-decoration: none;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 25px;
    padding-right: 25px;
    border: none;
    cursor: pointer;
}

.ticket-actions .btn svg,
.modal-footer .btn svg {
    width: 14px;
    height: 14px;
}



.upgrade-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 600;
}

.upgrade-history-toggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.toggle-history-btn {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

.upgrade-history-list {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.history-item {
    padding: 5px 0;
    border-bottom: 1px solid #e0e0e0;
}

.history-item:last-child {
    border-bottom: none;
}

.current-ticket-info {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.upgrade-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-option-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upgrade-option-card:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.upgrade-option-card.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.upgrade-option-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.upgrade-option-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.credit-badge {
    background: #46b450;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.to-pay-badge {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.free-upgrade-badge {
    background: #46b450;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
}

.upgrade-option-actions {
    margin-top: 15px;
}

.confirm-upgrade-btn {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.confirm-upgrade-btn:hover {
    background: #5568d3;
}

.stock-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.stock-low {
    color: #ff8c00;
    font-weight: 600;
}

/* ==========================================================================
   Modal de Transferência
   ========================================================================== */

.ticketeria-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.ticketeria-modal.show {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-close:not(.btn) {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    color: #999;
    transition: color 0.2s;
}

.modal-close:not(.btn):hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body .form-row {
    margin-bottom: 15px;
}

.modal-body label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.modal-body .input-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.modal-body .input-text:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-body .description {
    background: #f0f0f0;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.modal-body .required {
    color: #dc3232;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f9f9f9;
}

/* ==========================================================================
   Estados de Loading
   ========================================================================== */

.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Mensagens e Notificações
   ========================================================================== */

.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border-radius: 4px;
}

.woocommerce-info {
    background: #e5f5fa;
    border-color: #00a0d2;
    color: #0073aa;
}

.woocommerce-message {
    background: #ecf7ed;
    border-color: #46b450;
    color: #32a434;
}

.woocommerce-error {
    background: #f9e2e2;
    border-color: #dc3232;
    color: #a00;
}

/* ==========================================================================
   Empty State (Sem Ingressos)
   ========================================================================== */

.ticketeria-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.ticketeria-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.ticketeria-empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #666;
}

.ticketeria-empty-state p {
    color: #999;
    margin-bottom: 20px;
}

/* ==========================================================================
   Responsividade
   ========================================================================== */

@media (max-width: 768px) {
    .ticketeria-tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ticket-actions {
        flex-direction: column;
    }
    
    .ticket-actions .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-height: 65vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ticketeria-my-tickets h2 {
        font-size: 22px;
    }
    
    .ticket-header h3 {
        font-size: 16px;
    }
    
    .ticket-info .info-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .ticket-info .value {
        text-align: left;
    }
}

/* ==========================================================================
   Print Styles (para impressão de ingressos)
   ========================================================================== */

@media print {
    .ticket-actions,
    .modal-overlay,
    .modal-content {
        display: none !important;
    }
    
    .ticket-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 2px solid #333;
    }
    
    .ticketeria-tickets-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Acessibilidade
   ========================================================================== */

.btn:focus,
.input-text:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}


/* Screen readers only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Animações adicionais
   ========================================================================== */

.ticket-card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delay para cada card aparecer */
.ticket-card:nth-child(1) { animation-delay: 0s; }
.ticket-card:nth-child(2) { animation-delay: 0.1s; }
.ticket-card:nth-child(3) { animation-delay: 0.2s; }
.ticket-card:nth-child(4) { animation-delay: 0.3s; }
.ticket-card:nth-child(5) { animation-delay: 0.4s; }
.ticket-card:nth-child(6) { animation-delay: 0.5s; }

/* ==========================================================================
   Customizações WooCommerce My Account
   ========================================================================== */

.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--meus-ingressos a::before {
    content: "🎫";
    margin-right: 8px;
}

/* Badge de quantidade de ingressos no menu */
.woocommerce-MyAccount-navigation-link--meus-ingressos .ticket-count {
    display: inline-block;
    background: #667eea;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* ==========================================================================
   Dark Mode Support (Opcional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ticket-card {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .ticket-body {
        background: #2a2a2a;
    }
    
    .ticket-info .label {
        color: #999;
    }
    
    .ticket-info .value {
        color: #e0e0e0;
    }
    
    .ticket-info .info-row {
        border-bottom-color: #444;
    }
    
    .ticket-actions {
        background: #1a1a1a;
        border-top-color: #444;
    }
    
    .modal-content {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .modal-header {
        border-bottom-color: #444;
    }
    
    .modal-footer {
        background: #1a1a1a;
        border-top-color: #444;
    }
    
    .modal-body .input-text {
        background: #1a1a1a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .modal-body .description {
        background: #1a1a1a;
        color: #999;
    }
}