:root {
    /* Statybuskelbimai.lt paletė. Grafito/plieno mėlyna + statybinė gintarinė.
       Pastaba: žemiau perrašomos Bootstrap .text-success / .bg-success / .btn-success
       klasės, todėl šablonuose paliktos „success" klasės automatiškai gauna
       naują firminę spalvą — nereikia liesti kiekvieno šablono. */
    --brand-main: #2f5d8a;
    --brand-dark: #1b2a38;
    --brand-accent: #f59e0b;
    --brand-accent-dark: #d97706;
    --bg-light: #f3f4f6;
}

/* --- BOOTSTRAP SPALVŲ PERRAŠYMAS (žalia -> firminė) --- */
.text-success { color: var(--brand-main) !important; }
.bg-success { background-color: var(--brand-main) !important; }
.border-success { border-color: var(--brand-main) !important; }
.btn-success {
    background-color: var(--brand-main) !important;
    border-color: var(--brand-main) !important;
    color: #fff !important;
}
.btn-success:hover, .btn-success:focus {
    background-color: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
}
.btn-outline-success {
    color: var(--brand-main) !important;
    border-color: var(--brand-main) !important;
}
.btn-outline-success:hover {
    background-color: var(--brand-main) !important;
    color: #fff !important;
}
.link-success, a.text-success:hover { color: var(--brand-dark) !important; }
.form-check-input:checked {
    background-color: var(--brand-main);
    border-color: var(--brand-main);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-main);
    box-shadow: 0 0 0 0.2rem rgba(47, 93, 138, 0.15);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: #374151;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- NAVIGATION (HEADER) --- */
.navbar {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-main) 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    color: white !important;
}

.navbar .nav-link {
    font-weight: 500;
    transition: opacity 0.2s;
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar .nav-link:hover {
    opacity: 0.9;
    color: var(--brand-accent) !important;
}

/* --- BUTTONS --- */
.btn-sk {
    background-color: var(--brand-accent);
    color: #111;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s;
}

.btn-sk:hover {
    background-color: var(--brand-accent-dark);
    transform: translateY(-1px);
}

/* --- MOBILE NAV (TOP) --- */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(0, 0, 0, 0.15);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 10px;
    }
    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 5px 0;
    }
    .nav-item:last-child {
        border-bottom: none;
    }
    .btn-sk {
        width: 100%;
        margin-top: 10px;
    }
}

/* --- CARDS & GENERIC --- */
.card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
    position: relative;
}

/* --- FOOTER (PAGRINDINIS) --- */
.footer {
    background-color: #111827;
    color: #9ca3af;
    padding-top: 0 !important;
    padding-bottom: 15px;
    margin-top: auto;
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.95rem;
    display: inline-block;
    margin-top: 20px; 
}

.footer a:hover {
    color: var(--brand-accent);
}

.footer p {
    margin: 0;
    margin-top: 15px;
    font-size: 0.75rem;
}

/* --- MOBILIOJI VERSIJA - VERTIKALUS MENIU --- */
@media (max-width: 768px) {
    #footer-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 0 10px;
    }
    #footer-menu a {
        display: block !important;
        width: 100%;
        margin: 0 !important;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
        font-size: 1rem;
    }
    #footer-menu a:last-child {
        border-bottom: none;
    }
    .footer p {
        margin-top: 20px;
        font-size: 0.8rem;
    }
}

/* --- UI ELEMENTS --- */
#cookieBanner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #111827;
    color: white;
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    display: none;
    border-top: 4px solid var(--brand-main);
}

#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 1000;
    background-color: var(--brand-main);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

#btn-back-to-top:hover {
    background-color: var(--brand-dark);
    transform: translateY(-3px);
}

/* --- CONTACT PAGE FIX --- */
.contact-left-box {
    background-color: var(--brand-main) !important;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-main) 100%) !important;
    color: white !important;
}

.contact-left-box * {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.contact-left-box i {
    color: var(--brand-accent) !important;
}

/* ==========================================================================
   HOMEPAGE GRID & CARD STYLES
   ========================================================================== */

/* 1. PAGRINDINIS TINKLELIS (Mobilus) */
.sk-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 1rem; 
}

.sk-grid-item.left-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: auto; 
}

.cat-card-wide {
    min-height: 280px; 
}

/* 2. PLANŠETĖMS (>= 768px) */
@media (min-width: 768px) {
    .sk-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 3. MAŽI KOMPIUTERIAI (>= 992px) */
@media (min-width: 992px) {
    .sk-grid {
        grid-template-columns: repeat(4, 1fr); 
        grid-auto-rows: minmax(200px, auto); 
    }
    .sk-grid-item.left-column {
        grid-row: span 2; 
        height: 100%; 
    }
    .cat-card-wide {
        flex: 3; 
        min-height: 0; 
        margin-bottom: 0; 
    }
    .cat-card-wide-alt {
        flex: 1; 
        min-height: 0;
    }
}

/* 4. DIDELI EKRANAI (>= 1200px) - 5 stulpeliai */
@media (min-width: 1200px) {
    .sk-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Kiti stiliai tituliniam */
.hover-green:hover { color: var(--brand-main) !important; text-decoration: underline !important; }
.hover-card { transition: all 0.3s ease; }
.hover-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }
.vip-card { border: 2px solid #ffd700 !important; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.15) !important; }
.vip-card:hover { box-shadow: 0 10px 25px rgba(255, 215, 0, 0.25) !important; }
.transition-transform { transition: transform 0.2s ease; }
.transition-transform:hover { transform: translateY(-3px); }
.cat-card:hover { background-color: #f8fafc; }

.title-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.desc-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    opacity: 0.8;
}

/* Svarbu mygtuko pozicionavimui - kad nebūtų "button in anchor" klaidos */
.card-actions {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10; /* Aukščiau nei nuoroda */
    padding: 0.5rem;
    pointer-events: none; /* Leidžia paspaudimams praeiti kiaurai konteinerį... */
}
.card-actions button {
    pointer-events: auto; /* ...bet pagauna paspaudimą ant paties mygtuko */
}

/* Nuoroda per visą kortelę, bet po mygtuku */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* ==========================================================================
   DETAIL PAGE STYLES
   ========================================================================== */
.gallery-thumb:hover { 
    opacity: 0.7; 
    border-color: var(--brand-main) !important; 
} 
.active-thumb { 
    border: 2px solid var(--brand-main) !important; 
    opacity: 1; 
} 
.bg-black { 
    background-color: #000 !important; 
} 
.pointer-events-none { 
    pointer-events: none; 
}

/* ==========================================================================
   LIST PAGE STYLES
   ========================================================================== */
.page-link { 
    color: var(--brand-dark); 
    background: white; 
}
.page-item.active .page-link { 
    background-color: var(--brand-main); 
    color: white; 
}
.page-link:hover { 
    background-color: #f1f5f9; 
    color: var(--brand-main); 
}
.vip-border { 
    border: 2px solid #ffd700 !important; 
}

/* ==========================================================================
   PUBLIC PROFILE STYLES
   ========================================================================== */
.ls-1 { letter-spacing: 1px; }

.menu-link {
    color: #212529; 
    font-size: 0.9rem; 
    border: none;
    transition: background-color 0.2s, color 0.2s;
}
.menu-link:hover {
    background-color: #f8f9fa;
    color: #198754; 
}

.active-cat {
    background-color: #f1f5f9 !important; 
    color: #2f5d8a !important; 
    font-weight: 700;
    border-left: 4px solid #2f5d8a;
}
.list-group-item { border: none; }

/* ==========================================================================
   MAP PAGE STYLES
   ========================================================================== */
.map-card {
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    overflow: hidden;
}
.map-header {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}
/* Filtrai vienoje eilutėje su tarpu */
#mapFilters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 991px) {
    .map-card { height: 75vh; }
}

#map {
    flex-grow: 1; 
    width: 100%;
    min-height: 0;
    z-index: 1;
}

/* ==========================================================================
   LOGIN / REGISTER / AUTH FORMS
   ========================================================================== */
.form-floating > .form-control:focus, 
.form-floating > .form-control:not(:placeholder-shown) { 
    padding-top: 1.625rem; 
    padding-bottom: .625rem; 
}
.form-floating > .form-control:-webkit-autofill { 
    -webkit-box-shadow: 0 0 0 30px #f8f9fa inset !important; 
}
.hover-underline:hover { text-decoration: underline !important; }
.hover-up { transition: transform 0.2s; }
.hover-up:hover { transform: translateY(-2px); }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }
@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ==========================================================================
   ABOUT & TERMS PAGE STYLES
   ========================================================================== */
.lh-lg { line-height: 1.8; }
.text-justify { text-align: justify; }

/* ==========================================================================
   FORM / UPLOAD STYLES
   ========================================================================== */
.drop-zone.dragover {
    background-color: #d1e7dd !important;
    border-color: #198754 !important;
    transform: scale(1.01);
}

/* ==========================================================================
   DASHBOARD / MY ADS STYLES
   ========================================================================== */
.hover-card { transition: transform 0.2s, box-shadow 0.2s; }
.hover-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }

.listing-card img { 
    height: 220px !important; 
    width: 100%; 
    object-fit: cover; 
    transition: all 0.3s; 
}

.title-clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.desc-clamp { 
    display: -webkit-box; 
    -webkit-line-clamp: 4; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    line-height: 1.4em; 
    height: 5.6em; 
    margin-bottom: 0.5rem; 
}

.hover-green:hover { color: var(--brand-main) !important; text-decoration: underline !important; }
.btn-group .btn.active-view { background-color: var(--brand-main); color: white; border-color: var(--brand-main); }

/* LIST VIEW FOR DASHBOARD */
.list-view-container .listing-item-wrapper { width: 100%; flex: 0 0 100%; max-width: 100%; }
.list-view-container .listing-card { flex-direction: row; height: auto; min-height: 180px; align-items: stretch; }
.list-view-container .listing-img-container { width: 240px; flex-shrink: 0; height: auto; }
.list-view-container .listing-card img, .list-view-container .listing-img-container > div { height: 100% !important; border-radius: 0.375rem 0 0 0.375rem !important; }
.list-view-container .card-body { padding: 1.2rem; justify-content: center; }
.list-view-container .title-clamp { -webkit-line-clamp: 1; font-size: 1.2rem; margin-bottom: 0.2rem; }
.list-view-container .desc-clamp { -webkit-line-clamp: 2; height: auto; margin-bottom: 0.5rem; }
.list-view-container .action-buttons { margin-top: auto; justify-content: flex-end; border-top: none !important; padding-top: 0 !important; }

@media (max-width: 768px) {
    .list-view-container .listing-card { flex-direction: column; }
    .list-view-container .listing-img-container { width: 100%; height: 200px; }
    .list-view-container .listing-card img { border-radius: 0.375rem 0.375rem 0 0 !important; }
    .list-view-container .action-buttons { justify-content: space-between; border-top: 1px solid #dee2e6 !important; padding-top: 1rem !important; }
}