/* =========================================
   1. VARIABLES & RESET (ŽALIA TEMA)
   ========================================= */
:root {
    /* Miško Žalia */
    --primary: #16a34a;       /* Žalia (Green-600) */
    --primary-hover: #15803d; /* Tamsesnė žalia */
    --accent: #ea580c;        /* Oranžinė (Kontrastas) */
    --accent-hover: #c2410c;
    
    /* Neutralios spalvos */
    --bg: #f0fdf4;            /* Labai šviesiai žalsvas fonas */
    --surface: #ffffff;       /* Balta */
    --text-main: #111827;     /* Tamsiai pilka */
    --text-muted: #6b7280;    /* Pilkesnė */
    --border: #d1d5db;        /* Rėmeliai */
    
    /* Statusai */
    --danger: #dc2626;
    --success: #16a34a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* =========================================
   2. NAVIGATION BAR
   ========================================= */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nav-flex { display: flex; justify-content: space-between; align-items: center; }

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 20px; align-items: center; }

.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.nav-link:hover { color: var(--primary); }

/* =========================================
   3. BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-accent {
    background: var(--accent);
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3); }

.btn-danger { background: #fee2e2; color: #ef4444; }
.btn-danger:hover { background: #fecaca; }

/* =========================================
   4. HERO SECTION (SEARCH)
   ========================================= */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #064e3b 100%);
    padding: 60px 0;
    margin-bottom: 40px;
    color: white;
    text-align: center;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.search-box {
    background: var(--surface);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.search-input, .search-select {
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    background: #fff;
    color: var(--text-main);
}
.search-input { flex-grow: 2; }
.search-select { flex-grow: 1; width: 180px; cursor: pointer; }

/* =========================================
   5. CATEGORIES (GRID DETAILED)
   ========================================= */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-main);
    display: flex;
    align-items: center;
}
.section-title::before {
    content: ''; display: block; width: 5px; height: 24px;
    background: var(--primary); margin-right: 12px; border-radius: 2px;
}

.cat-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.cat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: 0.2s;
}

.cat-box:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
    text-decoration: none;
}

.cat-header:hover {
    color: var(--primary);
}

.cat-icon {
    font-size: 1.5rem;
}

.sub-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 5px;
}

.sub-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: 0.2s;
    text-decoration: none;
}

.sub-link:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.sub-link-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 5px;
    display: inline-block;
}

/* =========================================
   6. ADS LISTING (CARDS)
   ========================================= */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.ad-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    position: relative; 
}

.ad-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: #cbd5e1;
}

.ad-img-container {
    height: 180px;
    width: 100%;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.ad-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.ad-card:hover .ad-img { transform: scale(1.05); }

.ad-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ad-cat-tag { font-size: 0.75rem; color: var(--primary); text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }

.ad-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.ad-price { font-size: 1.25rem; font-weight: 800; color: var(--text-main); }

/* --- VIP SKELBIMO STILIUS --- */
.ad-card.promoted {
    border: 2px solid var(--accent);
    background: #fffbeb;
    position: relative;
}

.ad-card.promoted::after {
    content: '⭐ Iškeltas';
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    z-index: 20;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* =========================================
   7. FOOTER STILIUS
   ========================================= */
.site-footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 60px 0 30px;
    margin-top: 100px;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 700;
}

.footer-col ul li { margin-bottom: 10px; }

.footer-col a { color: #94a3b8; transition: 0.2s; }
.footer-col a:hover { color: white; padding-left: 5px; }

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 30px;
    text-align: center;
}

/* =========================================
   8. ŠIRDELĖS MYGTUKAS
   ========================================= */
.heart-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.heart-btn:hover { transform: scale(1.1); background: white; color: #fca5a5; }
.heart-btn.active { color: #ef4444; border-color: #fca5a5; background: #fff; }

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

@media (max-width: 768px) {
    .nav-flex { flex-direction: column; gap: 15px; }
    .search-box { flex-direction: column; padding: 15px; }
    .search-select { width: 100%; }
    .cat-grid-detailed { grid-template-columns: repeat(1, 1fr); }
    .ads-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}