/* ==========================================================================
   NCDC Document Vault - Sleek Portfolio Theme
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --ncdc-green: #009900;        
    --ncdc-green-dark: #004d00;   
    --ncdc-amber: #FFCE00;        
    --bg-page: #f8fafc;      
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
}

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background-color: var(--bg-page); 
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* --- Hero & Search --- */
.ncdc-hero {
    background-color: #fff;
    border-bottom: 1px solid var(--border-light);
    padding: 3rem 1rem;
}

.search-bar-wrapper {
    background: #fff;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    border-radius: 50px;
    overflow: hidden;
}

.search-bar-wrapper:focus-within {
    border-color: var(--ncdc-green);
    box-shadow: 0 0 0 3px rgba(0, 153, 0, 0.1);
}

.search-bar-wrapper input { outline: none; box-shadow: none !important; }

.btn-ncdc {
    background-color: var(--ncdc-amber);
    color: #000;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    padding: 8px 24px;
    transition: all 0.2s;
}
.btn-ncdc:hover { background-color: #e6b800; transform: scale(1.02); }

/* --- Ultra-Compact Project Cards --- */
.ncdc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px; /* Slightly tighter corners */
    overflow: hidden;
    transition: all 0.2s ease-in-out;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ncdc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 153, 0, 0.15);
    border-color: rgba(0, 153, 0, 0.4);
}

/* Shorter Image Area */
.card-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Wider and shorter than before */
    background: #f1f5f9;
    overflow: hidden;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ncdc-card:hover .card-img-container img { transform: scale(1.05); }

/* Tiny, unobtrusive badges */
.card-badges {
    position: absolute;
    top: 8px; left: 8px; right: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.badge-subject {
    background: #e8f5e9;
    color: #006600;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge-year {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Ultra-Tight Data Container */
.card-info { 
    padding: 12px; /* Reduced from 16px */
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}

.card-title {
    font-size: 0.95rem; /* Smaller, punchier title */
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 8px; /* Reduced from 12px */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stacked, tight metadata */
.card-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px; /* Super tight gap */
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem; /* Smaller text */
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.meta-item i {
    color: var(--ncdc-green);
    font-size: 0.8rem;
    width: 16px; /* Tighter icon width */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .card-info { padding: 10px; } /* Even tighter on mobile */
    .card-title { font-size: 0.9rem; margin-bottom: 6px; }
}

/* Image scaling with aspect ratio (Mobile Perfect) */
.card-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10; /* Perfect rectangle on all screens */
    background: #f1f5f9;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ncdc-card:hover .card-img-container img { transform: scale(1.05); }

/* Badges floating on image */
.card-badges {
    position: absolute;
    top: 12px; left: 12px; right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}


.badge-subject {
    background: #e8f5e9; /* Soft light green background */
    color: #006600;      /* Deep green text for crisp contrast */
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Softer shadow for light badge */
}

.badge-year {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tight Data Container */
.card-info { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; }

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 12px;
    /* Force truncate at 2 lines to keep card heights perfectly even */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Compact Metadata */
.card-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.meta-item i {
    color: var(--ncdc-green);
    font-size: 0.9rem;
    width: 18px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .card-info { padding: 12px; }
    .card-title { font-size: 0.95rem; }
}

.fade-in-card { animation: fadeIn 0.4s ease-out forwards; opacity: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Modern Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); /* Supports iPhone home bar */
    z-index: 1030;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 33%;
}

.mobile-nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.mobile-nav-item:hover, .mobile-nav-item:active {
    color: var(--ncdc-green);
}

.mobile-nav-item.active {
    color: var(--ncdc-green);
}

.mobile-nav-item.active i {
    transform: scale(1.15);
}

/* Ensure content doesn't hide behind the new mobile bar */
@media (max-width: 768px) {
    body { padding-bottom: 75px; }
}