/**
 * Raffle for WooCommerce - Admin Tickets Page Styles
 *
 * @package RaffleForWooCommerce
 * @since   1.0.0
 */

.rfwc-tickets-page .wp-heading-inline {
	margin-right: 10px;
}

.rfwc-tickets-filters-bar {
	margin: 20px 0;
	padding: 15px;
	background: #fff;
	border: 1px solid #ccd0d4;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.rfwc-tickets-filters-bar form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.rfwc-tickets-filters-bar select {
	min-width: 200px;
}

.rfwc-no-tickets {
	padding: 40px;
	text-align: center;
	background: #fff;
	border: 1px solid #ccd0d4;
}

.rfwc-no-tickets p {
	margin: 0;
	color: #666;
	font-size: 14px;
}

.rfwc-tickets-table {
	margin-top: 0;
}

.rfwc-tickets-table .column-ticket {
	width: 100px;
}

.rfwc-tickets-table .column-raffle {
	width: 15%;
}

.rfwc-tickets-table .column-holder,
.rfwc-tickets-table .column-purchaser {
	width: 15%;
}

.rfwc-tickets-table .column-type,
.rfwc-tickets-table .column-status {
	width: 80px;
}

.rfwc-tickets-table .column-order {
	width: 80px;
}

.rfwc-tickets-table .column-date {
	width: 100px;
}

.rfwc-tickets-table td {
	vertical-align: top;
	padding: 10px 8px;
}

.rfwc-tickets-table td small {
	display: block;
	color: #888;
	font-size: 12px;
}

.rfwc-tickets-table .column-ticket strong {
	font-family: "SF Mono", Monaco, Consolas, monospace;
	font-size: 13px;
}

/* Badges */
.rfwc-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
}

.rfwc-badge-active {
	background: #d4edda;
	color: #155724;
}

.rfwc-badge-cancelled {
	background: #e2e3e5;
	color: #6c757d;
}

.rfwc-badge-winner {
	background: #ffd700;
	color: #333;
}

.rfwc-badge-gift {
	background: #fce4ec;
	color: #c2185b;
}

.rfwc-badge-regular {
	background: #e3f2fd;
	color: #1565c0;
}

/* ==========================================================================
   Tab Navigation (Winners / Claimed)
   ========================================================================== */

.rfwc-tickets-tabs {
	margin-bottom: 0;
}

.rfwc-tickets-tabs .count {
	font-weight: 400;
	color: #888;
}

.rfwc-tickets-wrap {
	margin-top: 0;
}

/* ==========================================================================
   Winners Table
   ========================================================================== */

/* Horizontal scroll wrapper so the wide winners table doesn't break the
   admin layout on narrow viewports or when extra tabs (Volunteers,
   Manual sale, Master draws) compress the available width. */
.rfwc-table-responsive {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.rfwc-table-responsive > .rfwc-winners-table {
	min-width: 880px;
}

.rfwc-winners-table {
	margin-top: 0;
	table-layout: auto;
}

.rfwc-winners-table .column-ticket {
	width: 90px;
}

.rfwc-winners-table .column-raffle {
	min-width: 140px;
}

.rfwc-winners-table .column-winner {
	min-width: 180px;
}

.rfwc-winners-table .column-tier {
	width: 70px;
	text-align: center;
}

.rfwc-winners-table .column-status {
	width: 90px;
}

.rfwc-winners-table .column-date {
	width: 110px;
}

.rfwc-winners-table .column-actions {
	width: 170px;
}

.rfwc-winners-table td {
	vertical-align: top;
	padding: 10px 8px;
}

.rfwc-winners-table .column-ticket strong {
	font-family: "SF Mono", Monaco, Consolas, monospace;
	font-size: 13px;
}

/* Status badges — polished pill style */
.rfwc-winners-table .order-status {
	display: inline-flex;
	align-items: center;
	background: none;
	border: none;
}

.rfwc-winners-table .order-status > span {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.4;
	white-space: nowrap;
}

.rfwc-winners-table .order-status.status-completed > span {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.rfwc-winners-table .order-status.status-processing > span {
	background: #dbeafe;
	color: #1e40af;
	border: 1px solid #bfdbfe;
}

.rfwc-winners-table .order-status.status-pending > span {
	background: #fef9c3;
	color: #854d0e;
	border: 1px solid #fde68a;
}

/* Action buttons — consistent spacing */
.rfwc-winners-table .column-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: flex-start;
}

.rfwc-winners-table .column-actions .button {
	margin: 0;
}

/* Bulk actions bar */
.rfwc-bulk-actions {
	margin-left: 8px;
}

.rfwc-bulk-claim-btn {
	vertical-align: middle;
}

/* Prize tier badge */
.rfwc-winners-table .rfwc-prize-tier {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: #f0f0f1;
	border-radius: 50%;
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
}

/* Method badges (instant win vs draw) */
.rfwc-method-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

.rfwc-method-instant-win {
	background: linear-gradient(135deg, #fbbf24, #f59e0b);
	color: #78350f;
}

.rfwc-method-draw {
	background: #e5e7eb;
	color: #374151;
}

.rfwc-winners-table .column-method {
	width: 120px;
}

/* Text helpers */
.rfwc-text-secondary {
	color: #888;
	font-size: 12px;
}

/* ==========================================================================
   Status Badges (inline ticket status pills)
   ========================================================================== */

.rfwc-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	vertical-align: middle;
	margin-left: 6px;
}

.rfwc-status-active {
	background: #d4edda;
	color: #155724;
}

.rfwc-status-winner {
	background: #ffd700;
	color: #333;
}

.rfwc-status-instant-winner {
	background: linear-gradient(135deg, #fbbf24, #f59e0b);
	color: #78350f;
}

.rfwc-status-cancelled {
	background: #e2e3e5;
	color: #6c757d;
}

.rfwc-status-refunded {
	background: #fce4ec;
	color: #b71c1c;
}

/* Refund method badges (gateway vs manual) on Refunded tab */
.rfwc-refund-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

.rfwc-refund-gateway {
	background: #e8f5e9;
	color: #2e7d32;
}

.rfwc-refund-manual {
	background: #fff3e0;
	color: #e65100;
	border: 1px solid #ffcc80;
}

.rfwc-refund-wallet {
	background: #e8eaf6;
	color: #283593;
	border: 1px solid #9fa8da;
}

.rfwc-refund-manual-done {
	background: #e0f2f1;
	color: #00695c;
}

.rfwc-refund-unknown {
	background: #e8eaed;
	color: #5f6368;
	border: 1px solid #dadce0;
}

/* ==========================================================================
   Ticket List Bulk Actions & Row Actions
   ========================================================================== */

.rfwc-tablenav-right {
	display: flex;
	gap: 6px;
	align-items: center;
}

.rfwc-tablenav-right .rfwc-search-form {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.rfwc-export-csv-btn {
	white-space: nowrap;
}

.rfwc-tickets-table .row-actions,
.rfwc-winners-table .row-actions {
	visibility: hidden;
	padding: 2px 0 0;
	font-size: 12px;
}

.rfwc-tickets-table tr:hover .row-actions,
.rfwc-winners-table tr:hover .row-actions {
	visibility: visible;
}

.rfwc-tickets-table .row-actions a,
.rfwc-winners-table .row-actions a {
	text-decoration: none;
}

.rfwc-tickets-table .row-actions .refund a {
	color: #d63638;
}

.rfwc-tickets-table .row-actions .refund a:hover {
	color: #a02224;
}

/* Gift badge */
.rfwc-gift-badge {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 600;
	background: #fce4ec;
	color: #c2185b;
	vertical-align: middle;
	margin-left: 4px;
}

/* ==========================================================================
   Mass Refund Box
   ========================================================================== */

.rfwc-mass-refund-box {
	margin: 0 0 20px;
	padding: 16px 20px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-left: 4px solid #d63638;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.rfwc-mass-refund-box h3 {
	margin: 0 0 6px;
	font-size: 14px;
}

.rfwc-mass-refund-box .description {
	margin: 0 0 12px;
}

.rfwc-mass-refund-controls {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.rfwc-mass-refund-controls select {
	min-width: 280px;
}

/* ==========================================================================
   Refund Confirmation Modal
   ========================================================================== */

.rfwc-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100100;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rfwc-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
}

.rfwc-modal-content {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
	width: 500px;
	max-width: 90%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}

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

.rfwc-modal-header h2 {
	margin: 0;
	font-size: 16px;
}

.rfwc-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0;
	line-height: 1;
}

.rfwc-modal-close:hover {
	color: #d63638;
}

.rfwc-modal-body {
	padding: 20px;
	overflow-y: auto;
}

.rfwc-modal-body .widefat td {
	padding: 8px 10px;
}

.rfwc-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 16px 20px;
	border-top: 1px solid #dcdcde;
}

.rfwc-refund-error {
	color: #d63638;
	font-weight: 600;
}

/* Progress bar */
.rfwc-refund-progress-bar-wrap {
	height: 20px;
	background: #f0f0f1;
	border-radius: 3px;
	overflow: hidden;
	margin-top: 10px;
}

.rfwc-refund-progress-bar {
	height: 100%;
	background: #2271b1;
	border-radius: 3px;
	transition: width 0.3s ease;
}

.rfwc-refund-progress-text {
	margin: 0 0 4px;
	font-size: 13px;
	color: #1d2327;
}

/* Responsive */
@media screen and (max-width: 782px) {
	.rfwc-tickets-filters-bar form {
		flex-direction: column;
		align-items: stretch;
	}

	.rfwc-tickets-filters-bar select {
		min-width: auto;
		width: 100%;
	}

	.rfwc-winners-table .column-actions {
		flex-direction: column;
	}

	.rfwc-mass-refund-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.rfwc-mass-refund-controls select {
		min-width: auto;
		width: 100%;
	}

	.rfwc-modal-content {
		width: 95%;
	}
}
