/* ===================================================================
   GitHub Trending Tools - Complete Stylesheet
   =================================================================== */

/* Variables */
:root {
    --gh-primary: #667eea;
    --gh-secondary: #764ba2;
    --gh-dark: #0d1117;
    --gh-border: #30363d;
    --gh-text: #c9d1d9;
    --gh-bg: #161b22;
}

/* Hero Section */
.gh-hero {
    background: linear-gradient(135deg, var(--gh-primary) 0%, var(--gh-secondary) 100%);
    padding: 80px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.gh-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
}

.gh-hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

.gh-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    color: white !important;
}

.gh-hero-title {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.2;
    color: white !important;
}

.gh-hero-desc {
    font-size: 18px;
    opacity: 0.9;
    margin: 0 0 32px 0;
    line-height: 1.6;
    color: white !important;
}

.gh-search-form {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 8px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.gh-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.gh-search-form input {
    flex: 1;
    border: none;
    padding: 12px 16px 12px 48px;
    font-size: 16px;
    color: #1e293b;
    outline: none;
    background: transparent;
}

.gh-search-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.gh-search-form button:hover {
    transform: scale(1.02);
}

/* Main Layout */
.gh-main {
    padding: 50px 0 80px;
    background: #f8fafc;
}

.gh-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* Sidebar */
.gh-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.gh-sidebar-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gh-sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gh-category-list li {
    margin-bottom: 4px;
}

.gh-category-list li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.gh-category-list li a:hover {
    background: #f1f5f9;
    color: #667eea;
}

.gh-category-list li.active a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cat-emoji {
    margin-right: 10px;
    font-size: 16px;
}

.cat-name {
    flex: 1;
}

.cat-count {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.gh-category-list li.active .cat-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Language List */
.gh-lang-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gh-lang-list li a {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.gh-lang-list li a:hover {
    color: #667eea;
}

.gh-lang-list li.active a {
    color: #667eea;
    font-weight: 600;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
}

.lang-count {
    margin-left: auto;
    font-size: 12px;
    color: #94a3b8;
}

/* Sort Bar */
.gh-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.gh-result-count {
    font-size: 14px;
    color: #64748b;
}

.gh-sort-options {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gh-sort-options label {
    font-size: 14px;
    color: #64748b;
}

.gh-sort-options select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
}

/* Featured Section */
.gh-featured-section {
    margin-bottom: 40px;
}

.gh-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gh-featured-card {
    display: block;
    background: linear-gradient(135deg, var(--cat-color) 0%, color-mix(in srgb, var(--cat-color) 80%, #764ba2) 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.gh-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.gh-featured-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.gh-featured-emoji {
    font-size: 36px;
}

.gh-featured-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.gh-featured-card h4 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.gh-featured-tagline {
    font-size: 13px;
    font-weight: 500;
    font-style: italic;
    opacity: 0.85;
    margin: 0 0 8px 0 !important;
}

.gh-featured-card p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.gh-featured-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    opacity: 0.9;
}

.gh-featured-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.gh-project-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
}

.gh-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.gh-project-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gh-card-header {
    background: linear-gradient(135deg, var(--cat-color) 0%, color-mix(in srgb, var(--cat-color) 70%, #764ba2) 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gh-card-emoji {
    font-size: 32px;
}

.gh-card-stats {
    display: flex;
    gap: 12px;
}

.gh-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: white;
    opacity: 0.9;
}

.gh-card-body {
    padding: 20px;
}

.gh-card-owner {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gh-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0 6px 0;
    line-height: 1.2;
}

.gh-card-tagline {
    font-size: 13px;
    font-weight: 500;
    color: #667eea;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.gh-card-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.3;
    margin: 0;
}

.gh-card-footer {
    padding: 16px 20px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gh-card-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.gh-card-category {
    font-size: 12px;
    color: #94a3b8;
}

/* No Results */
.gh-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
}

.gh-no-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.gh-no-results h3 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.gh-no-results p {
    color: #64748b;
    margin: 0 0 24px 0;
}

/* Pagination */
.gh-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.gh-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.gh-page-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.gh-page-info {
    font-size: 14px;
    color: #64748b;
}

/* ===================================================================
   Project Detail Page
   =================================================================== */

/* Breadcrumbs */
.gh-breadcrumbs {
    padding: 16px 0;
    background: #f8fafc;
    font-size: 14px;
    color: #64748b;
}

.gh-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.gh-breadcrumbs a:hover {
    color: #667eea;
}

.gh-breadcrumbs i {
    margin: 0 10px;
    font-size: 10px;
    opacity: 0.5;
}

/* Project Hero */
.gh-project-hero {
    background: var(--cat-color, #667eea);
    background-image: linear-gradient(135deg, var(--cat-color, #667eea) 0%, #764ba2 100%);
    padding: 60px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.gh-project-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.gh-project-hero-content {
    display: flex;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.gh-project-main {
    flex: 1;
}

.gh-project-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.gh-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.15);
}

.gh-badge.featured {
    background: #fbbf24;
    color: #78350f;
}

.gh-badge.difficulty.beginner {
    background: #10b981;
    color: white;
}

.gh-badge.difficulty.intermediate {
    background: #f59e0b;
    color: white;
}

.gh-badge.difficulty.advanced {
    background: #ef4444;
    color: white;
}

.gh-project-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
    color: white !important;
}

.gh-project-owner {
    font-size: 16px;
    opacity: 0.85;
    margin: 0 0 16px 0;
    color: white !important;
}

.gh-project-tagline {
    font-size: 22px;
    font-weight: 500;
    font-style: italic;
    opacity: 0.9;
    margin: 0 0 12px 0;
    color: white !important;
}

.gh-project-short-desc {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.95;
    margin: 0 0 24px 0;
    max-width: 600px;
    color: white !important;
}

.gh-project-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.gh-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.gh-stat-item i {
    font-size: 18px;
    opacity: 0.8;
}

.gh-stat-value {
    font-size: 24px;
    font-weight: 700;
}

.gh-stat-label {
    font-size: 12px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gh-project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.gh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.gh-btn.primary {
    background: white;
    color: var(--cat-color, #667eea);
}

.gh-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.gh-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gh-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gh-project-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
}

.gh-hero-emoji {
    font-size: 120px;
    animation: float 3s ease-in-out infinite;
}

/* Project Content */
.gh-project-content {
    padding: 50px 0 80px;
    background: #f8fafc;
}

.gh-project-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

.gh-project-main-col {
    min-width: 0;
}

.gh-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gh-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gh-section h2 i {
    color: #667eea;
}

.gh-description-content {
    font-size: 16px;
    line-height: 1.8;
    color: #475569;
}

.gh-description-content p {
    margin: 0 0 16px 0;
}

.gh-description-content ul,
.gh-description-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.gh-description-content li {
    margin-bottom: 8px;
}

/* Features */
.gh-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.gh-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 15px;
    color: #475569;
}

.gh-feature-list li i {
    color: #10b981;
    font-size: 14px;
    margin-top: 3px;
}

/* Use Cases */
.gh-use-cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.gh-use-case-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    padding-right: 50px;
    /* Make room for the number badge */
    position: relative;
    min-height: 60px;
}

.gh-use-case-num {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.gh-use-case-card p {
    margin: 0;
    font-size: 15px;
    color: #475569;
    line-height: 1.5;
}

/* Audience */
.gh-audience-text {
    font-size: 16px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

/* Sidebar Cards */
.gh-project-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.gh-sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gh-sidebar-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.gh-quick-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gh-quick-info li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    gap: 16px;
}

.gh-quick-info li:last-child {
    border-bottom: none;
}

.gh-info-label {
    color: #64748b;
    flex-shrink: 0;
}

.gh-info-value {
    color: #1e293b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: right;
    word-break: break-word;
}

.gh-trending-score {
    color: #10b981 !important;
    font-weight: 600 !important;
}

/* Topics */
.gh-topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gh-topic {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

/* Growth Stats */
.gh-growth-stats {
    display: grid;
    gap: 12px;
}

.gh-growth-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f0fdf4;
    border-radius: 10px;
}

.gh-growth-value {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

.gh-growth-label {
    font-size: 13px;
    color: #64748b;
}

/* CTA Card */
.gh-cta-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gh-cta-card h3 {
    color: white;
}

.gh-cta-card p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 16px 0;
    color: white !important;
}

.gh-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: white;
    color: #667eea;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
}

.gh-cta-btn:hover {
    transform: translateY(-2px);
}

/* Related Projects */
.gh-related {
    margin-top: 40px;
}

.gh-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gh-related-card {
    display: block;
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
}

.gh-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.gh-related-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.gh-related-emoji {
    font-size: 32px;
    flex-shrink: 0;
}

.gh-related-card h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.gh-related-card p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.gh-related-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #94a3b8;
}

.gh-related-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===================================================================
   Responsive Design
   =================================================================== */

@media (max-width: 1024px) {
    .gh-layout {
        grid-template-columns: 240px 1fr;
        gap: 30px;
    }

    .gh-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gh-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gh-project-layout {
        grid-template-columns: 1fr;
    }

    .gh-project-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .gh-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gh-hero {
        padding: 60px 0;
    }

    .gh-hero-title {
        font-size: 28px;
    }

    .gh-hero-desc {
        font-size: 16px;
    }

    .gh-layout {
        grid-template-columns: 1fr;
    }

    .gh-sidebar {
        display: none;
    }

    .gh-sidebar-section {
        min-width: 280px;
    }

    .gh-projects-grid,
    .gh-featured-grid {
        grid-template-columns: 1fr;
    }

    .gh-project-hero-content {
        flex-direction: column;
    }

    .gh-project-hero::before {
        display: none;
    }

    .gh-project-visual {
        display: none;
    }

    .gh-project-title {
        font-size: 28px;
    }

    .gh-project-stats {
        display: flex;
        gap: 12px;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .gh-stat-item {
        gap: 2px;
    }

    .gh-stat-item i {
        font-size: 14px;
    }

    .gh-stat-value {
        font-size: 16px;
    }

    .gh-stat-label {
        font-size: 10px;
    }

    .gh-project-actions {
        display: flex;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .gh-project-actions .gh-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 10px;
        font-size: 13px;
    }

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

    .gh-use-cases-grid {
        grid-template-columns: 1fr;
    }

    .gh-related-grid {
        grid-template-columns: 1fr;
    }
}