/**
 * CDL Push Notification Styles
 */

.cdl-push-preferences-container {
	max-width: 600px;
	margin: 20px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
		Arial, sans-serif;
}

.cdl-push-preferences-container h3 {
	margin-top: 0;
	color: #333;
	font-size: 18px;
	font-weight: 600;
}

.cdl-push-preferences-container h4 {
	color: #555;
	font-size: 16px;
	font-weight: 600;
	margin-top: 20px;
	margin-bottom: 10px;
}

/* Form Styles */
.cdl-push-form {
	width: 100%;
}

.cdl-push-fieldset {
	margin-bottom: 30px;
	padding: 15px;
	background: white;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
}

.cdl-push-fieldset legend {
	padding: 0 10px;
	font-weight: 600;
	color: #333;
	font-size: 14px;
}

/* Form Groups */
.cdl-push-form-group {
	margin-bottom: 15px;
}

.cdl-push-form-group:last-child {
	margin-bottom: 0;
}

.cdl-push-label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	color: #333;
	font-size: 14px;
}

.cdl-push-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 3px;
	font-size: 14px;
	font-family: inherit;
}

.cdl-push-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.cdl-push-input[type='number'] {
	max-width: 120px;
}

.cdl-push-input[type='time'] {
	max-width: 120px;
}

/* Checkbox Group */
.cdl-push-checkbox-group {
	margin-bottom: 15px;
	padding: 10px;
	background: white;
	border-left: 3px solid #0073aa;
}

.cdl-push-checkbox-label {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-weight: 500;
	color: #333;
	margin-bottom: 5px;
}

.cdl-push-checkbox {
	margin-right: 10px;
	cursor: pointer;
	width: 18px;
	height: 18px;
	accent-color: #0073aa;
}

.cdl-push-checkbox-text {
	font-weight: 500;
}

.cdl-push-help-text {
	margin: 5px 0 0 28px;
	font-size: 12px;
	color: #666;
	line-height: 1.4;
}

/* Time Group */
.cdl-push-time-group {
	margin-bottom: 15px;
	padding: 10px;
	background: white;
	border-left: 3px solid #0073aa;
}

/* Buttons */
.cdl-push-form-actions {
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #e5e5e5;
	display: flex;
	gap: 10px;
}

.cdl-push-button {
	padding: 8px 16px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #f5f5f5;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.cdl-push-button:hover {
	background: #e5e5e5;
	border-color: #999;
}

.cdl-push-button:active {
	background: #d5d5d5;
}

.cdl-push-button-primary {
	background: #0073aa;
	color: white;
	border-color: #0073aa;
}

.cdl-push-button-primary:hover {
	background: #006687;
	border-color: #006687;
}

.cdl-push-button-primary:active {
	background: #005073;
}

.cdl-push-button-secondary {
	background: white;
	color: #0073aa;
	border-color: #0073aa;
}

.cdl-push-button-secondary:hover {
	background: #f5f5f5;
	border-color: #006687;
	color: #006687;
}

.cdl-push-button-danger {
	background: #dc3545;
	color: white;
	border-color: #dc3545;
	margin-top: 10px;
}

.cdl-push-button-danger:hover {
	background: #c82333;
	border-color: #c82333;
}

/* Messages */
.cdl-push-message {
	margin-top: 15px;
	padding: 12px 15px;
	border-radius: 3px;
	font-size: 14px;
	display: none;
}

.cdl-push-message:not(:empty) {
	display: block;
}

.cdl-push-message-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.cdl-push-message-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.cdl-push-message-info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

/* Spinner */
.cdl-push-spinner {
	width: 20px;
	height: 20px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0073aa;
	border-radius: 50%;
	animation: cdl-push-spin 1s linear infinite;
	margin: 10px auto;
}

@keyframes cdl-push-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Status Section */
.cdl-push-status-section {
	margin-top: 30px;
	padding: 15px;
	background: white;
	border: 1px solid #e5e5e5;
	border-radius: 3px;
}

.cdl-push-status-info {
	color: #28a745;
	font-weight: 500;
	margin-bottom: 10px;
}

.cdl-push-account-links {
	font-size: 0.9rem;
	margin-bottom: 12px;
	color: #555;
}

.cdl-push-account-links a {
	text-decoration: none;
}

.cdl-push-linked-user {
	font-weight: 500;
}

.cdl-push-linked-guest {
	color: #856404;
}

/* Error/Info Messages */
.cdl-push-error {
	color: #dc3545;
	padding: 10px 15px;
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 3px;
}

.cdl-push-info {
	color: #0c5460;
	padding: 10px 15px;
	background: #d1ecf1;
	border: 1px solid #bee5eb;
	border-radius: 3px;
}

.cdl-push-loading {
	color: #666;
	font-style: italic;
	margin: 0.5rem 0;
}

.cdl-push-devices-overview {
	margin-top: 1.75rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e5e5;
}

.cdl-push-devices-overview > h4,
.cdl-push-devices-note h4 {
	margin: 0 0 0.75rem;
	color: #333;
}

.cdl-push-devices-list {
	display: grid;
	gap: 1rem;
	margin-top: 1rem;
}

.cdl-push-device-details {
	padding: 0.35rem 0.65rem;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
}

.cdl-push-device-details[open] {
	padding-bottom: 0.65rem;
}

.cdl-push-device-details > summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.65rem;
	cursor: pointer;
	list-style: none;
	font-weight: 600;
	color: #222;
}

.cdl-push-device-details > summary::-webkit-details-marker {
	display: none;
}

.cdl-push-device-details.is-current-device {
	border-color: rgba(153, 0, 51, 0.35);
	box-shadow: 0 0 0 1px rgba(153, 0, 51, 0.08);
}

.cdl-push-device-summary__label {
	flex: 1 1 12rem;
	min-width: 0;
}

.cdl-push-device-details__body {
	margin-top: 0.65rem;
	padding-top: 0.65rem;
	border-top: 1px dashed #e5e5e5;
}

.cdl-push-device-card {
	padding: 1rem;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
}

.cdl-push-device-card.is-current,
.cdl-push-device-card.is-current-device {
	border-color: rgba(153, 0, 51, 0.35);
	box-shadow: 0 0 0 1px rgba(153, 0, 51, 0.08);
}

.cdl-push-device-card.is-active .cdl-push-device-status {
	color: #1f7a1f;
}

.cdl-push-device-card.is-inactive .cdl-push-device-status {
	color: #856404;
}

.cdl-push-device-card__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.cdl-push-device-card__header h5 {
	margin: 0;
	font-size: 1rem;
	color: #222;
}

.cdl-push-device-id {
	font-size: 0.78rem;
	color: #888;
	white-space: nowrap;
}

.cdl-push-badge {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	background: rgba(153, 0, 51, 0.12);
	color: #990033;
	font-size: 0.72rem;
	font-weight: 700;
	vertical-align: middle;
}

.cdl-push-device-status {
	margin: 0 0 0.75rem;
	font-weight: 600;
}

.cdl-push-device-meta {
	display: grid;
	gap: 0.35rem;
	margin: 0;
}

.cdl-push-device-meta__row {
	display: grid;
	grid-template-columns: minmax(8rem, 38%) 1fr;
	gap: 0.65rem;
}

.cdl-push-device-meta dt {
	margin: 0;
	font-weight: 600;
	color: #555;
}

.cdl-push-device-meta dd {
	margin: 0;
	color: #222;
	word-break: break-word;
}

.cdl-push-device-meta--compact {
	margin-top: 0.5rem;
}

.cdl-push-device-prefs,
.cdl-push-device-stats,
.cdl-push-recent-deliveries {
	margin-top: 1rem;
	padding-top: 0.85rem;
	border-top: 1px dashed #e5e5e5;
}

.cdl-push-device-prefs strong,
.cdl-push-device-stats strong,
.cdl-push-recent-deliveries strong {
	display: block;
	margin-bottom: 0.5rem;
	color: #333;
}

.cdl-push-recent-deliveries ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cdl-push-recent-deliveries li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 0.88rem;
}

.cdl-push-recent-deliveries time {
	color: #666;
	white-space: nowrap;
}

.cdl-push-current-device-summary {
	margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 600px) {
	.cdl-push-preferences-container {
		padding: 15px;
		margin: 10px 0;
	}

	.cdl-push-form-actions {
		flex-direction: column;
	}

	.cdl-push-button {
		width: 100%;
	}

	.cdl-push-help-text {
		margin-left: 0;
	}

	.cdl-push-device-meta__row {
		grid-template-columns: 1fr;
		gap: 0.15rem;
	}

	.cdl-push-recent-deliveries li {
		flex-direction: column;
		align-items: flex-start;
	}
}
