/* VARIABLAT DHE RESETIMI */
:root {
    --accent: #27ae60;
    --dark: #1a1a1a;
    --light: #ffffff;
    --gray: #f4f4f4;
    --bg: #f2f2f2;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', sans-serif; background: var(--gray); color: var(--dark); line-height: 1.6; overflow-x: hidden; scroll-behavior: smooth; }

/* NAVBAR (E përbashkët për të dyja faqet) */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 8%; background: var(--light); position: sticky; top: 0; z-index: 2000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.logo { font-size: 24px; font-weight: 900; letter-spacing: -1px; }
.logo span { color: var(--accent); }

.nav-links { display: flex; list-style: none; gap: 25px; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 700; font-size: 14px; text-transform: uppercase; transition: 0.3s; }
.nav-links a:hover { color: var(--accent); }

.menu-icon { display: none; font-size: 28px; cursor: pointer; }

/* HERO SECTION (Për Ballinën dhe Trungun) */
.hero-main, .hero {
    height: 40vh; /* E përshtatur që të jetë kompakte për trungun */
    min-height: 300px;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                url('foto\\fffff.png') center/cover;
    display: flex; align-items: center; justify-content: center; text-align: center; color: white;
    padding: 0 20px;
}
.hero-content h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; line-height: 1.1; }
.hero-content p { font-size: 1.2rem; max-width: 700px; margin: 0 auto 30px; opacity: 0.9; }

/* KËRKIMI (SEARCH BAR) */
.search-container { position: relative; width: 90%; max-width: 450px; margin: 20px auto 0; z-index: 1001; }
#searchInput { 
    width: 100%; padding: 15px 25px; border-radius: 50px; border: none; 
    font-weight: 600; outline: none; box-shadow: 0 4px 20px rgba(0,0,0,0.3); font-size: 16px;
}
.search-results {
    position: absolute; top: 60px; left: 0; width: 100%; background: white;
    border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 3000;
    max-height: 300px; overflow-y: auto; display: none;
}
.search-item { padding: 15px 20px; border-bottom: 1px solid #eee; text-align: left; cursor: pointer; color: #333; transition: 0.2s; }
.search-item:hover { background: #f9f9f9; }
.search-item b { display: block; font-size: 15px; color: var(--dark); }
.search-item span { font-size: 12px; color: var(--accent); font-weight: bold; }

/* QUICK ACCESS CARDS (Për index.html) */
.quick-access { padding: 60px 8%; margin-top: -50px; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.info-card {
    background: white; padding: 40px 30px; border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: 0.3s; text-align: center;
}
.info-card:hover { transform: translateY(-10px); }
.info-card.highlight { border: 2px solid var(--accent); }
.info-card .icon { font-size: 40px; margin-bottom: 20px; }
.info-card h3 { font-size: 1.5rem; font-weight: 900; margin-bottom: 15px; }

/* TRUNGU STYLES (Për trungu-familjar.html) */
.container { padding: 40px 8%; }
.section-title { font-size: 1.8rem; text-align: center; font-weight: 900; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 1px; }

.family-selection-grid, .family-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;
}
.f-card, .member-card {
    background: white; padding: 25px 15px; text-align: center; border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); cursor: pointer; transition: 0.3s;
}
.f-card:hover, .member-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.f-card h3 { font-size: 1rem; font-weight: 900; margin: 0; }
.active-green { border-bottom: 5px solid var(--accent); }

/* TRUNGU WRAPPER & SIDEBAR */
.trungu-wrapper { display: flex; flex-direction: column; padding: 20px 8%; gap: 20px; }
.sidebar { background: white; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.exit-tree-btn { 
    width: 100%; padding: 12px; background: #f8f9fa; border: 1px solid #ddd; 
    border-radius: 8px; font-weight: 800; font-size: 11px; cursor: pointer; 
    margin-bottom: 20px; text-transform: uppercase; transition: 0.3s;
}
.exit-tree-btn:hover { background: #eee; }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.small-back-btn { background: var(--accent); color: white; border: none; padding: 7px 15px; border-radius: 6px; font-size: 11px; font-weight: bold; cursor: pointer; display: none; }

#breadcrumb-list { list-style: none; }
#breadcrumb-list li { background: #f9f9f9; padding: 10px; margin-bottom: 8px; border-left: 4px solid var(--accent); font-size: 13px; font-weight: 800; border-radius: 4px; }
#breadcrumb-list li small { font-weight: 400; color: #666; font-size: 11px; display: block; margin-top: 2px; }

.emri { display: block; font-weight: 900; font-size: 1rem; margin-top: 8px; text-transform: uppercase; }
.relacioni { font-size: 10px; color: var(--accent); font-weight: 800; text-transform: uppercase; }

/* FOOTER */
.main-footer { padding: 40px; text-align: center; background: var(--dark); color: white; font-size: 14px; margin-top: 50px; }

/* RESPONSIVE (Celular) */
@media (max-width: 768px) {
    .menu-icon { display: block; }
    .nav-links {
        display: none; flex-direction: column; position: absolute; top: 70px; left: 0; 
        width: 100%; background: white; padding: 20px; box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }
    .nav-links.active { display: flex; }
    
    .hero-content h1 { font-size: 2.2rem; }
    .hero-main, .hero { height: 35vh; }
    
    .family-selection-grid, .family-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* RESPONSIVE (Desktop) */
@media (min-width: 900px) {
    .trungu-wrapper { flex-direction: row; align-items: flex-start; }
    .sidebar { width: 350px; position: sticky; top: 100px; }
    .main-content { flex: 1; }
    .family-selection-grid, .family-grid { grid-template-columns: repeat(4, 1fr); }
}


/* SEARCH RESULTS MODAL */
.search-results {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    z-index: 9999; /* Siguron që del mbi navbar dhe hero */
    max-height: 300px;
    overflow-y: auto;
    display: none;
    border: 1px solid #ddd;
}

.search-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    text-align: left;
    color: #333;
    font-size: 16px;
    transition: 0.2s;
}

.search-item:hover {
    background: #f8f9fa;
    color: #27ae60;
    padding-left: 25px;
}

/* Rregullim për butonin mbrapa në sidebar */
.small-back-btn {
    display: block !important; /* Sigurohemi që shfaqet */
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

#breadcrumb-list li {
    cursor: pointer;
    transition: 0.2s;
}

#breadcrumb-list li:hover {
    color: #27ae60;
    text-decoration: underline;
}

.search-item small {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}