/**
 * 前台下载按钮样式
 * WooCommerce Product Downloads Frontend Styles
 */

/* 下载按钮容器 */
.wpdl-download-buttons-wrapper {
	margin: 25px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
}

/* 标题 */
.wpdl-download-title {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	margin: 0 0 15px 0;
	padding-bottom: 10px;
	border-bottom: 2px solid #e0e0e0;
}

/* 按钮列表 */
.wpdl-download-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 15px;
}

/* 下载按钮 - 基于主题灰色背景设计 */
.wpdl-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	background-color: #f0f0f0;
	color: #333;
	text-decoration: none;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.3s ease;
	position: relative;
	cursor: pointer;
}

/* 正常悬停效果 */
.wpdl-download-btn:hover {
	background-color: #e8e8e8;
	border-color: #d0d0d0;
	color: #000;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 未购买状态 - 锁定 */
.wpdl-download-btn--locked {
	background-color: #e0e0e0;
	color: #999;
	cursor: not-allowed;
	opacity: 0.8;
}

.wpdl-download-btn--locked:hover {
	background-color: #d8d8d8;
	border-color: #c8c8c8;
	color: #666;
	transform: none;
	box-shadow: none;
}

/* 按钮图标 */
.wpdl-download-btn__icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* 按钮文字 */
.wpdl-download-btn__text {
	flex: 1;
	text-align: left;
}

/* 锁定图标 */
.wpdl-download-btn__lock {
	display: inline-flex;
	align-items: center;
	margin-left: auto;
	opacity: 0.6;
}

.wpdl-download-btn__lock svg {
	width: 14px;
	height: 14px;
}

/* 提示信息 */
.wpdl-download-notice {
	margin: 0;
	padding: 12px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
	font-size: 14px;
	line-height: 1.5;
}

.wpdl-download-notice a {
	color: #856404;
	text-decoration: underline;
	font-weight: 600;
}

.wpdl-download-notice a:hover {
	color: #533f03;
}

/* 已购买用户 - 强调可下载 */
.wpdl-download-btn:not(.wpdl-download-btn--locked):hover {
	background-color: #d0d0d0;
}

.wpdl-download-btn:not(.wpdl-download-btn--locked)::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: #28a745;
	border-radius: 4px 0 0 4px;
}

/* 下载中状态 */
.wpdl-download-btn--downloading {
	pointer-events: none;
	opacity: 0.7;
}

.wpdl-download-btn--downloading::before {
	content: '';
	position: absolute;
	top: 50%;
	right: 15px;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #3498db;
	border-radius: 50%;
	animation: wpdl-spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
	.wpdl-download-buttons-wrapper {
		padding: 15px;
	}

	.wpdl-download-title {
		font-size: 16px;
	}

	.wpdl-download-btn {
		padding: 10px 15px;
		font-size: 13px;
	}

	.wpdl-download-btn__icon {
		width: 18px;
		height: 18px;
	}

	.wpdl-download-notice {
		font-size: 13px;
		padding: 10px;
	}
}

/* 移动端优化 */
@media (max-width: 480px) {
	.wpdl-download-btn__text {
		font-size: 12px;
	}
}

/* 打印时隐藏 */
@media print {
	.wpdl-download-buttons-wrapper {
		display: none;
	}
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
	.wpdl-download-btn {
		border-width: 2px;
	}

	.wpdl-download-btn--locked {
		border-style: dashed;
	}
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
	.wpdl-download-btn {
		transition: none;
	}

	.wpdl-download-btn:hover {
		transform: none;
	}

	.wpdl-download-btn--downloading::before {
		animation: none;
	}
}
