/* ======================================================================
   TAMILADS MASTER STYLE (AdBlock Proof)
====================================================================== */

:root {
  --primary: #D42D35;   /* TamilAds Red */
  --secondary: #0033A0; /* Deep Blue */
  --text: #2c3e50;
  --bg: #f4f6f8;
  --white: #ffffff;
  --border: #e1e4e8;
  --success: #27ae60;
  --header-h: 70px;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; }
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); margin: 0; line-height: 1.6;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* --- HEADER --- */
.site-header { background: var(--white); height: var(--header-h); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.site-header .container { height: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo-image { height: 45px; width: auto; }

/* --- AUTH AREA --- */
.auth-area { display: flex; align-items: center; gap: 15px; }
.user-info { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.auth-btn { background: var(--primary); color: #fff; padding: 8px 18px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; border: none; cursor: pointer; }
.auth-btn:hover { background: #b91d25; transform: translateY(-1px); }
.logout-btn { background: #6c757d; }
.logout-btn:hover { background: #5a6268; }

/* --- HERO SECTION --- */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('/assets/img/hero-background.jpg');
    background-size: cover; background-position: center;
    color: white; text-align: center; padding: 60px 20px; margin-bottom: 30px; border-radius: 0 0 20px 20px;
}
.hero-content h2 { font-size: 2.2rem; margin-bottom: 10px; font-weight: 800; }
.search-box form {
    display: flex; gap: 10px; max-width: 700px; margin: 20px auto;
    background: rgba(255,255,255,0.25); padding: 8px; border-radius: 8px; backdrop-filter: blur(8px);
}
.search-box input, .search-box select { flex: 1; padding: 12px; border: none; border-radius: 6px; font-size: 1rem; }
.search-box button { background: var(--secondary); color: white; border: none; padding: 0 25px; border-radius: 6px; font-weight: bold; cursor: pointer; }
@media (max-width: 600px) { .search-box form { flex-direction: column; } }

/* --- LISTING GRID (The Design Fix) --- */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Responsive Grid */
    gap: 20px;
    margin-bottom: 40px;
}

.listing-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.listing-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.listing-img { width: 100%; height: 180px; object-fit: cover; background: #eee; }
.listing-body { padding: 15px; }
.listing-title { font-size: 1.1rem; margin: 0 0 5px; color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-meta { font-size: 0.85rem; color: #7f8c8d; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.6em; }
.listing-price { display: inline-block; padding: 4px 10px; background: #e8f5e9; color: var(--success); border-radius: 4px; font-weight: 700; font-size: 0.9rem; }

/* --- VIEW PAGE LAYOUT --- */
.view-layout { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 30px; }
.view-main { flex: 1; min-width: 60%; } /* Left Side */
.view-sidebar { flex: 0 0 320px; }      /* Right Side (Fixed Width) */

.view-header h1 { font-size: 2rem; margin: 0 0 10px; line-height: 1.2; }
.view-date { color: #888; font-size: 0.9rem; margin-bottom: 20px; display: block; }

/* Carousel */
.gallery-box { position: relative; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 30px; aspect-ratio: 16/9; }
.gallery-slide { display: none; height: 100%; width: 100%; }
.gallery-slide.active { display: flex; align-items: center; justify-content: center; animation: fadeIn 0.4s; }
.gallery-img { max-width: 100%; max-height: 100%; object-fit: contain; }
@keyframes fadeIn { from {opacity:0.5} to {opacity:1} }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.6); color: white; border: none; padding: 10px; cursor: pointer; font-size: 20px; z-index: 10; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

/* Sidebar Widgets */
.widget-box { background: var(--white); border: 1px solid var(--border); padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.widget-title { font-size: 1.1rem; border-bottom: 2px solid #f0f0f0; padding-bottom: 10px; margin-top: 0; margin-bottom: 15px; }
.user-badge { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.contact-phone { font-size: 1.2rem; font-weight: bold; color: var(--text); background: #f8f9fa; padding: 10px; text-align: center; border-radius: 6px; }

/* Expire Warning */
.expire-alert { background: #fff3cd; color: #856404; padding: 12px; border-radius: 8px; font-size: 0.9rem; text-align: center; border: 1px solid #ffeeba; margin-top: 15px; }

/* Share Buttons */
.share-row { display: flex; gap: 10px; margin-bottom: 20px; }
.share-btn { flex: 1; padding: 10px; border-radius: 6px; text-align: center; color: white; font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; display: flex; align-items: center; justify-content: center; gap: 5px; }
.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-copy { background: #eee; color: #333; }

/* --- INFINITE MARQUEE (TICKER) --- */
.ticker-section { margin-top: 50px; overflow: hidden; }
.ticker-header { font-size: 1.4rem; margin-bottom: 20px; padding-left: 10px; border-left: 5px solid var(--primary); }
.ticker-wrap { width: 100%; overflow: hidden; }
.ticker-track {
    display: flex; gap: 20px; width: max-content;
    animation: tickerScroll 35s linear infinite; /* Smooth continuous scroll */
}
.ticker-track:hover { animation-play-state: paused; } /* Pauses on hover */

@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Ticker Card */
.ticker-card { width: 220px; flex-shrink: 0; background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ticker-img { width: 100%; height: 140px; object-fit: cover; }
.ticker-info { padding: 10px; }
.ticker-title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.ticker-loc { font-size: 0.8rem; color: #888; }

/* --- FOOTER --- */
.site-footer { background: #222; color: #ccc; padding: 40px 0; margin-top: 60px; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a { color: #aaa; font-size: 0.95rem; }
.footer-links a:hover { color: white; }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .view-layout { flex-direction: column; }
    .view-sidebar { width: 100%; flex: none; }
}
@media (max-width: 600px) {
    .listing-grid { grid-template-columns: 1fr 1fr; gap: 10px; } /* 2 columns on mobile */
    .listing-img { height: 140px; }
    .ticker-card { width: 180px; } /* Smaller ticker items on mobile */
    .auth-area span { display: none; } /* Hide username on mobile */
}