/**
 * style.css — Design System Styles
 * Component patterns using Tailwind utility classes
 * Note: This file uses regular CSS (not @apply) for standalone demos
 */

/* Base Layer — Typography and accessibility */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
	font-weight: 600;
}

/* Focus styles for keyboard navigation */
*:focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.5);
}

/* Components Layer — Reusable component patterns */
/* Navigation Links */
.nav-link {
	color: #4b5563;
	transition-property: color;
	transition-duration: 200ms;
	font-weight: 500;
}

.nav-link:hover {
	color: #2563eb;
}

.nav-link.active {
	color: #2563eb;
	border-bottom-width: 2px;
	border-bottom-color: #2563eb;
}

/* Button Components */
.btn-primary {
	padding: 0.75rem 1.5rem;
	background-color: #3b82f6;
	color: white;
	font-weight: 500;
	border-radius: 0.5rem;
	transition-property: all;
	transition-duration: 200ms;
}

.btn-primary:hover {
	background-color: #2563eb;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:active {
	transform: scale(0.95);
}

.btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-primary:disabled:hover {
	background-color: #3b82f6;
	box-shadow: none;
}

.btn-primary:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
	padding: 0.75rem 1.5rem;
	border-width: 2px;
	border-color: #3b82f6;
	color: #2563eb;
	font-weight: 500;
	border-radius: 0.5rem;
	transition-property: all;
	transition-duration: 200ms;
	background-color: transparent;
}

.btn-secondary:hover {
	background-color: #eff6ff;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-secondary:active {
	transform: scale(0.95);
}

.btn-secondary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-secondary:disabled:hover {
	background-color: transparent;
}

.btn-secondary:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.5);
}

.btn-sm {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
}

.btn-loading {
	position: relative;
	padding-right: 3rem;
}

.loading-spinner {
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1rem;
	height: 1rem;
	border-width: 2px;
	border-color: white;
	border-top-color: transparent;
	border-radius: 9999px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: translateY(-50%) rotate(360deg);
	}
}

/* Card Components */
.card {
	background-color: white;
	border-radius: 0.5rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	overflow: hidden;
}

.card-hover {
	transition-property: all;
	transition-duration: 300ms;
}

.card-hover:hover {
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	transform: translateY(-0.25rem);
}

.card-header {
	padding: 1.5rem;
	border-bottom-width: 1px;
	border-bottom-color: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.card-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: #111827;
}

.card-body {
	padding: 1.5rem;
}

.card-footer {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	padding-top: 1rem;
	padding-bottom: 1rem;
	background-color: #f9fafb;
	border-top-width: 1px;
	border-top-color: #e5e7eb;
	display: flex;
	gap: 0.5rem;
}

/* Badge Components */
.badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 500;
}

.badge-primary {
	background-color: #dbeafe;
	color: #1e40af;
}

.badge-secondary {
	background-color: #f3f4f6;
	color: #374151;
}

/* Form Components */
.form-group {
	margin-bottom: 1rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
	margin-bottom: 0.5rem;
}

.form-input {
	width: 100%;
	padding: 0.5rem 1rem;
	border-width: 1px;
	border-color: #d1d5db;
	border-radius: 0.5rem;
	transition-property: all;
	transition-duration: 200ms;
}

.form-input:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.5);
	border-color: transparent;
}

.form-input:disabled {
	background-color: #f3f4f6;
	cursor: not-allowed;
}

.form-input::placeholder {
	color: #9ca3af;
}

.form-input:invalid:not(:placeholder-shown) {
	border-color: #ef4444;
	box-shadow: 0 0 0 1px #ef4444;
}

.form-input:valid:not(:placeholder-shown) {
	border-color: #10b981;
}

.form-checkbox {
	width: 1rem;
	height: 1rem;
	color: #2563eb;
	border-color: #d1d5db;
	border-radius: 0.25rem;
	cursor: pointer;
}

.form-checkbox:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.5);
}

.form-help {
	margin-top: 0.25rem;
	font-size: 0.875rem;
	color: #6b7280;
}

.form-error {
	margin-top: 0.25rem;
	font-size: 0.875rem;
	color: #dc2626;
}

/* Utilities Layer — Custom utilities */
/* Smooth scrolling */
html {
	scroll-behavior: smooth;
}

/* Custom container with consistent padding */
.container {
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

@media (min-width: 640px) {
	.container {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.container {
		padding-left: 2rem;
		padding-right: 2rem;
	}
}

/* Responsive text truncation */
.truncate-2 {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.truncate-3 {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
