/* 
    ELITE UI/UX DESIGN SYSTEM 
    Theme: Malkia wa Mitume Trust
    Style: Geometric Minimalist
*/

:root {
    /* Color Palette - Sophisticated & Organic */
    --c-blue-dark: #0f172a;
    --c-blue-primary: #1e40af;
    --c-blue-soft: #3b82f6;
    
    --c-green-primary: #469605;
    --c-green-light: #00eeff;
    --c-green-luminous: #18ff03;
    
    --c-orange-red: #ea580c;
    --c-orange-soft: #ff6f22;
    
    
    --c-cream: #fdfbf7;
    --c-cream-dark: #f3f0e6;
    --c-text-main: #334155;
    --c-text-muted: #64748b;

    /* Gradients */
    --grad-main: linear-gradient(135deg, var(--c-blue-primary) 0%, var(--c-green-primary) 100%);
    --grad-warm: linear-gradient(135deg, var(--c-orange-red) 0%, var(--c-orange-soft) 100%);
    --grad-text: linear-gradient(90deg, var(--c-green-light) , var(--c-green-luminous) );
    --grad-poly: linear-gradient(120deg, rgba(241, 241, 241, 0.9), rgba(255,255,255,0.4));

    /* Typography - Elegant & Compact */
    --font-heading: "Comfortaa", sans-serif;
    --font-body: "Montserrat", sans-serif;
    --font-alt-header:  "Castoro Titling", serif;
    
    /* Spacing & Layout */
    --spacer-xs: 0.5rem;
    --spacer-sm: 1rem;
    --spacer-md: 2rem;
    --spacer-lg: 4rem;
    
    /* Radii & Shadows */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-poly: 2px 12px 2px 12px; /* Slight angular feel */
    --shadow-soft: 0 10px 30px -10px rgba(30, 64, 175, 0.15);
    --shadow-hover: 0 20px 40px -10px rgba(30, 64, 175, 0.25);
    
    /* Transitions */
    --trans-std: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- Base Reset & Typography --- */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--c-cream);
    color: var(--c-text-main);
    font-size: 0.95rem; /* Compact elegance */
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--c-blue-dark);
    letter-spacing: -0.02em;
}

h2 { font-size: 2.2rem; margin-bottom: var(--spacer-md); position: relative; display: inline-block; }
h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--grad-warm);
    margin-top: 10px;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
}

.btn-custom {
    background: var(--grad-warm);
    color: white;
    padding: 0.6rem 1.8rem;
    border: none;
    border-radius: 0;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-alt-header);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--trans-std);
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
    background: var(--grad-warm);
}

/* --- Navigation --- */

.logo-diamond {
    width: auto;
    height: 60px;
    overflow: hidden;
   
}

.logo-diamond img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
 
}

.navbar {
    background: rgba(255, 252, 248, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: var(--spacer-sm) 0;
    transition: var(--trans-std);
}

.nav-link {
    font-family: var(--font-alt-header);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--c-text-main) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 var(--spacer-xs);
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--c-orange-red);
    transition: width 0.3s ease;
}

.nav-link:hover::before { width: 100%; }

/* --- DROPDOWN  --- */

.dropdown-menu-custom {
    border: none;
    border-radius: 0; /* Sharp edges for geometric feel */
    background-color: #ffffff;
    box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.15);
    padding: 0;
    margin-top: 15px; /* Spacing from nav */
    min-width: 240px;
    
    /* The Elite Accent Top Border */
    border-top: 3px solid var(--c-green-primary);
    
    /* Animation */
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--trans-std);
}


.nav-item.dropdown:hover .dropdown-menu-custom,
.dropdown-menu-custom.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block; /* Ensure Bootstrap doesn't hide it */
}

.dropdown-item-custom {
    padding: 0.8rem 1.2rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--c-text-main);
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-item-custom:last-child {
    border-bottom: none;
}

.dropdown-item-custom i {
    width: 25px;
    color: var(--c-text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}

/* Hover Effect */
.dropdown-item-custom:hover {
    background-color: var(--c-cream);
    color: var(--c-blue-primary);
    padding-left: 1.5rem; /* Slide effect */
}

.dropdown-item-custom:hover i {
    color: var(--c-orange-red);
}

/* Dropdown Arrow in Navbar */
.nav-link.dropdown-toggle::after {
    display: none; /* Remove default bootstrap arrow */
}

/* --- Hero Section --- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    background: url('../images/malkia_hero.webp') center/cover no-repeat;
    overflow: hidden;
}

/* The Polygonal Overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, rgba(100, 100, 100, 0.95) 40%, rgba(214, 214, 214, 0.5) 100%);
    z-index: 1;
}

.hero-poly-shape {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--grad-main);
    clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%);
    opacity: 0.5;
    z-index: 1;
    mix-blend-mode: multiply;
}

.hero-content {
    position: relative;
    z-index: 2;
}


.hero h1 {
    font-size: 5rem;
    font-weight: bolder;
    background: var(--grad-text);
     background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacer-sm);
    line-height: 1.1;
}
.hero h5{
    font-family: var(--font-alt-header);
    font-size: 1rem;
    letter-spacing: 0.1em;
}

/* --- Section Styling --- */
section {
    padding: var(--spacer-lg) 0;
    position: relative;
}

/* About Section */
.about-box {
    background: white;
    padding: var(--spacer-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
   
}
.about-image {
    background: var(--c-blue-dark);
    width: 100%;
    height: 400px;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
    position: relative;
    border-top-left-radius: 100px;
    overflow: hidden; /* KEY FIX */
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}


.our-services {
    background-color: var(--c-cream-dark);
    clip-path: polygon(0 0%, 100% 5%, 100% 100%, 0% 100%);
    border-top: 10px solid var(--c-green-primary);
}

/* Services Grid */
.service-card {
    background: white;
    padding: var(--spacer-md);
    height: 100%;
    transition: var(--trans-std);
    border: 1px solid rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px;
    height: 60px;
    background: var(--c-cream-dark);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    transition: var(--trans-std);
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.service-card:hover::before {
    width: 100%;
    height: 100%;
    background: var(--c-blue-primary);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    opacity: 0.05;
}

.service-icon {
    font-size: 2rem;
    color: var(--c-orange-red);
    margin-bottom: var(--spacer-sm);
    display: inline-block;
}

.service-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

/* Join Us Form */
.form-control, .form-select {
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    border-radius: 0;
    padding: 0.8rem 0;
    font-size: 0.9rem;
    transition: var(--trans-std);
}

.form-control:focus, .form-select:focus {
    box-shadow: none;
    border-color: var(--c-blue-primary);
    background: transparent;
}

.join-bg {
    background: var(--c-blue-dark);
    color: white;
    clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
    padding-top: 6rem;
}

.join-bg h3 { 
    font-weight: bolder;
    background: var(--grad-text);
     background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacer-sm);
    line-height: 1.1; }


/* Footer */
footer {
    background: #0f1218;
    color: #94a3b8;
    padding: var(--spacer-md) 0;
    font-size: 0.8rem;
    border-top: 3px solid var(--c-green-primary);
}

/* --- Animations --- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero-poly-shape { width: 30%; clip-path: polygon(40% 0%, 100% 0%, 100% 100%, 0% 100%); }
    .join-bg { clip-path: none; padding-top: var(--spacer-lg); }
}


/* -------------------------------

PORTAL / LOGIN STYLES 

----------------------------------- */

/* Full screen centering wrapper */
.portal-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--c-cream);
    background-image: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(5, 150, 105, 0.05) 0%, transparent 20%);
    padding: var(--spacer-md);
    position: relative;
    overflow: hidden;
}

/* Background Polygon Decoration */
.portal-bg-shape {
    position: absolute;
    top: -10%; right: -5%;
    width: 40vw; height: 60vh;
    background: var(--grad-main);
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 80%);
    opacity: 0.03;
    z-index: 0;
}

/* The Main Card */
.portal-card {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    min-height: 550px;
    display: flex;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    /* Subtle geometric corner clip */
    clip-path: polygon(0 0, 100% 0, 100% 95%, 97% 100%, 0 100%); 
    opacity: 0;
    animation: fadeUpCard 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* Left Side: Login */
.portal-login {
    flex: 1;
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* The Sleek Divider Line */
.portal-divider {
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--c-text-muted) 20%, 
        var(--c-blue-primary) 50%, 
        var(--c-text-muted) 80%, 
        transparent 100%
    );
    opacity: 0.3;
    margin: 2rem 0;
}


/* Right Side: Registration Info */
.portal-header{
    margin-bottom: 2rem;
    font-family: var(--font-alt-header) !important;
    text-transform: uppercase;
}
.portal-register {
    flex: 0.85; /* Slightly smaller than login */
    padding: 3.5rem;
    background: var(--c-cream-dark); /* Very subtle contrast */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Form Styling Refinements */
.portal-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: 0.5rem;
}

.portal-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #cbd5e1;
    padding: 0.5rem 0;
    background: transparent;
    margin-bottom: 2rem;
    font-family: var(--font-body);
    color: var(--c-blue-dark);
    font-weight: 500;
    transition: var(--trans-std);
}

.portal-input:focus {
    outline: none;
    border-bottom-color: var(--c-blue-primary);
}

.forgot-link {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    text-decoration: none;
    transition: color 0.3s;
}
.forgot-link:hover { color: var(--c-orange-red); }

/* Animation Keyframes */
@keyframes fadeUpCard {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .portal-card { flex-direction: column; clip-path: none; border-radius: 8px; }
    .portal-divider { width: 100%; height: 1px; background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent); margin: 0; }
    .portal-login, .portal-register { padding: 2rem; }
}


/* -----------------------------------------

DIRECTORY PAGE STYLES 

------------------------------------------- */

/* 1. Search Panel */
.dir-search-panel {
    background: var(--c-cream-dark);
    padding: 3rem 0 2rem 0;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}
  

/* Geometric accent for search panel */
.dir-search-panel::after {
    content: '';
    position: absolute;
    right: 0; bottom: 0;
    width: 200px; height: 100%;
    background: var(--grad-main);
    clip-path: polygon(100% 0, 100% 100%, 0% 100%);
    opacity: 0.1;
    pointer-events: none;
}

.search-input-group {
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
}

.dir-search-input {
    border: none;
    padding: 1.2rem 1.5rem;
    padding-right: 3rem; /* Space for icon */
    font-family: var(--font-body);
    font-size: 1rem;
    border-radius: 0; /* Sharp sleek edges */
    background: var(--c-cream);
}

.dir-search-input:focus {
    background-color: var(--c-cream);
    outline: 2px solid var(--c-blue);
    outline-offset: 2px;
}


.dir-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--c-blue-primary);
    font-size: 1.2rem;
}

/* 2. A-Z Scroller */
.az-filter-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.az-filter-wrapper::-webkit-scrollbar { display: none; }

.az-link {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    color: var(--c-text-muted);
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: var(--trans-std);
}

.az-link:hover, .az-link.active {
    color: var(--c-orange-red);
    border-bottom-color: var(--c-orange-red);
    background: rgba(255,255,255,0.5);
}

/* 3. The Business Card (80/20 Split) */
.dir-card {
    background: white;
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--trans-std);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.dir-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0,0,0,0);
}

/* Left Side: Info (80%) */
.dir-info {
    flex: 0 0 75%; /* slightly less than 80 to account for padding visual */
    max-width: 75%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Right Side: Logo (20% + overlap) */
.dir-logo-col {
    flex: 0 0 25%;
    max-width: 25%;
    position: relative;
    background: var(--c-cream-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    /* The Geometric Cut */
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
}

/* Logo Placeholder/Image */
.dir-logo-img {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-alt-header);
    font-size: 1.5rem;
    font-weight: bold;
    /* Inner shape */
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--c-blue-dark); /* Default fallback */
}

/* Typography & Icons in Card */
.dir-cat-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-green-primary);
    font-weight: 700;
    margin-bottom: 0.3rem;
    font-family: var(--font-body);
}

.dir-title {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.dir-meta {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-meta i {
    width: 20px;
    color: var(--c-orange-soft);
    font-size: 0.8rem;
}

.dir-desc {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: var(--c-text-main);
    line-height: 1.4;
    opacity: 0.8;

    /* Multi-line clamp (modern + fallback) */
    display: -webkit-box;
    -webkit-line-clamp: 2;         /* limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;

    /* Future-proof syntax — non-WebKit browsers (Firefox support coming) */
    line-clamp: 2;
}


/* Responsive */
@media (max-width: 576px) {
    .dir-card { flex-direction: column-reverse; }
    .dir-info { flex: 0 0 100%; max-width: 100%; }
    .dir-logo-col { 
        flex: 0 0 80px; 
        max-width: 100%; 
        width: 100%;
        clip-path: none; 
        background: var(--c-cream-dark);
        padding: 1rem;
    }
}

    