/* ================================================
   Open Source Projects — Dark Tech Theme
   Consistent with NT site brand language
   ================================================ */

/* ── Hero ─────────────────────────────────────── */
.open-source-hero {
    padding: 130px 0 90px;
    background: linear-gradient(135deg, #0a0f18 0%, #0d1a2e 50%, #0a0f18 100%);
    position: relative;
    overflow: hidden;
    color: #fff;
    text-align: center;
}

.open-source-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 40%, rgba(0, 245, 212, 0.13) 0%, transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(0, 212, 245, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Subtle grid overlay */
.open-source-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 245, 212, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 212, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-label {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--primary, #00f5d4);
    margin-bottom: 18px;
    border: 1px solid rgba(0, 245, 212, 0.3);
    padding: 5px 16px;
    border-radius: 999px;
    background: rgba(0, 245, 212, 0.06);
}

.open-source-hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #ffffff 30%, var(--primary, #00f5d4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.open-source-hero p.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 245, 212, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.hero-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary, #00f5d4);
    line-height: 1;
}

.hero-stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* ── Filter Bar ───────────────────────────────── */
.os-filter-section {
    background: rgba(26, 31, 46, 0.95);
    border-bottom: 1px solid rgba(0, 245, 212, 0.08);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.open-source-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.open-source-filter .filter-select {
    appearance: none;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 245, 212, 0.2);
    border-radius: 8px;
    padding: 9px 38px 9px 14px;
    font-size: 0.9rem;
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300f5d4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.open-source-filter .filter-select:focus {
    outline: none;
    border-color: var(--primary, #00f5d4);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.1);
}

.open-source-filter .filter-select option {
    background: #1a1f2e;
    color: #fff;
}

/* ── Main Content Area ────────────────────────── */
.os-content-section {
    background: #0a0f18;
    padding: 50px 0 80px;
    min-height: 400px;
}

#loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 70px 0;
    color: var(--primary, #00f5d4);
    font-size: 0.95rem;
}

#loading-indicator::before {
    content: '';
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0, 245, 212, 0.2);
    border-top-color: var(--primary, #00f5d4);
    border-radius: 50%;
    animation: osSpin 0.7s linear infinite;
}

@keyframes osSpin {
    to { transform: rotate(360deg); }
}

/* ── Projects Grid ────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── Project Card ─────────────────────────────── */
.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    opacity: 0;
    transform: translateY(22px);
    animation: osCardIn 0.5s ease forwards;
}

.project-card-link:nth-child(1) { animation-delay: 0.05s; }
.project-card-link:nth-child(2) { animation-delay: 0.10s; }
.project-card-link:nth-child(3) { animation-delay: 0.15s; }
.project-card-link:nth-child(4) { animation-delay: 0.20s; }
.project-card-link:nth-child(5) { animation-delay: 0.25s; }
.project-card-link:nth-child(6) { animation-delay: 0.30s; }

@keyframes osCardIn {
    to { opacity: 1; transform: translateY(0); }
}

.project-card {
    background: #141928;
    border: 1px solid rgba(0, 245, 212, 0.1);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary, #00f5d4), var(--secondary, #00d4f5));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 245, 212, 0.15);
    border-color: rgba(0, 245, 212, 0.35);
}

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

/* ── Card Image ───────────────────────────────── */
.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #0d1220;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.8);
}

.project-card:hover .project-image img {
    transform: scale(1.07);
    filter: brightness(1);
}

/* ── Card Content ─────────────────────────────── */
.project-content {
    padding: 20px;
}

.project-content h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 10px 0 8px;
    line-height: 1.4;
}

.project-content p {
    font-size: 0.865rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* ── Badges ───────────────────────────────────── */
.language-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary, #00f5d4);
    background: rgba(0, 245, 212, 0.1);
    border: 1px solid rgba(0, 245, 212, 0.22);
    margin-right: 6px;
}

.license-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Stars ────────────────────────────────────── */
.stars-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #f59e0b;
    font-size: 13px;
    font-weight: 600;
}

/* ── Topic Tags ───────────────────────────────── */
.topic-tag {
    display: inline-block;
    margin: 3px 5px 3px 0;
    padding: 3px 10px;
    border: 1px solid rgba(0, 212, 245, 0.2);
    border-radius: 999px;
    font-size: 11px;
    color: rgba(0, 212, 245, 0.8);
    background: rgba(0, 212, 245, 0.05);
    transition: border-color 0.2s, background 0.2s;
}

.project-card:hover .topic-tag {
    border-color: rgba(0, 212, 245, 0.4);
    background: rgba(0, 212, 245, 0.1);
}

/* ── Featured Badge ───────────────────────────── */
.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--primary, #00f5d4), #00d4f5);
    color: #0a0f18;
    padding: 4px 11px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
}

/* ── Buttons ──────────────────────────────────── */
.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 245, 212, 0.35);
    color: var(--primary, #00f5d4);
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.25s ease;
    background: rgba(0, 245, 212, 0.04);
}

.github-btn:hover {
    background: var(--primary, #00f5d4);
    color: #0a0f18;
    border-color: var(--primary, #00f5d4);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
}

.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.65);
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.03);
}

.demo-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ── No Projects ──────────────────────────────── */
.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1rem;
}

.no-projects i {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: rgba(0, 245, 212, 0.3);
}

/* ── Detail Page ──────────────────────────────── */
.os-detail-content {
    background: #0a0f18;
    padding: 60px 0 80px;
}

.os-detail-image-wrap {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 36px;
    border: 1px solid rgba(0, 245, 212, 0.1);
}

.os-detail-image-wrap img {
    width: 100%;
    display: block;
}

.os-section-label {
    font-size: 0.75rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary, #00f5d4);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.os-section-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--primary, #00f5d4);
    border-radius: 2px;
}

.os-detail-summary {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.os-detail-body {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
    line-height: 1.85;
}

.os-detail-body p { margin-bottom: 1rem; }
.os-detail-body h2, .os-detail-body h3 { color: #fff; margin: 1.8rem 0 0.8rem; font-weight: 700; }
.os-detail-body a { color: var(--primary, #00f5d4); text-decoration: underline; }
.os-detail-body code { background: rgba(0, 245, 212, 0.08); padding: 2px 7px; border-radius: 4px; font-size: 0.875em; color: var(--primary, #00f5d4); }
.os-detail-body pre { background: #101624; border: 1px solid rgba(0, 245, 212, 0.1); border-radius: 10px; padding: 20px; overflow-x: auto; }
.os-detail-body ul, .os-detail-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.os-detail-body img { max-width: 100%; border-radius: 8px; }

/* ── Sidebar Card ─────────────────────────────── */
.os-sidebar-card {
    background: #141928;
    border: 1px solid rgba(0, 245, 212, 0.12);
    border-radius: 14px;
    padding: 26px;
    position: sticky;
    top: 80px;
}

.os-sidebar-card .sidebar-heading {
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary, #00f5d4);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 245, 212, 0.1);
}

.os-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
}

.os-meta-row:last-of-type {
    border-bottom: none;
}

.os-meta-label {
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.os-meta-value {
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
}

.os-sidebar-topics {
    padding: 14px 0 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 6px;
}

.os-sidebar-topics .os-meta-label {
    font-size: 0.875rem;
    margin-bottom: 8px;
    display: block;
}

.os-sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.os-sidebar-buttons .github-btn,
.os-sidebar-buttons .demo-btn {
    justify-content: center;
}

/* ── Related Projects ─────────────────────────── */
.os-related-section {
    margin-top: 60px;
    padding-top: 50px;
    border-top: 1px solid rgba(0, 245, 212, 0.08);
}

.os-related-header {
    margin-bottom: 30px;
}

.os-related-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.os-related-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ── Pagination ───────────────────────────────── */
.pagination-container {
    margin-top: 44px;
    display: flex;
    justify-content: center;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .os-sidebar-card {
        position: static;
        margin-top: 32px;
    }
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .open-source-hero {
        padding: 100px 0 60px;
    }

    .hero-stats {
        gap: 28px;
    }

    .open-source-hero h1 {
        font-size: 1.8rem;
    }
}
