/* ============================================
   GMG - Funding Pages Styles
   finantari.html (list) + program.html (detail)
   ============================================ */

/* ── Funding List Page ── */

.funding-page {
    padding: 60px 0 80px;
}

/* Toolbar: Search + Filters */
.funding-toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.funding-search {
    position: relative;
    max-width: 560px;
    width: 100%;
}

.funding-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 15px;
}

.funding-search input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--navy);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.funding-search input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(17, 130, 158, 0.1);
}

.funding-search input::placeholder {
    color: var(--gray-400);
}

.funding-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.funding-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    background: var(--white);
    color: var(--gray-600);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.funding-filter-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.funding-filter-btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.funding-filter-btn.active .status-dot {
    background: var(--white);
    box-shadow: none;
}

/* Status dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.status-activ {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.status-dot.status-programat {
    background: #eab308;
    box-shadow: 0 0 4px rgba(234, 179, 8, 0.4);
}

.status-dot.status-inchis {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* Results Info */
.funding-results-info {
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--gray-500);
}

/* Funding Grid */
.funding-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.funding-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.funding-loading i {
    font-size: 28px;
    color: var(--teal);
    margin-bottom: 12px;
    display: block;
}

.funding-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.funding-no-results i {
    font-size: 40px;
    color: var(--gray-300);
    margin-bottom: 16px;
    display: block;
}

/* ── Funding Card ── */
.funding-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.funding-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--teal);
    opacity: 0;
    transition: opacity 0.3s;
}

.funding-card:hover {
    border-color: var(--teal);
    box-shadow: 0 8px 30px rgba(21, 52, 74, 0.08);
    transform: translateY(-2px);
}

.funding-card:hover::before {
    opacity: 1;
}

.funding-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.funding-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.funding-card-status.status-activ {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.funding-card-status.status-programat {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.funding-card-status.status-inchis {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.funding-card-programme {
    font-size: 12px;
    color: var(--teal);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.funding-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.funding-card-description {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.funding-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}

.funding-card-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
}

.funding-card-meta-item i {
    width: 16px;
    color: var(--teal);
    font-size: 12px;
    text-align: center;
}

.funding-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}

.funding-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    transition: gap 0.2s;
}

.funding-card:hover .funding-card-link {
    gap: 10px;
}

.funding-card-org {
    font-size: 12px;
    color: var(--gray-400);
    max-width: 50%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.funding-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 48px;
}

.funding-pagination button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-600);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.funding-pagination button:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.funding-pagination button.active {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.funding-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* CTA Banner */
.funding-cta {
    margin-top: 20px;
}

.funding-cta-content {
    background: linear-gradient(135deg, var(--navy), #1a4560);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--white);
}

.funding-cta-content > i {
    font-size: 36px;
    color: var(--cream);
    flex-shrink: 0;
}

.funding-cta-content div {
    flex-grow: 1;
}

.funding-cta-content h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.funding-cta-content p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.funding-cta-content .btn {
    flex-shrink: 0;
    white-space: nowrap;
}


/* ══════════════════════════════════════════
   Program Detail Page
   ══════════════════════════════════════════ */

.program-detail {
    padding: 40px 0 60px;
}

.program-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 36px;
    align-items: start;
}

/* ── Main Content ── */
.program-main {
    min-width: 0;
}

.program-header {
    margin-bottom: 36px;
}

.program-status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.program-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.program-status-badge.status-activ {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.program-status-badge.status-programat {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.program-status-badge.status-inchis {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.program-code {
    font-size: 13px;
    color: var(--gray-500);
    font-family: var(--font-body);
    font-weight: 500;
}

.program-header h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 14px;
}

.program-description {
    font-size: 16px;
    color: var(--gray-600);
    line-height: 1.7;
}

/* ── Accordion Sections ── */
.program-sections {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.program-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.program-section:hover {
    box-shadow: 0 2px 8px rgba(21, 52, 74, 0.04);
}

.program-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
    gap: 12px;
    transition: background 0.2s;
}

.program-section-header:hover {
    background: rgba(17, 130, 158, 0.03);
}

.program-section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    margin: 0;
}

.program-section-header h3 i {
    color: var(--teal);
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.program-section-toggle {
    color: var(--gray-400);
    font-size: 13px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.program-section.open .program-section-toggle {
    transform: rotate(180deg);
}

.program-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.program-section.open .program-section-body {
    max-height: 3000px;
}

.program-section-content {
    padding: 0 24px 20px 54px;
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.7;
}

.program-section-content ul,
.program-section-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.program-section-content li {
    margin-bottom: 6px;
}

.program-section-content p {
    margin-bottom: 10px;
}

.program-section-content p:last-child {
    margin-bottom: 0;
}

.program-section-content strong {
    color: var(--navy);
}

/* ── Sidebar ── */
.program-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 4px 16px rgba(21, 52, 74, 0.05);
}

.sidebar-card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--teal);
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-item:first-of-type {
    padding-top: 0;
}

.sidebar-item-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
}

.sidebar-item-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
    line-height: 1.4;
}

.sidebar-item-value.highlight {
    color: var(--teal);
    font-weight: 600;
}

.sidebar-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-date {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-date .sidebar-item-label {
    font-size: 10px;
}

.sidebar-date .sidebar-item-value {
    font-size: 13px;
}

/* Days remaining badge */
.sidebar-days-remaining {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.sidebar-days-remaining.urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.sidebar-days-remaining.moderate {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.sidebar-days-remaining.plenty {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.sidebar-days-remaining.expired {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Sidebar CTA */
.sidebar-cta {
    background: linear-gradient(135deg, var(--navy), #1a4560);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--white);
}

.sidebar-cta h4 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar-cta p {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 16px;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* ── Error/Not Found State ── */
.program-error {
    text-align: center;
    padding: 80px 20px;
}

.program-error i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.program-error h2 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--navy);
    margin-bottom: 8px;
}

.program-error p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ── Back to List ── */
.program-back {
    padding: 0 0 60px;
}

.program-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--teal);
    text-decoration: none;
    transition: gap 0.2s;
}

.program-back-link:hover {
    gap: 12px;
}


/* ══════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .program-layout {
        grid-template-columns: 1fr 300px;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .funding-page {
        padding: 40px 0 60px;
    }

    .funding-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .funding-card {
        padding: 22px;
    }

    .funding-card h3 {
        font-size: 16px;
    }

    .funding-cta-content {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
        gap: 16px;
    }

    .funding-cta-content > i {
        font-size: 28px;
    }

    /* Program detail: stack layout */
    .program-layout {
        grid-template-columns: 1fr;
    }

    .program-sidebar {
        position: static;
        order: -1;
    }

    .program-header h1 {
        font-size: 24px;
    }

    .program-section-header {
        padding: 14px 18px;
    }

    .program-section-content {
        padding: 0 18px 16px 44px;
    }

    .sidebar-card {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .funding-filters {
        gap: 6px;
    }

    .funding-filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .funding-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .funding-card-org {
        max-width: 100%;
        text-align: left;
    }

    .sidebar-dates {
        grid-template-columns: 1fr;
    }
}
