/* PMIU Health KPK - Custom Styles */
/* KPK Government Colors */
:root {
    --kpk-green: #006B3F;
    --kpk-green-dark: #004a2b;
    --kpk-green-light: #e6f0ec;
    --kpk-gold: #C5A028;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .navbar-nav .nav-link {
    font-family: 'Playfair Display', serif;
}

/* Top Bar */
.top-bar {
    background-color: var(--kpk-green-dark);
    color: #fff;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.top-bar-item {
    margin-right: 1.5rem;
}

.top-bar-item i {
    margin-right: 0.5rem;
    color: var(--kpk-gold);
}

.top-bar-social a {
    color: #fff;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.top-bar-social a:hover {
    color: var(--kpk-gold);
}

/* Header */
.main-header {
    background-color: #fff;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
}

.logo-emblem {
    color: var(--kpk-green);
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.logo-emblem img {
    display: block;
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.logo-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--kpk-green);
    margin-bottom: 0;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0;
}

.logo-dept {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.govt-badge {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.govt-badge img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.govt-badge span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.35;
}

/* Navbar */
.main-navbar {
    background-color: var(--kpk-green);
    padding: 0;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
    padding: 1rem 1.25rem;
    font-weight: 500;
    font-size: 1.05rem;
    transition: background-color 0.3s ease;
}

.main-navbar .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
    padding: 1rem 1.25rem;
    font-weight: 500;
    font-size: 1.05rem;
    transition: background-color 0.3s ease;
}

.main-navbar .navbar-nav .nav-link:hover,
.main-navbar .navbar-nav .nav-link:focus {
    color: #fff;
    background-color: var(--kpk-green-dark);
}

.main-navbar .dropdown-menu {
    border: none;
    border-radius: 0 0 0.25rem 0.25rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 0;
}

.main-navbar .dropdown-item {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.main-navbar .dropdown-item:hover {
    background-color: var(--kpk-green-light);
    color: var(--kpk-green);
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.5);
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* News Ticker */
.news-ticker {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    overflow: hidden;
}

.ticker-wrapper {
    display: flex;
    align-items: center;
}

.ticker-label {
    background-color: var(--kpk-gold);
    color: #fff;
    padding: 0.25rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    border-radius: 0.25rem;
    margin-right: 1rem;
    z-index: 2;
}

.ticker-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 1.5rem;
}

.ticker-scroll {
    position: absolute;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

.ticker-scroll:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-size: 0.95rem;
}

.ticker-item a {
    color: var(--text-dark);
    text-decoration: none;
}

.ticker-item a:hover {
    color: var(--kpk-green);
    text-decoration: underline;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Hero Slider */
.hero-slider .carousel-item {
    height: 500px;
    background-color: var(--text-dark);
    position: relative;
}

.hero-slider .carousel-item img {
    object-fit: cover;
    height: 100%;
    width: 100%;
    opacity: 0.6;
}

.hero-caption {
    position: absolute;
    bottom: 20%;
    left: 10%;
    right: 10%;
    color: #fff;
    text-align: left;
    max-width: 800px;
    background: rgba(0, 107, 63, 0.85); /* kpk-green with opacity */
    padding: 2rem;
    border-left: 5px solid var(--kpk-gold);
}

.hero-caption h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-caption p {
    font-size: 1.2rem;
    margin-bottom: 0;
}

/* Section Headings */
.section-title {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    color: var(--kpk-green);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--kpk-gold);
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Quick Links */
.quick-link-card {
    transition: all 0.3s ease;
}

.quick-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.quick-link-card:hover h5 {
    color: var(--kpk-green) !important;
}

/* Stat Counters */
.stats-section {
    background-color: var(--kpk-green);
    color: #fff;
    padding: 4rem 0;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    font-size: 3rem;
    color: var(--kpk-gold);
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.card-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--kpk-green);
}

/* Footer */
.main-footer {
    background-color: var(--text-dark);
    color: #fff;
    margin-top: 4rem;
}

.footer-top {
    padding: 4rem 0 2rem;
}

.footer-title {
    color: var(--kpk-gold);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--kpk-green);
}

.footer-about {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 50%;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background-color: var(--kpk-gold);
    color: #fff;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links a::before {
    content: '›';
    margin-right: 0.5rem;
    color: var(--kpk-gold);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
    display: flex;
}

.footer-contact i {
    color: var(--kpk-gold);
    margin-right: 1rem;
    font-size: 1.1rem;
}

.footer-bottom {
    background-color: #222;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

.footer-bottom p {
    margin: 0;
}

/* Utilities */
.text-kpk-green {
    color: var(--kpk-green) !important;
}

.bg-kpk-green {
    background-color: var(--kpk-green) !important;
}

.btn-kpk {
    background-color: var(--kpk-green);
    color: #fff;
    border: none;
}

.btn-kpk:hover {
    background-color: var(--kpk-green-dark);
    color: #fff;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--kpk-gold);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--kpk-green);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--kpk-gold);
}

/* Organogram CSS Tree */
.tree {
    width: 100%;
    overflow-x: auto;
    padding: 2rem 0;
}
.tree ul {
    padding-top: 20px; position: relative;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    display: flex;
    justify-content: center;
}

.tree li {
    float: left; text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    transition: all 0.5s;
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
}

.tree li::before, .tree li::after {
    content: '';
    position: absolute; top: 0; right: 50%;
    border-top: 2px solid var(--kpk-green);
    width: 50%; height: 20px;
}
.tree li::after {
    right: auto; left: 50%;
    border-left: 2px solid var(--kpk-green);
}

.tree li:only-child::after, .tree li:only-child::before {
    display: none;
}

.tree li:only-child { padding-top: 0;}

.tree li:first-child::before, .tree li:last-child::after {
    border: 0 none;
}

.tree li:last-child::before {
    border-right: 2px solid var(--kpk-green);
    border-radius: 0 5px 0 0;
}
.tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    border-left: 2px solid var(--kpk-green);
    width: 0; height: 20px;
}

.tree li .node-box {
    border: 2px solid var(--kpk-green);
    padding: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-family: arial, verdana, tahoma;
    font-size: 11px;
    display: inline-block;
    border-radius: 5px;
    transition: all 0.5s;
    background-color: white;
    min-width: 150px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tree li .node-box:hover {
    background: var(--kpk-green-light);
    border: 2px solid var(--kpk-gold);
}

.node-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid var(--kpk-gold);
}

.node-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--kpk-green);
}

.node-title {
    font-size: 12px;
    color: var(--text-muted);
}
.node-dept {
    font-size: 11px;
    color: var(--text-dark);
    margin-top: 5px;
    font-style: italic;
}

@media (max-width: 767.98px) {
    .logo-emblem img {
        width: 68px;
        height: 68px;
    }

    .logo-title {
        font-size: 1.5rem;
    }

    .logo-subtitle {
        font-size: 0.95rem;
    }

    .logo-dept {
        font-size: 0.8rem;
    }
}
