/**
 * FYP Portal - Active Projects Showcase CSS
 * 
 * Standards:
 * - Clean White & Sky Blue Light Palette matching FYPMS Landing Page
 * - Advanced Custom Searchable Dropdowns (zero native selects)
 * - Compact Project Cards with balanced heights & clamping
 * - Big, Mobile-Friendly Project Details Modal
 * - Hardware-accelerated smooth micro-animations
 * - Strict Line Limit < 600 lines (Rule U-2)
 */

:root {
    --proj-primary: #0284c7;
    --proj-primary-hover: #0369a1;
    --proj-primary-light: #f0f9ff;
    --proj-primary-border: #bae6fd;
    --proj-text-main: #0f172a;
    --proj-text-muted: #64748b;
    --proj-border: #e2e8f0;
    --proj-bg-card: #ffffff;
    --proj-radius: 14px;
    --proj-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --proj-shadow-md: 0 8px 24px -4px rgba(2, 132, 199, 0.08);
    --proj-shadow-lg: 0 20px 45px -10px rgba(15, 23, 42, 0.15);
}

body.projects-showcase-body {
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 28%, #f8fafc 100%);
    min-height: 100vh;
    padding-top: 76px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--proj-text-main);
}

/* ============================================================
   1. HERO SECTION (Light, Fast, Clean, No 7th/8th Text)
   ============================================================ */
.projects-hero {
    position: relative;
    padding: 48px 0 42px;
    background: radial-gradient(circle at 18% 30%, rgba(224, 242, 254, 0.8) 0%, rgba(240, 249, 255, 0.3) 60%, transparent 100%);
    overflow: hidden;
}

.projects-hero .hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(55px);
    pointer-events: none;
    opacity: 0.55;
    will-change: transform;
}
.projects-hero .hero-orb-1 {
    width: 280px; height: 280px;
    background: #bae6fd;
    top: -40px; right: 10%;
}
.projects-hero .hero-orb-2 {
    width: 220px; height: 220px;
    background: #e0f2fe;
    bottom: -20px; left: 5%;
}

.projects-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid var(--proj-primary-border);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--proj-primary);
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.08);
    margin-bottom: 14px;
}
.projects-hero-badge .badge-dot {
    width: 7px; height: 7px;
    background: #0284c7;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.projects-hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    font-weight: 800;
    color: var(--proj-text-main);
    line-height: 1.18;
    letter-spacing: -0.025em;
    margin-bottom: 12px;
}
.projects-hero-title .title-accent {
    color: var(--proj-primary);
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.projects-hero-desc {
    font-size: clamp(0.92rem, 1.4vw, 1.05rem);
    color: var(--proj-text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin-bottom: 0;
}

/* Stats Deck */
.projects-stats-deck { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hero-stat-box {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-stat-box:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.12); }
.hero-stat-box .stat-icon-wrap {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: #e0f2fe; color: #0284c7;
    font-size: 0.95rem; margin-bottom: 8px;
}
.hero-stat-box .stat-icon-blue { background: #dbeafe; color: #2563eb; }
.hero-stat-box .stat-icon-emerald { background: #d1fae5; color: #059669; }
.hero-stat-box .stat-icon-violet { background: #ede9fe; color: #7c3aed; }
.hero-stat-box .stat-val { font-family: 'Space Grotesk', sans-serif; font-size: 1.65rem; font-weight: 700; color: var(--proj-text-main); line-height: 1; margin-bottom: 3px; }
.hero-stat-box .stat-val-blue { color: #2563eb; }
.hero-stat-box .stat-val-emerald { color: #059669; }
.hero-stat-box .stat-val-violet { color: #7c3aed; }
.hero-stat-box .stat-lbl { font-size: 0.74rem; color: var(--proj-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================================
   2. TOOLBAR CARD & ADVANCED CUSTOM DROPDOWNS
   ============================================================ */
.projects-toolbar-card {
    background: #ffffff;
    border: 1px solid var(--proj-border);
    border-radius: var(--proj-radius);
    padding: 22px;
    box-shadow: var(--proj-shadow-md);
    margin-top: -20px;
    position: relative;
    z-index: 20;
    margin-bottom: 22px;
}
.projects-search-row { width: 100%; margin-bottom: 16px; }
.projects-search-bar { position: relative; display: flex; align-items: center; width: 100%; }
.projects-search-bar .search-icon { position: absolute; left: 16px; color: #94a3b8; font-size: 1.05rem; pointer-events: none; }
.projects-search-input {
    width: 100%; height: 48px;
    padding: 8px 42px 8px 46px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.94rem;
    color: var(--proj-text-main);
    outline: none;
    transition: all 0.2s ease;
}
.projects-search-input:focus { background: #ffffff; border-color: var(--proj-primary); box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.15); }
.projects-search-clear { position: absolute; right: 12px; background: none; border: none; color: #94a3b8; cursor: pointer; padding: 6px; display: none; font-size: 1rem; }
.projects-search-clear.visible { display: flex; align-items: center; justify-content: center; }
.projects-search-clear:hover { color: #ef4444; }

/* 2-Column Advanced Dropdowns Grid */
.projects-filters-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.projects-filter-group { display: flex; flex-direction: column; gap: 6px; position: relative; }
.filter-group-label { font-size: 0.8rem; font-weight: 700; color: #334155; display: flex; align-items: center; gap: 6px; margin-bottom: 0; }

/* Progressive Enhancement: Native Selects vs Custom Dropdowns */
.proj-native-select {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 0.88rem;
    font-weight: 500;
    color: #0f172a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.proj-native-select:focus {
    border-color: var(--proj-primary);
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.15);
    outline: none;
}

/* When JS is active: hide native selects, show custom dropdown trigger */
.js-active .proj-native-select {
    display: none !important;
}
.js-active .custom-dropdown-trigger {
    display: flex !important;
}

/* When JS is not active (strict CSP / script-src 'none'): hide custom triggers, show native selects */
body:not(.js-active) .custom-dropdown-trigger,
body:not(.js-active) .custom-dropdown-panel {
    display: none !important;
}

.proj-form-actions-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.js-active .proj-form-actions-wrap {
    display: none !important;
}

/* Custom Searchable Select (Replaces Native <select> Completely) */
.custom-dropdown-container { position: relative; width: 100%; }
.custom-dropdown-trigger {
    width: 100%; min-height: 46px; padding: 10px 16px; border-radius: 12px;
    border: 1.5px solid #cbd5e1; background: #ffffff; font-size: 0.88rem; font-weight: 600;
    color: #0f172a; cursor: pointer; display: none; align-items: center; justify-content: space-between;
    user-select: none; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); position: relative;
    text-align: left;
}
.custom-dropdown-trigger:hover { border-color: #93c5fd; background: #f8fbff; }
.custom-dropdown-trigger.is-open { border-color: #0284c7; background: #ffffff; box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.18); }
.trigger-label-wrap { display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trigger-selected-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trigger-chevron { font-size: 0.78rem; color: #0284c7; transition: transform 0.22s ease; flex-shrink: 0; margin-left: 8px; }
.custom-dropdown-trigger.is-open .trigger-chevron { transform: rotate(180deg); }

/* Custom Dropdown Floating Panel */
.custom-dropdown-panel {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1050;
    background: #ffffff; border: 1.5px solid #cbd5e1; border-radius: 14px;
    box-shadow: 0 16px 36px rgba(15, 39, 66, 0.16); padding: 8px; display: none; min-width: 250px;
}
.custom-dropdown-panel.is-open { display: block; animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes dropdownPop { 0% { opacity: 0; transform: translateY(-6px); } 100% { opacity: 1; transform: translateY(0); } }

.dropdown-search-wrap { position: relative; display: flex; align-items: center; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
.dropdown-search-icon { position: absolute; left: 10px; font-size: 0.80rem; color: #64748b; pointer-events: none; }
.dropdown-search-input {
    width: 100%; min-height: 36px; padding: 6px 28px 6px 30px; border-radius: 8px;
    border: 1px solid #cbd5e1; font-size: 0.84rem; color: #0f2742; background: #f8fafc; outline: none;
}
.dropdown-search-input:focus { border-color: #0284c7; background: #ffffff; box-shadow: 0 0 0 2.5px rgba(2, 132, 199, 0.15); }
.dropdown-search-clear { position: absolute; right: 8px; background: none; border: none; color: #94a3b8; font-size: 1.1rem; cursor: pointer; line-height: 1; }

.dropdown-options-list { max-height: 240px; overflow-y: auto; }
.dropdown-optgroup-title {
    font-size: 0.70rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    color: #0284c7; background: #f0f9ff; padding: 5px 8px; border-radius: 6px; margin: 6px 0 2px;
}
.dropdown-option-item {
    padding: 7px 10px; border-radius: 8px; font-size: 0.84rem; font-weight: 500; color: #1e293b;
    cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    transition: background 0.12s ease;
}
.dropdown-option-item:hover { background: #f1f5f9; color: #0284c7; }
.dropdown-option-item.is-selected { background: #e0f2fe; color: #0369a1; font-weight: 700; }
.dropdown-no-results { padding: 14px 10px; text-align: center; color: #64748b; font-size: 0.82rem; font-style: italic; }

/* Popular Tech Quick Pills Bar */
.projects-popular-tech-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1f5f9;
}
.popular-tech-label { font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.03em; }
.popular-tech-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.popular-tech-chip {
    padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
    background: #f8fafc; border: 1px solid #cbd5e1; color: #334155; cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.popular-tech-chip:hover { background: #e0f2fe; border-color: #7dd3fc; color: #0284c7; transform: translateY(-1px); }
.popular-tech-chip.active { background: #0284c7; border-color: #0284c7; color: #ffffff; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.28); }

/* Active Chips */
.projects-active-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f1f5f9; }
.proj-active-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #e0f2fe; color: #0284c7; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.proj-active-chip button { background: none; border: none; color: #0284c7; font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0; }
.proj-active-chip button:hover { color: #ef4444; }

/* Results Bar */
.projects-results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.results-count-text { font-size: 0.9rem; color: var(--proj-text-muted); }
.results-count-text strong { color: var(--proj-text-main); font-weight: 700; }
.projects-view-toggle { display: inline-flex; background: #f1f5f9; padding: 3px; border-radius: 8px; }
.view-toggle-btn { border: none; background: transparent; padding: 5px 11px; border-radius: 6px; font-size: 0.82rem; font-weight: 600; color: var(--proj-text-muted); cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; gap: 5px; }
.view-toggle-btn.active { background: #ffffff; color: var(--proj-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* ============================================================
   3. PROJECT CARDS (Compact, Elegant, No Huge Details)
   ============================================================ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.project-card {
    background: var(--proj-bg-card);
    border: 1px solid var(--proj-border);
    border-radius: var(--proj-radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--proj-shadow-sm);
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--proj-shadow-md); border-color: #cbd5e1; }
.project-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.project-batch-badge { font-size: 0.74rem; font-weight: 700; color: #475569; background: #f1f5f9; padding: 3px 8px; border-radius: 6px; }
.project-status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; color: #059669; background: #ecfdf5; padding: 3px 8px; border-radius: 6px; }
.project-status-pill .status-dot { width: 6px; height: 6px; background: #10b981; border-radius: 50%; }

.project-card-title {
    font-size: 1.02rem; font-weight: 700; color: var(--proj-text-main); line-height: 1.35;
    margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; height: 2.7em;
}
.project-card-desc {
    font-size: 0.84rem; color: var(--proj-text-muted); line-height: 1.45;
    margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; height: 2.9em;
}
.project-tech-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; min-height: 28px; }
.tech-tag-pill { padding: 3px 8px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 6px; font-size: 0.74rem; color: #0369a1; font-weight: 600; }
.tech-more-pill { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }

.project-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.project-verified-tag { font-size: 0.75rem; color: #475569; font-weight: 600; display: inline-flex; align-items: center; }

.btn-view-details {
    background: var(--proj-primary-light);
    color: var(--proj-primary);
    border: 1px solid var(--proj-primary-border);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-view-details:hover { background: var(--proj-primary); color: #ffffff; border-color: var(--proj-primary); }

/* Rows Table View */
.projects-rows-table-wrap { background: #ffffff; border: 1px solid var(--proj-border); border-radius: var(--proj-radius); overflow: hidden; box-shadow: var(--proj-shadow-sm); }
.projects-table { width: 100%; margin-bottom: 0; border-collapse: collapse; }
.projects-table th { background: #f8fafc; padding: 11px 14px; font-size: 0.78rem; font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1.5px solid var(--proj-border); }
.projects-table td { padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; font-size: 0.86rem; }
.projects-table tr:hover td { background-color: #f8fafc; }
.row-proj-title { font-weight: 700; color: var(--proj-text-main); margin-bottom: 2px; }
.row-proj-desc { font-size: 0.76rem; color: #64748b; }

/* Zero-CLS Skeleton */
.skeleton-card {
    height: 240px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: projSkeletonShimmer 1.5s infinite;
    border-radius: var(--proj-radius);
    border: 1px solid #e2e8f0;
}
@keyframes projSkeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   4. BIG MOBILE-FRIENDLY DETAILS MODAL
   ============================================================ */
.proj-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(7, 20, 38, 0.78);
    backdrop-filter: blur(10px) saturate(115%);
    z-index: 9999;
    display: none; align-items: center; justify-content: center;
    padding: 16px;
}
.proj-modal-backdrop.show { display: flex; }
.proj-modal-box {
    background: #ffffff;
    border-radius: 18px;
    max-width: 720px; width: 100%; max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px -18px rgba(7, 20, 38, 0.5);
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }

.proj-modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
    display: flex; justify-content: space-between; align-items: flex-start;
    position: sticky; top: 0; background: #ffffff; z-index: 2;
}
.proj-modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; font-weight: 800; color: #0f172a; line-height: 1.3; margin-bottom: 0; }
.proj-modal-close {
    background: #f1f5f9; border: none; border-radius: 50%;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    color: #64748b; font-size: 1.4rem; cursor: pointer; transition: background 0.15s ease;
    line-height: 1; flex-shrink: 0; margin-left: 12px;
}
.proj-modal-close:hover { background: #fee2e2; color: #dc2626; }

.proj-modal-body { padding: 20px 22px; }
.modal-spec-block { margin-bottom: 16px; }
.modal-section-title { font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.modal-desc-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 16px; font-size: 0.88rem; line-height: 1.6; color: #334155; white-space: pre-line; }
.modal-feature-list { list-style-type: disc; }
.modal-feature-list li { margin-bottom: 6px; font-size: 0.86rem; color: #475569; }

.proj-modal-footer { padding: 14px 22px; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; }

/* Empty State */
.projects-empty-state { text-align: center; padding: 50px 20px; background: #ffffff; border: 1px dashed #cbd5e1; border-radius: var(--proj-radius); margin: 20px 0; }
.empty-icon-circle { width: 64px; height: 64px; border-radius: 50%; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }

/* Pagination */
.projects-pagination-wrap { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 30px 0 50px; flex-wrap: wrap; }
.projects-numeric-pages { display: inline-flex; gap: 4px; }
.pagination-info-text { font-size: 0.82rem; color: #64748b; margin-left: 10px; }

/* Mobile Filter Bar */
.projects-mobile-filter-bar { background: #ffffff; border: 1px solid var(--proj-border); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.btn-mobile-filter-toggle { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 14px; font-size: 0.88rem; font-weight: 600; color: var(--proj-text-main); display: inline-flex; align-items: center; }
.btn-mobile-reset { background: none; border: none; color: #ef4444; font-size: 0.85rem; font-weight: 600; }

/* ============================================================
   5. RESPONSIVE BREAKPOINTS (320px–991px)
   ============================================================ */
@media (max-width: 991.98px) {
    .projects-hero { padding: 40px 0 28px; }
    .projects-stats-deck { margin-top: 18px; }
    .projects-filters-grid { grid-template-columns: 1fr; }
    #projFilterCollapse { display: none; }
    #projFilterCollapse.is-open { display: grid; margin-top: 12px; }
}
@media (max-width: 640.98px) {
    .projects-stats-deck { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .hero-stat-box { padding: 10px 12px; }
    .hero-stat-box .stat-val { font-size: 1.35rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .projects-toolbar-card { padding: 14px; margin-top: -14px; }
    .proj-modal-box { border-radius: 14px; max-height: 94vh; }
    .proj-modal-header, .proj-modal-body, .proj-modal-footer { padding: 14px 16px; }
}
