/**
 * APM Custom Links Addon - Frontend Styles
 * Styles for custom affiliate links and profile form
 */

/* ========================================
   Custom Link Styles
   ======================================== */

.apm-custom-link {
	display: inline-block;
	padding: 10px 20px;
	background: #3b82f6;
	color: #ffffff !important;
	text-decoration: none;
	border-radius: 4px;
	transition: background 0.3s ease;
	font-weight: 500;
}

.apm-custom-link:hover {
	background: #2563eb;
	color: #ffffff !important;
	text-decoration: none;
}

.apm-custom-link:focus {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

/* ========================================
   Messages & Notices
   ======================================== */

.apm-custom-link-notice,
.apm-custom-link-error,
.apm-custom-link-updated {
	padding: 12px 16px;
	margin: 16px 0;
	border-radius: 4px;
	border-left: 4px solid;
}

.apm-custom-link-notice {
	background: #f0f6fc;
	border-color: #0969da;
	color: #0550ae;
}

.apm-custom-link-error {
	background: #fff1f0;
	border-color: #cf222e;
	color: #a40e26;
}

.apm-custom-link-updated {
	background: #dafbe1;
	border-color: #2da44e;
	color: #116329;
}

.apm-custom-link-login-required {
	padding: 16px;
	background: #fff8c5;
	border: 1px solid #e3b341;
	border-radius: 4px;
	color: #5c4813;
	text-align: center;
}

/* ========================================
   Custom Link Profile Form
   ======================================== */

.apm-custom-link-form-wrapper {
	max-width: 900px;
	margin: 20px auto;
	padding: 24px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.apm-custom-link-form h3 {
	margin-top: 0;
	margin-bottom: 8px;
	color: #1e293b;
	font-size: 20px;
}

.apm-custom-link-form .description {
	color: #64748b;
	font-size: 14px;
	margin-bottom: 20px;
	display: block;
}

.apm-custom-link-table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
}

.apm-custom-link-table tbody tr {
	border-bottom: 1px solid #e2e8f0;
}

.apm-custom-link-table tbody tr:last-child {
	border-bottom: none;
}

.apm-custom-link-table td {
	padding: 16px 12px;
	vertical-align: top;
}

.apm-custom-link-label {
	width: 30%;
}

.apm-custom-link-label strong {
	display: block;
	margin-bottom: 4px;
	color: #1e293b;
	font-size: 15px;
}

.apm-custom-link-label .description {
	display: block;
	font-size: 13px;
	color: #64748b;
	font-style: italic;
	margin: 4px 0 0 0;
}

.apm-custom-link-table input[type="text"],
.apm-custom-link-table input[type="url"] {
	width: 100%;
	max-width: 500px;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.2s;
}

.apm-custom-link-table input[type="text"]:focus,
.apm-custom-link-table input[type="url"]:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.apm-custom-link-status {
	padding-top: 8px;
}

.apm-custom-link-active,
.apm-custom-link-default,
.apm-custom-link-none {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
	margin-bottom: 10px;
}

.apm-custom-link-active {
	background: #dafbe1;
	color: #116329;
}

.apm-custom-link-default {
	background: #fff8c5;
	color: #5c4813;
}

.apm-custom-link-none {
	background: #f1f5f9;
	color: #64748b;
}

.apm-custom-link-preview {
	margin-top: 10px;
	padding: 12px;
	background: #f8fafc;
	border-radius: 4px;
	border-left: 3px solid #3b82f6;
}

.apm-custom-link-preview strong {
	display: block;
	margin-bottom: 6px;
	color: #1e293b;
	font-size: 13px;
}

.apm-custom-link-preview a {
	color: #3b82f6;
	text-decoration: none;
}

.apm-custom-link-preview a:hover {
	text-decoration: underline;
}

.apm-custom-link-help {
	background: #f8fafc;
	padding: 12px 16px;
	border-radius: 4px;
	border-left: 3px solid #3b82f6;
	font-size: 13px;
	line-height: 1.6;
	color: #475569;
	margin: 20px 0;
}

.apm-custom-link-help strong {
	color: #1e293b;
	display: block;
	margin-bottom: 6px;
}

.apm-custom-link-help code {
	background: #e2e8f0;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 12px;
	color: #334155;
}

.apm-custom-link-submit {
	margin-top: 20px;
	text-align: left;
}

.apm-custom-link-submit .button-primary {
	background: #3b82f6;
	border-color: #2563eb;
	padding: 10px 24px;
	font-size: 15px;
	height: auto;
	line-height: 1.4;
}

.apm-custom-link-submit .button-primary:hover {
	background: #2563eb;
	border-color: #1d4ed8;
}

/* ========================================
   Responsive Design
   ======================================== */

@media screen and (max-width: 782px) {
	.apm-custom-link-form-wrapper {
		padding: 16px;
	}
	
	.apm-custom-link-table,
	.apm-custom-link-table tbody,
	.apm-custom-link-table tr,
	.apm-custom-link-table td {
		display: block;
		width: 100%;
	}
	
	.apm-custom-link-table tbody tr {
		margin-bottom: 24px;
		padding-bottom: 16px;
		border-bottom: 2px solid #e2e8f0;
	}
	
	.apm-custom-link-table tbody tr:last-child {
		margin-bottom: 0;
		padding-bottom: 0;
		border-bottom: none;
	}
	
	.apm-custom-link-table td {
		padding: 8px 0;
	}
	
	.apm-custom-link-label {
		width: 100%;
		margin-bottom: 8px;
	}
	
	.apm-custom-link-table input[type="text"],
	.apm-custom-link-table input[type="url"] {
		max-width: 100%;
	}
	
	.apm-custom-link {
		display: block;
		text-align: center;
	}
}

@media screen and (max-width: 480px) {
	.apm-custom-link-form h3 {
		font-size: 18px;
	}
	
	.apm-custom-link-submit .button-primary {
		width: 100%;
		text-align: center;
	}
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
	.apm-custom-link-form-wrapper {
		background: #1e293b;
		border-color: #334155;
	}
	
	.apm-custom-link-form h3 {
		color: #f1f5f9;
	}
	
	.apm-custom-link-form .description {
		color: #94a3b8;
	}
	
	.apm-custom-link-table tbody tr {
		border-color: #334155;
	}
	
	.apm-custom-link-label strong {
		color: #f1f5f9;
	}
	
	.apm-custom-link-label .description {
		color: #94a3b8;
	}
	
	.apm-custom-link-table input[type="text"],
	.apm-custom-link-table input[type="url"] {
		background: #0f172a;
		border-color: #475569;
		color: #f1f5f9;
	}
	
	.apm-custom-link-table input[type="text"]:focus,
	.apm-custom-link-table input[type="url"]:focus {
		border-color: #3b82f6;
	}
	
	.apm-custom-link-preview {
		background: #334155;
	}
	
	.apm-custom-link-preview strong {
		color: #f1f5f9;
	}
	
	.apm-custom-link-help {
		background: #334155;
		color: #cbd5e1;
	}
	
	.apm-custom-link-help strong {
		color: #f1f5f9;
	}
	
	.apm-custom-link-help code {
		background: #475569;
		color: #e2e8f0;
	}
}
