/* =============================================================================
 * EBKD IAKN — UI tidiness fixes for header & footer
 * Loaded AFTER style.css so it overrides the freelancer template's defaults.
 * ============================================================================= */

/* -----------------------------------------------------------------------------
 * NAVBAR / HEADER
 *   - Prevent the rightmost item (LOGOUT) from wrapping to a new line.
 *   - Tighten padding on menu items so all 7+ items fit on lg screens.
 *   - Make navbar use full container width.
 * --------------------------------------------------------------------------- */
#mainNav {
    padding: 0.5rem 0;
}
#mainNav .container {
    max-width: 1320px;
    flex-wrap: nowrap;       /* keep brand + nav on one row */
}
#mainNav .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 1.5rem;
}
#mainNav .navbar-collapse {
    flex-grow: 1;
    flex-wrap: wrap;
}
#mainNav .navbar-nav {
    flex-wrap: wrap;
    align-items: center;
}
#mainNav .navbar-nav .nav-item {
    margin: 0;
    flex-shrink: 0;
}
#mainNav .navbar-nav .nav-link {
    padding: 0.85rem 0.65rem !important;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: #fff;
    transition: color 0.15s ease, background 0.15s ease;
}
#mainNav .navbar-nav .nav-link:hover,
#mainNav .navbar-nav .nav-link:focus {
    color: #ffd54f;
    background: rgba(255, 255, 255, 0.08);
}
#mainNav .navbar-nav .nav-item.dropdown .dropdown-toggle::after {
    margin-left: 0.25rem;
    vertical-align: 0.15em;
}
/* Dropdown panel — force WHITE background so dark text stays readable.
   The legacy freelancer template darkens dropdowns by default. */
#mainNav .navbar-nav .dropdown-menu,
.navbar .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 0.4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    margin-top: 0.35rem;
    padding: 0.4rem 0;
    min-width: 240px;
    max-width: 320px;
    z-index: 1050;
    /* Override any inherited text-transform from .text-uppercase parent */
    text-transform: none;
    letter-spacing: normal;
}

/* Ensure list items themselves are not styled */
#mainNav .navbar-nav .dropdown-menu li,
.navbar .dropdown-menu li {
    background-color: transparent !important;
    list-style: none;
}

/* Dropdown item links */
#mainNav .navbar-nav .dropdown-menu li > a,
#mainNav .navbar-nav .dropdown-menu li > .dropdown-item,
.navbar .dropdown-menu li > a,
.navbar .dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.55rem 1.1rem !important;
    color: #2c3e50 !important;
    background-color: transparent !important;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    text-transform: none !important;
    letter-spacing: normal;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

/* Hover / focus state — clear contrast */
#mainNav .navbar-nav .dropdown-menu li > a:hover,
#mainNav .navbar-nav .dropdown-menu li > a:focus,
#mainNav .navbar-nav .dropdown-menu li > .dropdown-item:hover,
#mainNav .navbar-nav .dropdown-menu li > .dropdown-item:focus,
.navbar .dropdown-menu li > a:hover,
.navbar .dropdown-menu li > a:focus,
.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
    background-color: #1976d2 !important;
    color: #ffffff !important;
    padding-left: 1.3rem !important;
}

/* Active item */
#mainNav .navbar-nav .dropdown-menu li > a.active,
#mainNav .navbar-nav .dropdown-menu li > .dropdown-item.active,
.navbar .dropdown-menu li > a.active,
.navbar .dropdown-menu .dropdown-item.active {
    background-color: #e3f2fd !important;
    color: #1565c0 !important;
    font-weight: 600;
}

/* Section divider inside dropdown (Master menu uses <li><hr></li>) */
#mainNav .navbar-nav .dropdown-menu li > hr,
.navbar .dropdown-menu li > hr,
.navbar .dropdown-menu hr {
    margin: 0.4rem 0;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    height: 0;
}

/* Below 1200px: shrink padding/text further so menu still fits horizontally */
@media (max-width: 1199.98px) {
    #mainNav .navbar-nav .nav-link {
        padding: 0.75rem 0.45rem !important;
        font-size: 0.78rem;
    }
    #mainNav .navbar-brand {
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }
}

/* Below 991.98px: collapse menu (Bootstrap default) - just style the toggle */
@media (max-width: 991.98px) {
    #mainNav .navbar-nav .nav-link {
        padding: 0.65rem 1rem !important;
        font-size: 0.9rem;
        text-align: left;
    }
    #mainNav .navbar-collapse {
        padding-top: 0.5rem;
    }
}

/* Push body content below the fixed navbar */
body {
    padding-top: 64px;
}
@media (max-width: 991.98px) {
    body {
        padding-top: 56px;
    }
}

/* -----------------------------------------------------------------------------
 * FOOTER
 *   - Make 3 columns even and aligned.
 *   - Headers stay centered, body text left-aligned within column for clean wrap.
 *   - Constrain text width so long paragraphs don't break weirdly.
 * --------------------------------------------------------------------------- */
.footer {
    padding: 3.5rem 0 2rem;
    background-color: #2c3e50;
    color: #ffffff;
}
.footer .container > .row {
    align-items: flex-start;
}
.footer .col-md-4 {
    padding: 0 1.5rem;
}
.footer h4 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem !important;
    text-align: center;
    color: #ffffff;
    line-height: 1.4;
    min-height: 2.8em;            /* equal-height headers across columns */
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer p,
.footer p.lead {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 auto;
    text-align: center;
    max-width: 320px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Social icons row */
.footer .list-inline {
    text-align: center;
    margin-top: 1rem !important;
}
.footer .list-inline-item {
    margin: 0.25rem !important;
}
.footer .btn-social {
    width: 44px;
    height: 44px;
    line-height: 44px;
    padding: 0;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    transition: all 0.2s ease;
}
.footer .btn-social:hover {
    background: #ffffff;
    color: #2c3e50;
    border-color: #ffffff;
    transform: translateY(-2px);
}

/* Copyright bar */
.copyright {
    background-color: #1e2b38;
    padding: 1rem 0 !important;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

/* Stack columns vertically on small screens with more breathing room */
@media (max-width: 767.98px) {
    .footer {
        padding: 2.5rem 0 1.5rem;
    }
    .footer .col-md-4 {
        margin-bottom: 2rem;
    }
    .footer .col-md-4:last-child {
        margin-bottom: 0;
    }
    .footer h4 {
        min-height: auto;
    }
}

/* -----------------------------------------------------------------------------
 * BREADCRUMB — slight polish (was overlapping nav before)
 * --------------------------------------------------------------------------- */
.breadcrumb {
    background-color: #f7f9fb;
    border-radius: 0.3rem;
    padding: 0.6rem 1rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.88rem;
}
.breadcrumb > li + li::before {
    content: '/';
    padding: 0 0.5em;
    color: #95a5a6;
}
.breadcrumb a {
    color: #1976d2;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}

/* =============================================================================
 * LKD MANAGEMENT PAGE — modern card grid
 * ============================================================================= */
.lkd-page {
    padding: 1rem 0 3rem;
}
.lkd-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 1rem 0 0.5rem;
    color: #2c3e50;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.lkd-page-divider {
    border: 0;
    border-top: 3px solid #1976d2;
    width: 70px;
    margin: 0.5rem auto 2rem;
    border-radius: 2px;
}

/* Status alerts row — full width, clean borderless */
.lkd-status-bar {
    margin-bottom: 1.75rem;
}
.lkd-status-bar .alert {
    margin-bottom: 0.6rem;
    border: 0;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.lkd-status-bar .alert::before {
    font-family: FontAwesome;
    font-size: 1.1rem;
    line-height: 1;
}
.lkd-status-bar .alert-success {
    background: #e8f5e9;
    border-left-color: #2e7d32;
    color: #1b5e20;
}
.lkd-status-bar .alert-success::before {
    content: "\f058"; /* check-circle */
    color: #2e7d32;
}
.lkd-status-bar .alert-danger {
    background: #ffebee;
    border-left-color: #c62828;
    color: #b71c1c;
}
.lkd-status-bar .alert-danger::before {
    content: "\f071"; /* exclamation-triangle */
    color: #c62828;
}
.lkd-status-bar .alert strong {
    font-weight: 700;
}

/* Card grid: 4 cols on xl, 3 on lg, 2 on md, 1 on xs */
.lkd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* Common card */
.lkd-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 195px;
    padding: 1.5rem 1.25rem;
    border-radius: 14px;
    text-align: center;
    text-decoration: none !important;
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}
.lkd-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
    color: #ffffff;
    text-decoration: none;
}
.lkd-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.4), 0 14px 28px rgba(0, 0, 0, 0.18);
}

/* "Tambah Baru" card — green, dashed border to invite action */
.lkd-card-add {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    border: 2px dashed rgba(255, 255, 255, 0.45);
}
.lkd-card-add .lkd-card-icon-circle {
    width: 64px;
    height: 64px;
    line-height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 0.85rem;
    font-size: 1.8rem;
    transition: background 0.2s ease;
}
.lkd-card-add:hover .lkd-card-icon-circle {
    background: rgba(255, 255, 255, 0.3);
}
.lkd-card-add .lkd-card-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.lkd-card-add .lkd-card-sublabel {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    opacity: 0.9;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
}

/* Disabled "Tambah Baru" — when access window closed */
.lkd-card-add.disabled,
.lkd-card-add.disabled:hover {
    background: linear-gradient(135deg, #9e9e9e 0%, #bdbdbd 100%);
    border-color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    opacity: 0.7;
    pointer-events: none;
}

/* Existing data card — blue gradient */
.lkd-card-data {
    background: linear-gradient(135deg, #0277bd 0%, #039be5 100%);
}
.lkd-card-data::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
}
.lkd-card-data .lkd-card-mini-icon {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 0.4rem;
}
.lkd-card-data .lkd-card-tahun {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.02em;
    margin: 0;
}
.lkd-card-data .lkd-card-semester {
    display: inline-block;
    margin-top: 0.7rem;
    padding: 0.28rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.lkd-card-data .lkd-card-action-hint {
    position: absolute;
    bottom: 0.7rem;
    left: 0;
    right: 0;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
}
.lkd-card-data:hover .lkd-card-action-hint {
    opacity: 0.85;
}

/* Pagination polish */
.lkd-pagination {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e7ebef;
}
.lkd-pagination .btn {
    border-radius: 8px;
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
}

/* Responsive tightening */
@media (max-width: 575.98px) {
    .lkd-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.85rem;
    }
    .lkd-card {
        min-height: 155px;
        padding: 1rem 0.75rem;
    }
    .lkd-card-data .lkd-card-tahun {
        font-size: 1.25rem;
    }
    .lkd-card-add .lkd-card-icon-circle {
        width: 48px;
        height: 48px;
        line-height: 48px;
        font-size: 1.4rem;
    }
    .lkd-card-add .lkd-card-label {
        font-size: 0.85rem;
    }
    .lkd-page-title {
        font-size: 1.15rem;
    }
}

/* =============================================================================
 * LKD DETAIL PAGE (LKD1.php)
 *   Identitas bar + dual-panel layout (Input Data | Lihat Data)
 *   with modern action cards
 * ============================================================================= */

/* Identitas info bar - shows dosen + period at top */
.lkd-identitas-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: #ffffff;
    border-radius: 12px;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.lkd-identitas-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}
.lkd-identitas-icon {
    font-size: 2.2rem;
    opacity: 0.9;
    flex-shrink: 0;
}
.lkd-identitas-text {
    min-width: 0;
}
.lkd-identitas-text strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}
.lkd-identitas-text small {
    display: block;
    font-size: 0.82rem;
    opacity: 0.9;
    margin-top: 0.2rem;
    color: rgba(255, 255, 255, 0.95);
}
.lkd-btn-edit-identitas {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff !important;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.lkd-btn-edit-identitas:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Container for the two panels */
.lkd-detail-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.lkd-detail-panels.single-col {
    grid-template-columns: minmax(0, 800px);
    justify-content: center;
}
@media (max-width: 991.98px) {
    .lkd-detail-panels {
        grid-template-columns: 1fr;
    }
}

/* Each panel */
.lkd-detail-panel {
    background: #ffffff;
    border: 1px solid #e7ebef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}
.lkd-detail-panel-header {
    padding: 0.85rem 1.25rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.lkd-detail-panel-input .lkd-detail-panel-header {
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
}
.lkd-detail-panel-view .lkd-detail-panel-header {
    background: linear-gradient(135deg, #0277bd 0%, #039be5 100%);
}
.lkd-detail-panel-header > i {
    font-size: 1.05rem;
}

/* Grid of cards inside panel */
.lkd-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    padding: 1rem;
    flex: 1;
}
@media (max-width: 575.98px) {
    .lkd-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Action card */
.lkd-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.1rem 0.85rem;
    min-height: 135px;
    border-radius: 10px;
    background: #f7f9fb;
    border: 1px solid #e7ebef;
    color: #2c3e50 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
}
.lkd-action-card:hover {
    background: #ffffff;
    border-color: var(--lkd-card-color, #1976d2);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
    text-decoration: none !important;
}
.lkd-action-icon {
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    margin-bottom: 0.6rem;
    font-size: 1.4rem;
    background: var(--lkd-card-color, #1976d2);
    color: #ffffff;
    transition: transform 0.2s;
    text-align: center;
}
.lkd-action-card:hover .lkd-action-icon {
    transform: scale(1.1);
}
.lkd-action-label {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    color: #2c3e50;
}

/* Color variants via CSS variables */
.lkd-action-input      { --lkd-card-color: #2e7d32; }
.lkd-action-view       { --lkd-card-color: #1976d2; }
.lkd-action-print      { --lkd-card-color: #ef6c00; }
.lkd-action-conclusion { --lkd-card-color: #6a1b9a; }

/* Hint message when no data section visible */
.lkd-warning-info {
    background: #fff3e0;
    border-left: 4px solid #ef6c00;
    color: #e65100;
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.92rem;
}
.lkd-warning-info::before {
    content: "\f071";
    font-family: FontAwesome;
    color: #ef6c00;
    font-size: 1.1rem;
}
