:root {
	--glyph: #000000;
	--glyph-gray: #1D1D1F;
	--fill: #ffffff;
	--fill-gray-secondary: #86868B;
	--fill-gray-tertiary: #D2D2D7;
	--bg-light-override: #f5f5f7;
	--fill-gray-quaternary: #E8E8ED;
	--fill-gray-quinary: #ededed;
	--tag-example-bg: #e4e7fb;
	--tag-example-color: #3f51b5;
	--s-primary:#6258b5;
}

.theme-dark, body[data-color-scheme="dark"] {
	--glyph: #ffffff;
	--glyph-gray: #f5f5f7;
	--fill: #000000;
	--fill-gray-secondary: #6E6E73;
	--fill-gray-tertiary: #424245;
  	--fill-secondary-alt: #141414;
	--fill-gray-quaternary: #333336;
	--fill-gray-quinary: #2b2b2d;
}

/* Hero Section */
.color-gradient,
body[data-color-scheme="light"] .color-gradient {
	background: radial-gradient(ellipse at top left, #6600cc 0%, #000033 40%, #003399 70%, #00ccff 100%);
	color: #ffffff;
}

.theme-dark .color-gradient,
body[data-color-scheme="dark"] .color-gradient {
	background: radial-gradient(ellipse at top left, #6600cc 0%, #000033 40%, #003399 70%, #00ccff 100%);
}

sf-symbol {
	color: var(--s-primary);
}

sf-symbol[name="appletv.fill"] {
	margin-right: -15px;
}


/* Search Section */
.tn-p {
	display: flex;
	justify-content: center;
}


/* Examples Section */
.examples-section {
	padding: 60px 0;
}

.examples-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 30px;
}

/* Example Cards */
.example-card {
	background-color: #f5f5f7
}
body[data-color-scheme='dark'] .example-card {
	background-color: #1d1d1f
}

.example-card {
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease-in-out;
}

/*
.example-card:hover {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.01), 0 7px 14px 0 rgba(0, 0, 0, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.02);
}
*/

.card-header {
	padding: 24px 24px 0;
	display: flex;
	align-items: center;
	gap: 16px;
}

.card-icon {
	font-size: 48px;
}

.card-category {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--fill-gray-secondary);
}

.card-content {
	padding: 16px 24px 24px;
	flex: 1;
}

.card-title {
	font-weight: 600;
	margin-bottom: 12px;
	color: var(--glyph-gray);
	line-height: 1.3;
}

.card-description {
	color: var(--glyph-gray-tertiary);
	margin-bottom: 20px;
	line-height: 1.5;
}

.card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.tag {
	display: inline-block;
	padding: 4px 12px;
	background: var(--fill-tertiary);
	color: var(--glyph-gray);
	border-radius: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.tag-example { 
	background: var(--tag-example-bg);
	color: var(--tag-example-color);
}

.card-actions {
	padding: 0 24px 24px;
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.card-actions .nowrap button {
	margin-left: 8px;
}

/* Buttons */
.button {
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.button-primary:hover {
	background: #015ebc;
}

/* Modal */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(10px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 20px;
}

.modal-overlay.active {
	display: flex;
}

.modal {
	background: var(--fill);
	border-radius: 16px;
	max-width: 600px;
	width: 100%;
	max-height: 80vh;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	border:1px solid var(--fill);
}
.theme-dark .modal,
body[data-color-scheme="dark"] .modal {
	border:1px solid var(--fill-gray-quaternary);
}

.modal-header {
	padding: 24px;
	border-bottom: 1px solid var(--fill-secondary);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-title {
	font-size: 20px;
	font-weight: 600;
	color: var(--glyph-gray);
}

.modal-close {
	background: var(--fill-gray-quaternary);
	color: var(--glyph-gray);
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: 980px;
	transition: background 0.3s ease;
	height: 24px;
}

.modal-close:hover {
	background: var(--fill-gray-quinary);
	color: var(--glyph);
}

.modal-content {
	padding: 24px;
	overflow-y: auto;
	max-height: calc(80vh - 100px);
}

.modal-content h4 {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 12px;
	color: var(--glyph-gray);
}

.modal-content ul {
	list-style: none;
	margin-bottom: 20px;
}

.modal-content li {
	padding: 8px 0;
	border-bottom: 1px solid var(--fill-tertiary);
	font-size: 14px;
	color: var(--glyph-gray-tertiary);
}

.modal-content li:last-child {
	border-bottom: none;
}

.modal-content strong {
	color: var(--glyph-gray);
	font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
	.examples-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 0 16px;
	}
	
	.card-header,
	.card-content,
	.card-actions {
		padding-left: 20px;
		padding-right: 20px;
	}
	
	.modal {
		margin: 10px;
	}
	
	.modal-header,
	.modal-content {
		padding: 20px;
	}
}

/* Animation for filtered cards */
.example-card.hidden {
	display: none;
}

.example-card.show {
	animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Loading state */
.examples-grid.loading .example-card {
	opacity: 0.5;
	pointer-events: none;
}


/* ========== Grid ========== */
#main section.section {
	padding-top: 4em;
	padding-bottom: 4em;
}

#main section .section-content .row {
	margin-left: 0;
	margin-right: 0;
}

#main section .section-content .row > .column {
	padding: 0;
}

@media only screen and (max-width: 1068px) {
	#main section .section-content {
		width: 87%
	}
	#main section .section-content .row {
		margin-left: 0;
		margin-right: 0;
	}

	#main section .section-content .row > .column {
		padding: 0;
	}
}

@media only screen and (max-width: 734px) {
	#main section.section {
		padding-top: 2em;
		padding-bottom: 2em;
	}

	#main section .section-content .row {
		margin-left: 0;
		margin-right: 0;
	}

	#main section .section-content .row > .column {
		padding: 1em 0;
	}
}