/* ==================== FILTER & SEARCH ==================== */
.filter-bar {
	padding: 12px 24px;
	margin: -32px auto 40px auto;
	box-shadow: var(--shadow-md);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	backdrop-filter: blur(4px);
}

.search-input {
	width: 80%;
	max-width: 1000px;
	padding: 14px 20px;
	border: 3px solid var(--accent-primary-rotated);
	border-radius: 60px;
	font-size: 1rem;
	background: var(--bg-primary-rotated);
	transition: all 0.2s;

	margin: 0 auto;
	display: block;
}

.search-input:focus {
	outline: none;
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 3px rgba(201,160,61,0.2);
}

.filter-group {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	width: 100%;
}

.filter-chip {
	background: var(--accent-primary-rotated);
	padding: 8px 20px;
	border-radius: 40px;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 600;
	transition: all 0.2s;
	color: var(--charcoal);
}

.filter-chip.active,
.filter-chip:hover {
	background: none;
	color: var(--accent-primary-rotated);
	border: 1px solid var(--accent-primary-rotated);
	font-weight: bold;
	transform: scale(0.97);
}

/* ==================== TIPS GRID (CARDS) ==================== */
.tips-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
	gap: 2.5rem;
	padding: 2rem;
	width: 100%;
}

.tip-card {
	background: var(--bg-primary-rotated);
	border-radius: 16px;
	overflow: hidden;
	border: 2px solid var(--accent-primary-rotated);
	display: flex;
	flex-direction: column;
	box-shadow: var(--shadow-sm);
	transition:
		transform 0.35s ease,
		box-shadow 0.35s ease,
		border-color 0.3s ease;

	cursor: pointer;
	position: relative;
}

.tip-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--shadow-lg);
	border-color: var(--gold-light);
}

/* IMAGE SECTION */
.card-img {
	width: 100%;
	height: 260px;

	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;

	position: relative;
	flex-shrink: 0;

	transition: transform 0.5s ease;
}

.tip-card:hover .card-img {
	transform: scale(1.03);
}

/* DARK IMAGE OVERLAY */
.card-img::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0,0,0,0.45),
		rgba(0,0,0,0.05)
	);
}

/* CATEGORY BADGE */
.card-category {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	background: var(--accent-primary-rotated);
	backdrop-filter: blur(6px);
	padding: 7px 16px;
	border-radius: 40px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--gold-light);
	text-transform: uppercase;
}

/* DATE BADGE */
.card-date {
	position: absolute;
	bottom: 14px;
	right: 16px;
	z-index: 2;
	background: rgba(0,0,0,0.55);
	backdrop-filter: blur(6px);
	padding: 5px 14px;
	border-radius: 30px;
	font-size: 0.72rem;
	font-weight: 600;
	color: white;
}

/* CONTENT SECTION */
.card-content {
	background: var(--white);
	padding: 24px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	position: relative;
	z-index: 1;
}

/* TITLE */
.card-title {
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--accent-primary-rotated);
	margin-bottom: 14px;
}

/* DESCRIPTION */
.card-desc {
	font-size: 0.96rem;
	line-height: 1.7;
	margin-bottom: 20px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--text-primary1);
}

/* READ MORE LINK */
.read-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	color: var(--accent-primary-rotated);
	font-weight: 700;
	font-size: 0.95rem;

	text-decoration: none;

	transition: all 0.25s ease;
}

.read-more:hover {
	color: var(--accent-primary);
	transform: translateX(4px);
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {

	.tips-grid {
		gap: 1.8rem;
	}

	.card-img {
		height: 220px;
	}

	.card-content {
		padding: 20px;
	}

	.card-title {
		font-size: 1.25rem;
	}
}
/* Empty state */
.empty-state {
	grid-column: 1/-1;
	text-align: center;
	padding: 80px 20px;
	background: var(--white);
	border-radius: 48px;
}
/* Loading */
.loading-spinner {
	text-align: center;
	padding: 60px;
}
.spinner {
	width: 50px;
	height: 50px;
	border: 4px solid var(--sand);
	border-top: 4px solid var(--gold);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Footer CTA */
.footer-cta {
	background: linear-gradient(135deg, var(--forest) 0%, #0f2a1f 100%);
	border-radius: 48px;
	padding: 64px 32px;
	text-align: center;
	margin: 60px 0 40px;
	color: white;
}
.btn-safari {
	background: var(--accent-primary-rotated);
	border: none;
	padding: 16px 42px;
	font-size: 1.1rem;
	font-weight: 700;
	border-radius: 60px;
	margin-top: 24px;
	cursor: pointer;
	transition: 0.25s;
	color: var(--forest);
}
.btn-safari:hover {
	background: var(--accent-primary);
	transform: scale(1.02);
}

/* ==================== MODAL CMS (Glassmorphism) ==================== */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.75);
	backdrop-filter: blur(8px);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}
.modal-content {
	background: rgba(255,255,255,0.98);
	max-width: 600px;
	width: 90%;
	border-radius: 48px;
	padding: 32px;
	box-shadow: var(--shadow-lg);
	animation: modalFadeIn 0.3s ease;
	position: relative;
}
@keyframes modalFadeIn {
	from { opacity: 0; transform: scale(0.95);}
	to { opacity: 1; transform: scale(1);}
}
.modal-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 24px;
}
.modal-header h2 { color: var(--forest); }
.close-modal {
	font-size: 32px;
	cursor: pointer;
	background: none;
	border: none;
	color: var(--charcoal);
}
.form-group {
	margin-bottom: 20px;
}
.form-group label {
	font-weight: 600;
	display: block;
	margin-bottom: 8px;
}
.form-group input, .form-group select, .form-group textarea {
	width: 100%;
	padding: 14px 16px;
	border-radius: 28px;
	border: 1px solid #ddd;
	font-family: inherit;
}
.form-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}
.btn-save {
	background: var(--forest);
	color: white;
	padding: 12px 28px;
	border: none;
	border-radius: 40px;
	font-weight: bold;
	cursor: pointer;
}
.btn-cancel {
	background: #ccc;
	border: none;
	border-radius: 40px;
	padding: 12px 24px;
	cursor: pointer;
}
.admin-list {
	margin-top: 28px;
	max-height: 280px;
	overflow-y: auto;
	border-top: 1px solid var(--sand);
	padding-top: 20px;
}
.tip-admin-item {
	background: #f7f2ea;
	border-radius: 28px;
	padding: 12px 16px;
	margin-bottom: 10px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.admin-actions button {
	background: none;
	border: none;
	font-size: 1.2rem;
	cursor: pointer;
	margin: 0 4px;
}
.message-toast {
	position: fixed;
	bottom: 30px;
	right: 30px;
	background: var(--forest);
	color: white;
	padding: 12px 24px;
	border-radius: 60px;
	z-index: 1100;
	animation: fadeInOut 3s forwards;
}
@keyframes fadeInOut {
	0% { opacity: 0; transform: translateY(20px);}
	15% { opacity: 1; transform: translateY(0);}
	85% { opacity: 1; transform: translateY(0);}
	100% { opacity: 0; transform: translateY(20px); visibility: hidden;}
}
@media (max-width: 768px) {
	.filter-bar { flex-direction: column; border-radius: 40px; align-items: stretch; }
	.navbar { flex-direction: column; text-align: center; }
}

.tip-popup-overlay{
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: rgba(0,0,0,0.7);
    display:flex;
    justify-content:center;
    align-items:flex-start;
    overflow-y:auto;
    z-index:9999;
    padding:40px 20px;
}

.tip-popup{
    background: var(--bg-primary1);
    width: 100%;
    max-width: 700px;
    border-radius: 20px;
    overflow: visible;
    position: relative;
    animation: popupFade 0.3s ease;
}

.tip-popup::-webkit-scrollbar{
    width: 8px;
}

.tip-popup::-webkit-scrollbar-track{
    background: #f1f1f1;
    border-radius: 10px;
}

.tip-popup::-webkit-scrollbar-thumb{
    background: var(--accent-primary);
    border-radius: 10px;
}

.tip-popup::-webkit-scrollbar-thumb:hover{
    background: #3d5223;
}

.popup-image{
    height:300px;
    background-size:cover;
    background-position:center;
}

.popup-content{
    padding:25px;
}

.popup-content h2{
    margin-bottom:15px;
    color:var(--accent-primary);
}

.popup-content p{
    line-height:1.8;
    color:var(--text-primary);
}

.close-popup{
    position:absolute;
    top:15px;
    right:15px;
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    background:#fff;
    font-size:24px;
    cursor:pointer;
    box-shadow:0 2px 10px rgba(0,0,0,0.2);
}

@keyframes popupFade{
    from{
        opacity:0;
        transform:scale(0.9);
    }
    to{
        opacity:1;
        transform:scale(1);
    }
}