/* ================= RESET GENERAL ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#map {
    height: 400px;
    /* sau 60vh pentru responsive */
    width: 100%;
    margin-top: 20px;
    /* dacă vrei spațiu sub navbar */
}


body {
    
  font-family: Tahoma;
    font-size: 8pt;
    color: navy;
    background: #fff;
    
    transition: background-color 0.3s ease;
    padding-top: 10px;
    /* începe de la 180px de sus */
    box-sizing: border-box;
    /* ca padding să nu afecteze lățimea totală */
}

body.no-scroll {
    overflow: hidden;
}

/* ================= CENTER ELEMENTS ================= */
.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

/* ================= NAVBAR ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #bae5c7;
    padding: 10px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-radius: 0 0 14px 14px;
    gap: 12px;
    height:170px;
}

.logo-container {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #111;
}

.logo p,
.logo h5 {
    margin: 4px 0 0 0;
    font-weight: 500;
}

/* ================= NAVBAR BUTTONS ================= */
.header-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.header-buttons button {
    background: #fff;
    border: none;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

button svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: stroke 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

button svg path,
button svg line,
button svg circle {
    stroke: currentColor;
}

.header-buttons button:hover svg {
    transform: scale(1.15);
    stroke: #2563eb;
}

button.open svg {
    transform: rotate(360deg) scale(1.15);
    stroke: #2563eb;
}

.plus-btn {
    background: #2563eb;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.plus-btn:hover svg {
    transform: rotate(90deg) scale(1.2);
}

/* ================= OVERLAY ================= */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.open {
    display: flex;
    opacity: 1;
}

.overlay-content {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    min-width: 320px;
    max-width: 90%;
    max-height: 90vh;        /* Limitează înălțimea la 90% din viewport */
    overflow-y: auto;        /* Scroll vertical dacă conținutul depășește */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.overlay.open .overlay-content {
    transform: scale(1);
    opacity: 1;
}

/* ================= CLOSE BUTTON ================= */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4c4c;
    color: #fff;
    border: none;
    font-size: clamp(12px, 2vw, 32px);
    font-weight: bold;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #ff1a1a;
}

.close-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    transition: transform 0.3s ease;
}

.close-btn:hover svg {
    transform: rotate(90deg);
}

/* ================= SHAKE ANIMATION ================= */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}

/* ================= FORM LOGIN/REGISTER ================= */
#loginForm,
#registerForm, 
.adaugaForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: auto;
    align-items: center; /* CENTRARE ORIZONTALĂ */
}


#loginForm input,
#registerForm input,
.adaugaForm input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    transition: border-color 0.3s, box-shadow 0.3s;
}


#loginForm input:focus,
#registerForm input:focus,
.adaugaForm input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
    outline: none;
}


.btn {
    display: inline-flex;           /* aliniere icon + text */
    align-items: center;
    justify-content: center;
    gap: 6px;                       /* spațiu între icon și text */
    width: 40%;                      /* lățime procentuală pe desktop */
    max-width: 300px;                /* să nu fie prea mare */
    min-width: auto;                /* să nu fie prea mic */   
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background-color: #2563eb;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none !important; /* elimină underline */
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px) scale(1.03);
    background-color: #1d4ed8;
}

.btn:active {
    transform: scale(0.97);
}


/* Container autocomplete */
.result-container {
    position: relative;
    /* pentru ca ul absolut să fie poziționat corect */
    width: 100%;
}

/* Lista cu rezultate */
.result-container ul {
    position: absolute;
    top: 100%;
    /* sub input */
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    display: none;
    /* ascuns inițial */
    z-index: 9999;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Show pentru JS */
.result-container ul.show {
    display: block;
}

/* Elemente li */
.result-container li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.result-container li:hover {
    background-color: #2563eb;
    color: #fff;
}

/* ================= MAIN CONTENT ================= */
main {
    padding: 160px 24px 24px;
}

.marfa-content h32 {
    font-size: 18px;
    margin-bottom: 6px;
}

.tip-camion {
    color: #2563eb;
    font-weight: 600;
}

.pret {
    font-size: 20px;
    font-weight: 700;
    color: #16a34a;
    margin-top: 6px;
}

/* ================= MARFURI LIST ================= */
/* Containerul cardurilor */
        /* Centrare și dimensiune card */
        .marfuri-list {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }
    
        .marfa-item {
            width: 100%;
            max-width: 700px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
    
        .marfa-card {
            display: flex;
            width: 100%;
           background: #b4cece;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            cursor: pointer;
            overflow: hidden;
            transition: transform 0.2s ease;
        }
    
        .marfa-card:hover {
            transform: scale(1.02);
        }
    
        .marfa-imagine {
            width: 90px;
            height: 90px;    
            border-radius: 10px 0 0 10px;
          margin-top: 10px;
          margin-left: 10px;
              object-fit: contain;  /* păstrează proporțiile imaginii */
    flex-shrink: 0;       /* nu permite reducerea imaginii în flexbox */
        }
    
        .marfa-content {
            padding: 10px 15px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            
        }
    
        .marfa-details {
            width: 100%;
            background: #fafafa;
            border-radius: 0 0 10px 10px;
            overflow: hidden;
            max-height: 0;
            padding: 0 20px;
            transition: max-height 0.3s ease, padding 0.3s ease;
            margin-top: 0px;
            /* lipit de card */
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        }
    
        .marfa-details.open {
            max-height: 500px;
            /* ajustează după conținut */
            padding: 10px 20px;
        }

/* ARROW */
.arrow {
    margin-left: auto;
    font-size: 1.5em;
    transition: transform 0.3s ease;
}

.marfa-content {
    padding: 15px;
}

.marfa-card.expanded .arrow {
    transform: rotate(180deg);
}


.judet {
    color: gray;       /* culoarea gri */
    margin-left: 100px; /* mută textul 100px spre dreapta */
	vertical-align: bottom;
}

.localitate {
    color: black;       /* culoarea gri */
    margin-left: 5px; /* mută textul 100px spre dreapta */
}


.localitate img{
    vertical-align: middle;
}

p{
   margin:10;
   padding:10;
}


.btn-vezi-anunt {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.btn-vezi-anunt:hover {
    background-color: #2980b9;
}

.slide-menu {
    position: fixed;
    top: 0;
    right: -250px; /* Ascuns implicit */
    width: 250px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1001;
    padding-top: 60px;
}

.slide-menu.show {
    right: 0; /* Slide in */
}

.menu-links a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #111;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    transition: background 0.3s, color 0.3s;
}

.menu-links a:hover {
    background: #bae5c7;
    color: #2563eb;
}


.pagination {
    margin: 30px 0;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.pagination a.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination a:hover {
    background: #f2f2f2;
}




/* Container search box */
.search-bar {
    display: flex;
    flex-wrap: nowrap;
    /* totul pe un singur rând */
    width: 100%;
    max-width: 600px;
    border: 2px solid #007bff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    box-sizing: border-box;
    align-items: center;
    padding: 5px 10px;
}

/* Wrapper input + clear button */
.search-input-wrapper {
    flex: 1 1 auto;
    /* ocupă spațiul disponibil */
    display: flex;
    align-items: center;
    position: relative;
    min-width: 0;
    /* previne overflow */
}

/* Input text */
.search-bar input[type="text"] {
    flex: 1 1 auto;
    padding: 10px 30px 10px 12px;
    border: none;
    font-size: 16px;
    outline: none;
    min-width: 0;
    /* foarte important pe mobil */
    border-radius: 50px;
    box-sizing: border-box;
    border: 1px solid #ccc;
}

/* Clear button ❌ */
#clearSearch {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #888;
    user-select: none;
}

/* Select field */
.search-bar select {
    flex: 0 1 auto;
    /* ocupă spațiu doar cât are nevoie */
    margin-left: 10px;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 50px;
    border: 1px solid #ccc;
    min-width: 80px;
    max-width: 150px;
    box-sizing: border-box;
}

/* Button submit */
.search-bar button {
    flex: 0 1 auto;
    /* ocupă spațiu doar cât are nevoie */
    margin-left: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 50px;
    transition: background 0.3s;
}

.search-bar button:hover {
    background-color: #0056b3;
}

.back-btn {
    display: inline-block;
    padding: 8px 12px;
    margin-top: 15px;
    background: #4CAF50;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}


.stats {
    background: #f5f5f5;
    padding: 12px 20px;
    margin: -10px auto 10px auto; /* 100px spațiu de sus */
    border-radius: 10px;
   display:block;
    clear:both;
    justify-content: space-around;
    max-width: 1000px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
   gap: 5px; /* spațiul între marfuri și utilizatori */
    font-weight: normal; /* nu mai e bold */
    font-size: 10px;    /* puțin mai mic decât înainte */
    border-top: 1px solid #ccc;
	 width:100%;
    text-align:center;




}






.btn-favorite {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 100%;
	
}


.btn-favorite::after {
  content: "Adaugă la favorite";
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  background: black;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.btn-favorite:hover::after {
  opacity: 1;
}




.favorite-star {
  width: 25px;
  height: 25px;
  transition: transform 0.3s ease;
}

.favorite-star .star {
  fill: none;
  stroke: #555;
  stroke-width: 2;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

/* când e favorit */
.btn-favorite.favorited .star {
  fill: gold;
  stroke: gold;
  animation: pulse 0.3s ease;
}

.btn-favorite.favorited::after {
  content: "Șterge de la favorite";
}

/* efect de puls la click */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}




@media (max-width: 480px) {
    .search-bar {
        flex-wrap: wrap;
        /* permite elementelor să treacă pe rând nou */
        max-width: 100%;
        /* ocupă tot ecranul */
        padding: 5px;
        box-sizing: border-box;
        border-radius: 0;
        border: 0px solid #007bff;
        box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1);
    }

    .search-bar input[type="text"] {
        flex: 1 1 100%;
        /* input-ul ocupă rând complet dacă e nevoie */
        min-width: 0;
        /* important pentru a nu depăși containerul */
    }

    .search-bar select,
    .search-bar button {
        flex: 1 1 auto;
        /* se ajustează la conținut */
        min-width: 0;
        /* prevenim overflow */
        margin: 5px 0 0 0;
        /* spațiu între rânduri când se rup */
    }

.stats {
    
    
    margin: -10px auto 10px auto; /* 100px spațiu de sus */

}




.btn-favorite {
 
  margin-left: 80%;
}


	



}




/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    .marfa-item {
        flex: 0 0 45%; /* 2 carduri pe rând */
        max-width: 45%;
    }
}

@media (max-width: 768px) {
    .logo-container {
        justify-content: center;
    }

    .buttons-row {
        justify-content: center;
        gap: 8px;
    }

    .navbar {
        padding: 10px 16px;
    }

    .close-btn {
        font-size: 32px;
        width: 30px;
        height: 30px;
    }

    #registerForm,
    #loginForm {
        max-height: 90vh;
        overflow-y: auto;
        padding: 15px;
    }

    .marfuri-list {
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
        align-items: center;
    }

    .marfa-item {
        flex: 0 0 100%;
        max-width: 99%;
    }

    .marfa-card {
        flex-direction: row;
      
      gap: 10px;
    }

   

.marfa-imagine {
    width: 90px;  
    height: 90px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin: 0 auto; /* eliminăm centrările greșite */
  flex-shrink: 0; /* 🔥 nu se micșorează */
  margin-top: 10px;
  margin-left: 2px;
     object-fit: contain;  /* păstrează proporțiile imaginii */
  
}


    .marfa-content {
        width: 100%;
        gap: 2px;
        padding: 10px;
   flex: 1; /* ocupă restul spațiului */
    }

.btn {
        width: 90%;        /* buton full-width pe mobil */
        min-width: auto;   /* elimină min-width fix */
    }











}
