/**
 * RentConnect Payments Plugin Stylesheet
 * Reuses RentConnect Design System CSS Tokens
 */

/* Card Layout */
.rc-payment-card,
.rc-feature-card,
.rc-history-card {
	background: var(--rc-surface, #ffffff);
	border: 1px solid var(--rc-border, #e2e8f0);
	border-radius: var(--rc-radius, 12px);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--rc-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
	font-family: var(--rc-font-body, system-ui, -apple-system, sans-serif);
	color: var(--rc-text-main, #0f172a);
}

.rc-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--rc-border, #e2e8f0);
}

.rc-card-title {
	font-family: var(--rc-font-heading, inherit);
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0;
	color: var(--rc-text-main, #0f172a);
}

.rc-card-desc {
	font-size: 0.95rem;
	color: var(--rc-text-muted, #64748b);
	margin-bottom: 18px;
}

/* Badges */
.rc-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: var(--rc-radius-sm, 6px);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.rc-badge-rent {
	background-color: #e0f2fe;
	color: #0369a1;
}

.rc-badge-featured {
	background-color: #fef3c7;
	color: #b45309;
}

.rc-badge-completed {
	background-color: #dcfce7;
	color: #15803d;
}

.rc-badge-pending {
	background-color: #fef9c3;
	color: #a16207;
}

.rc-badge-failed {
	background-color: #fee2e2;
	color: #b91c1c;
}

/* Added for the manual proof-of-payment path */
.rc-badge-pending_verification {
	background-color: #e0f2fe;
	color: #0369a1;
}

.rc-badge-rejected {
	background-color: #fee2e2;
	color: #b91c1c;
}

/* Added for the landlord arrears dashboard */
.rc-badge-current {
	background-color: #dcfce7;
	color: #15803d;
}

.rc-badge-overdue {
	background-color: #fee2e2;
	color: #b91c1c;
}

.rc-manual-payment-toggle {
	text-align: center;
	margin-top: 14px;
	font-size: 13px;
}

.rc-manual-payment-toggle a {
	color: var(--rc-text-muted, #64748b);
	text-decoration: underline;
}

.rc-manual-payment-form {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px dashed var(--rc-border, #e2e8f0);
}

/* Added for the multi-listing [rentconnect_pay_rent] view */
.rc-info-box {
	background-color: var(--rc-background, #f8fafc);
	border: 1px solid var(--rc-border, #e2e8f0);
	border-radius: var(--rc-radius-sm, 6px);
	padding: 14px 18px;
	color: var(--rc-text-muted, #64748b);
}

.rc-payment-card-paid {
	opacity: 0.85;
}

.rc-payment-card-paid .rc-card-body p {
	color: var(--rc-text-muted, #64748b);
	margin: 0;
}

/* Summary Rows */
.rc-payment-summary {
	background-color: var(--rc-background, #f8fafc);
	border: 1px solid var(--rc-border, #e2e8f0);
	border-radius: var(--rc-radius-sm, 6px);
	padding: 14px 18px;
	margin-bottom: 20px;
}

.rc-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.rc-summary-row:last-child {
	margin-bottom: 0;
}

.rc-summary-label {
	color: var(--rc-text-muted, #64748b);
	font-size: 0.9rem;
}

.rc-summary-value {
	color: var(--rc-text-main, #0f172a);
	font-size: 0.95rem;
}

.rc-price-tag {
	font-size: 1.15rem;
	color: var(--rc-primary, #2563eb);
}

/* Form Controls */
.rc-payment-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rc-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rc-form-group label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--rc-text-main, #0f172a);
}

.rc-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--rc-border, #cbd5e1);
	border-radius: var(--rc-radius-sm, 6px);
	font-size: 0.95rem;
	background-color: #ffffff;
	color: var(--rc-text-main, #0f172a);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rc-input:focus {
	outline: none;
	border-color: var(--rc-primary, #2563eb);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rc-form-help {
	font-size: 0.8rem;
	color: var(--rc-text-muted, #64748b);
}

/* Buttons */
.rc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: var(--rc-radius-sm, 6px);
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	white-space: nowrap;
}

/*
 * FIX: .rc-btn-primary / .rc-btn-secondary previously set background-color
 * and color only on the base (non-hover) rule. On :hover, only
 * background-color was set — color was left to inherit, and with no
 * explicit color re-declared on hover, a theme-level `button:hover` rule
 * of equal or higher specificity could win the cascade and silently reset
 * color to something like white-on-white. Every hover rule below now
 * re-declares both background-color AND color explicitly, with !important,
 * so this plugin's own buttons can never be tie-broken into an invisible
 * state by the active theme's generic button styling.
 */
.rc-btn-primary {
	background-color: var(--rc-primary, #059669);
	color: #ffffff;
}

.rc-btn-primary:hover {
	background-color: #047857 !important;
	color: #ffffff !important;
}

.rc-btn-secondary {
	background-color: var(--rc-secondary, #d97706);
	color: #ffffff;
}

.rc-btn-secondary:hover {
	background-color: #b45309 !important;
	color: #ffffff !important;
}

/*
 * FIX: .rc-btn-outline was used in markup (the manual "Submit for
 * Verification" button, and the "Reject" / "View Receipt" / "View Proof"
 * buttons rendered by the payment-history JS) but was never actually
 * defined in this stylesheet. With no plugin styling at all, these buttons
 * fell back entirely to the site theme's generic button/hover styling —
 * which is what produced the white-background, white-text "invisible on
 * hover" bug reported during manual-payment testing.
 */
.rc-btn-outline {
	background-color: transparent;
	color: var(--rc-primary, #059669);
	border: 1.5px solid var(--rc-primary, #059669);
}

.rc-btn-outline:hover {
	background-color: var(--rc-primary, #059669) !important;
	color: #ffffff !important;
}

.rc-btn-block {
	width: 100%;
}

.rc-btn-sm {
	padding: 6px 12px;
	font-size: 0.8rem;
}

.rc-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Plans Grid */
.rc-plans-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.rc-plan-card {
	position: relative;
	border: 2px solid var(--rc-border, #e2e8f0);
	border-radius: var(--rc-radius, 8px);
	padding: 16px;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.rc-plan-card input[type="radio"] {
	margin-top: 4px;
	accent-color: var(--rc-primary, #059669);
}

.rc-plan-card:has(input:checked) {
	border-color: var(--rc-primary, #059669);
	background-color: rgba(5, 150, 105, 0.04);
}

.rc-plan-name {
	font-weight: 700;
	font-size: 1rem;
	color: var(--rc-text-main, #0f172a);
}

.rc-plan-price {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--rc-primary, #059669);
	margin: 4px 0;
}

.rc-plan-tag {
	font-size: 0.75rem;
	color: var(--rc-text-muted, #64748b);
}

.rc-tag-best {
	color: #b45309;
	font-weight: 600;
}

/* Status Messages */
.rc-status-message {
	padding: 12px 16px;
	border-radius: var(--rc-radius-sm, 6px);
	font-size: 0.9rem;
	line-height: 1.4;
	margin-top: 10px;
}

.rc-msg-info {
	background-color: #f0f9ff;
	border: 1px solid #bae6fd;
	color: #0369a1;
}

.rc-msg-pending {
	background-color: #fffbe3;
	border: 1px solid #fde68a;
	color: #92400e;
}

.rc-msg-success {
	background-color: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.rc-msg-error {
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

/* Table */
.rc-table-responsive {
	overflow-x: auto;
}

.rc-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 0.9rem;
}

.rc-table th,
.rc-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--rc-border, #e2e8f0);
}

.rc-table th {
	background-color: var(--rc-background, #f8fafc);
	font-weight: 600;
	color: var(--rc-text-muted, #64748b);
}

.rc-table tr:hover {
	background-color: rgba(0, 0, 0, 0.015);
}

/* Spinner */
.rc-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: rc-spin 0.8s linear infinite;
	margin-right: 8px;
}

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