/**
 * Homepage Styles - Caniincasa Theme
 *
 * @package Caniincasa
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
	position: relative;
	min-height: 600px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
	overflow: hidden;
}

/* Hero Background Carousel */
.hero-backgrounds {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 0;
}

.hero-bg {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 1.5s ease-in-out;
}

.hero-bg[data-active="true"] {
	opacity: 1;
}

.hero-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(77, 51, 25, 0.7) 0%, rgba(255, 204, 112, 0.5) 100%);
	z-index: 1;
}

.hero-content {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 80px 20px;
	color: #ffffff;
}

.hero-title {
	font-size: 3.5rem;
	font-weight: 700;
	margin-bottom: 20px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
	animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
	font-size: 1.5rem;
	margin-bottom: 40px;
	opacity: 0.95;
	animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-cta-buttons {
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 40px;
	animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-search {
	max-width: 600px;
	margin: 0 auto;
	animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.hero-search .search-wrapper {
	position: relative;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 50px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-search .search-field {
	width: 100%;
	padding: 18px 60px 18px 25px;
	border: none;
	font-size: 1rem;
	background: transparent;
}

.hero-search .search-submit {
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%);
	background: var(--color-accent);
	border: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	transition: background 0.3s ease;
}

.hero-search .search-submit:hover {
	background: var(--color-secondary);
}

.scroll-indicator {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	animation: bounce 2s infinite;
}

.scroll-indicator a {
	color: white;
	opacity: 0.8;
	transition: opacity 0.3s ease;
}

.scroll-indicator a:hover {
	opacity: 1;
}

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

@keyframes bounce {
	0%, 100% {
		transform: translateX(-50%) translateY(0);
	}
	50% {
		transform: translateX(-50%) translateY(-10px);
	}
}

/* ==========================================================================
   Section Common Styles
   ========================================================================== */

section {
	padding: 80px 0;
}

.section-header {
	text-align: center;
	margin-bottom: 50px;
}

.section-title {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--color-secondary);
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
}

.section-title .icon {
	font-size: 2.5rem;
}

.section-subtitle {
	font-size: 1.2rem;
	color: var(--color-text-light);
}

.subsection-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--color-secondary);
	margin-bottom: 25px;
}

.section-cta {
	text-align: center;
	margin-top: 50px;
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ==========================================================================
   Annunci Section
   ========================================================================== */

.annunci-section {
	background: var(--color-bg-light);
}

.quick-filters {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 40px;
}

.filter-btn {
	padding: 10px 20px;
	border: 2px solid var(--color-border);
	background: white;
	border-radius: 25px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	color: var(--color-text);
}

.filter-btn:hover {
	border-color: var(--color-primary);
	background: var(--color-primary);
	color: white;
}

.filter-btn.active {
	border-color: var(--color-accent);
	background: var(--color-accent);
	color: white;
}

.annunci-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
	margin-bottom: 30px;
}

.annuncio-card {
	background: white;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.annuncio-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.annuncio-thumbnail {
	position: relative;
	height: 200px;
	overflow: hidden;
}

.annuncio-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.annuncio-card:hover .annuncio-thumbnail img {
	transform: scale(1.05);
}

.annuncio-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 5px 12px;
	background: var(--color-accent);
	color: white;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
}

.annuncio-badge.cerco {
	background: #4CAF50;
}

.annuncio-content {
	padding: 20px;
}

.annuncio-title {
	font-size: 1.2rem;
	margin-bottom: 10px;
}

.annuncio-title a {
	color: var(--color-secondary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.annuncio-title a:hover {
	color: var(--color-accent);
}

.annuncio-meta {
	display: flex;
	gap: 15px;
	margin-bottom: 15px;
	font-size: 0.9rem;
	color: var(--color-text-light);
}

.annuncio-meta .meta-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.annuncio-excerpt {
	font-size: 0.95rem;
	color: var(--color-text-light);
	margin-bottom: 15px;
	line-height: 1.6;
}

.no-annunci {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px;
	color: var(--color-text-light);
}

/* ==========================================================================
   Razze Section
   ========================================================================== */

.razze-section {
	background: white;
}

.razze-carousel {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 25px;
	margin-bottom: 50px;
}

.razza-card {
	background: white;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.razza-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.razza-thumbnail {
	height: 180px;
	overflow: hidden;
}

.razza-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.razza-card:hover .razza-thumbnail img {
	transform: scale(1.05);
}

.razza-content {
	padding: 15px;
}

.razza-title {
	font-size: 1.1rem;
	margin-bottom: 8px;
}

.razza-title a {
	color: var(--color-secondary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.razza-title a:hover {
	color: var(--color-accent);
}

.razza-taglia {
	display: inline-block;
	padding: 4px 10px;
	background: var(--color-primary);
	color: var(--color-secondary);
	border-radius: 15px;
	font-size: 0.8rem;
	font-weight: 600;
	margin-bottom: 10px;
}

.razza-quick-stats {
	display: flex;
	gap: 15px;
	margin-top: 10px;
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.9rem;
}

.stat-label {
	font-size: 1.2rem;
}

.stat-value {
	font-weight: 600;
	color: var(--color-accent);
}

/* Cerca per Taglia */
.razze-by-taglia {
	margin-top: 50px;
}

.taglia-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.taglia-card {
	padding: 25px;
	background: white;
	border: 2px solid var(--color-border);
	border-radius: 12px;
	text-align: center;
	text-decoration: none;
	transition: all 0.3s ease;
}

.taglia-card:hover {
	border-color: var(--color-accent);
	background: var(--color-primary);
	transform: translateY(-3px);
}

.taglia-name {
	display: block;
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--color-secondary);
	margin-bottom: 8px;
}

.taglia-count {
	display: block;
	font-size: 0.9rem;
	color: var(--color-text-light);
}

/* ==========================================================================
   Quiz Section
   ========================================================================== */

.quiz-section {
	background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
	color: white;
}

.quiz-content-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 60px;
	align-items: center;
}

.quiz-info .section-title {
	color: white;
	text-align: left;
	justify-content: flex-start;
}

.quiz-description {
	font-size: 1.1rem;
	line-height: 1.8;
	margin-bottom: 30px;
	opacity: 0.95;
}

.quiz-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 30px;
}

.stat-box {
	text-align: center;
	padding: 20px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 12px;
	backdrop-filter: blur(10px);
}

.stat-number {
	display: block;
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 8px;
}

.stat-label {
	display: block;
	font-size: 0.9rem;
	opacity: 0.9;
}

.recent-results {
	margin-bottom: 30px;
}

.recent-results h4 {
	font-size: 1rem;
	margin-bottom: 15px;
	opacity: 0.9;
}

.results-preview {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.result-tag {
	padding: 8px 15px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	color: white;
	text-decoration: none;
	font-size: 0.9rem;
	transition: background 0.3s ease;
}

.result-tag:hover {
	background: rgba(255, 255, 255, 0.3);
}

.btn-quiz {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.quiz-visual {
	display: flex;
	align-items: center;
	justify-content: center;
}

.quiz-illustration {
	max-width: 100%;
	animation: float 3s ease-in-out infinite;
}

.quiz-illustration img {
	max-width: 100%;
	height: auto;
	filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
}

@keyframes float {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-20px);
	}
}

/* ==========================================================================
   Blog Section
   ========================================================================== */

.blog-section {
	background: white;
}

.blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 30px;
	margin-bottom: 40px;
}

.blog-card {
	background: white;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.blog-thumbnail {
	height: 220px;
	overflow: hidden;
}

.blog-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.blog-card:hover .blog-thumbnail img {
	transform: scale(1.05);
}

.blog-content {
	padding: 25px;
}

.blog-meta {
	display: flex;
	gap: 15px;
	margin-bottom: 15px;
	font-size: 0.85rem;
	color: var(--color-text-light);
}

.blog-meta .category {
	padding: 3px 10px;
	background: var(--color-primary);
	color: var(--color-secondary);
	border-radius: 12px;
	font-weight: 600;
}

.blog-title {
	font-size: 1.3rem;
	margin-bottom: 15px;
}

.blog-title a {
	color: var(--color-secondary);
	text-decoration: none;
	transition: color 0.3s ease;
}

.blog-title a:hover {
	color: var(--color-accent);
}

.blog-excerpt {
	font-size: 0.95rem;
	color: var(--color-text-light);
	line-height: 1.7;
	margin-bottom: 15px;
}

.read-more {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--color-accent);
	font-weight: 600;
	text-decoration: none;
	transition: gap 0.3s ease;
}

.read-more:hover {
	gap: 10px;
}

.blog-categories {
	text-align: center;
	margin-top: 40px;
}

.blog-categories h4 {
	font-size: 1.1rem;
	margin-bottom: 20px;
	color: var(--color-secondary);
}

.categories-list {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.category-tag {
	padding: 8px 15px;
	background: var(--color-bg-light);
	border-radius: 20px;
	color: var(--color-text);
	text-decoration: none;
	font-size: 0.9rem;
	transition: all 0.3s ease;
}

.category-tag:hover {
	background: var(--color-accent);
	color: white;
}

.category-tag .count {
	opacity: 0.7;
	font-size: 0.85rem;
}

/* ==========================================================================
   CTA Final Section
   ========================================================================== */

.cta-final-section {
	background: var(--color-secondary);
	color: white;
	text-align: center;
}

.cta-content h2 {
	font-size: 2.5rem;
	margin-bottom: 20px;
}

.cta-content p {
	font-size: 1.2rem;
	margin-bottom: 30px;
	opacity: 0.9;
}

.cta-buttons {
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
	display: inline-block;
	padding: 12px 30px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
	font-size: 1rem;
}

.btn-large {
	padding: 15px 40px;
	font-size: 1.1rem;
}

.btn-small {
	padding: 8px 20px;
	font-size: 0.9rem;
}

.btn-primary {
	background: var(--color-accent);
	color: white;
}

.btn-primary:hover {
	background: var(--color-accent-dark);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(255, 159, 64, 0.4);
}

.btn-secondary {
	background: var(--color-secondary);
	color: white;
}

.btn-secondary:hover {
	background: var(--color-secondary-light);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(77, 51, 25, 0.4);
}

.btn-accent {
	background: white;
	color: var(--color-secondary);
}

.btn-accent:hover {
	background: var(--color-bg-light);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.hero-title {
		font-size: 2.5rem;
	}

	.hero-subtitle {
		font-size: 1.2rem;
	}

	.quiz-content-wrapper {
		grid-template-columns: 1fr;
	}

	.quiz-info .section-title {
		text-align: center;
		justify-content: center;
	}

	.quiz-visual {
		order: -1;
	}

	.quiz-stats {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	section {
		padding: 50px 0;
	}

	.hero-title {
		font-size: 2rem;
	}

	.hero-subtitle {
		font-size: 1rem;
	}

	.hero-cta-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.section-title {
		font-size: 2rem;
	}

	.annunci-grid,
	.razze-carousel,
	.blog-grid {
		grid-template-columns: 1fr;
	}

	.taglia-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.quiz-stats {
		grid-template-columns: 1fr;
	}

	.cta-content h2 {
		font-size: 1.8rem;
	}

	.cta-content p {
		font-size: 1rem;
	}

	.cta-buttons {
		flex-direction: column;
		align-items: stretch;
	}
}

@media (max-width: 480px) {
	.hero-section {
		min-height: 500px;
	}

	.hero-title {
		font-size: 1.5rem;
	}

	.section-title {
		font-size: 1.5rem;
		flex-direction: column;
		gap: 10px;
	}

	.quick-filters {
		flex-direction: column;
	}

	.filter-btn {
		width: 100%;
	}

	.taglia-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Newsletter Modal
   ========================================================================== */

.newsletter-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.newsletter-modal .modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	cursor: pointer;
}

.newsletter-modal .modal-content {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 500px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: modalSlideIn 0.3s ease-out;
	z-index: 1;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.newsletter-modal .modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border: none;
	background: rgba(0, 0, 0, 0.05);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	z-index: 2;
	color: #64748b;
}

.newsletter-modal .modal-close:hover {
	background: rgba(0, 0, 0, 0.1);
	color: #1e293b;
	transform: rotate(90deg);
}

.newsletter-modal .modal-header {
	padding: 40px 40px 20px;
	text-align: center;
	border-bottom: 1px solid #e2e8f0;
}

.newsletter-modal .modal-header h2 {
	margin: 0 0 12px;
	font-size: 28px;
	font-weight: 700;
	color: var(--color-primary);
}

.newsletter-modal .modal-header p {
	margin: 0;
	font-size: 16px;
	color: #64748b;
	line-height: 1.6;
}

.newsletter-modal .modal-body {
	padding: 30px 40px 40px;
}

.newsletter-modal .newsletter-form .form-group {
	margin-bottom: 24px;
}

.newsletter-modal .newsletter-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #1e293b;
	font-size: 14px;
}

.newsletter-modal .newsletter-form .form-control {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 16px;
	transition: all 0.2s ease;
	background: #fff;
	color: #1e293b;
}

.newsletter-modal .newsletter-form .form-control:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.newsletter-modal .newsletter-form .form-control::placeholder {
	color: #94a3b8;
}

.newsletter-modal .newsletter-form .form-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 20px;
}

.newsletter-modal .newsletter-form .form-checkbox input[type="checkbox"] {
	margin-top: 4px;
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
}

.newsletter-modal .newsletter-form .form-checkbox label {
	margin: 0;
	font-weight: 400;
	font-size: 14px;
	color: #475569;
	cursor: pointer;
}

.newsletter-modal .newsletter-form .form-checkbox label a {
	color: var(--color-primary);
	text-decoration: none;
	font-weight: 600;
}

.newsletter-modal .newsletter-form .form-checkbox label a:hover {
	text-decoration: underline;
}

.newsletter-modal .form-messages {
	padding: 16px;
	border-radius: 8px;
	margin-bottom: 24px;
	font-size: 14px;
	line-height: 1.6;
}

.newsletter-modal .form-messages.success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #6ee7b7;
}

.newsletter-modal .form-messages.error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

.newsletter-modal .btn-block {
	width: 100%;
	justify-content: center;
}

.newsletter-modal .btn-loading {
	display: none;
	align-items: center;
	gap: 8px;
}

.newsletter-modal .spinner {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* Mobile Responsive */
@media (max-width: 640px) {
	.newsletter-modal .modal-header,
	.newsletter-modal .modal-body {
		padding: 24px 20px;
	}

	.newsletter-modal .modal-header h2 {
		font-size: 24px;
	}

	.newsletter-modal .modal-header p {
		font-size: 14px;
	}

	.cta-buttons {
		flex-direction: column;
		gap: 12px;
	}

	.cta-buttons .btn {
		width: 100%;
	}
}
