/* Gems Page - Developer Vibes Edition */

/* Navbar GitHub Icon */
.navbar-github-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    color: var(--text-primary) !important;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.navbar-github-icon:hover {
    color: var(--accent-primary) !important;
    transform: translateY(-2px) scale(1.1);
}

.navbar-brand:hover .navbar-github-icon {
    transform: translateY(-2px);
}

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3), 0 0 40px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.5), 0 0 60px rgba(139, 92, 246, 0.3);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Featured Resource */
.featured-gem {
    margin-bottom: 4rem;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
}

.featured-gem::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.featured-gem:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(96, 165, 250, 0.3);
    background: var(--bg-tertiary);
}

.featured-gem-content {
    position: relative;
    z-index: 1;
}

.featured-gem-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 1rem 0 1.25rem 0;
    font-family: 'Fira Code', monospace;
    line-height: 1.2;
}

.featured-gem-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(129, 140, 248, 0.1));
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
    display: inline-block;
    font-weight: 600;
}

.featured-gem-title a::before {
    content: 'let ';
    color: var(--code-keyword);
    font-weight: 700;
    margin-right: 0.5rem;
}

.featured-gem-title a::after {
    content: ' = {';
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 0.5rem;
}

.featured-gem-title a:hover {
    color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(129, 140, 248, 0.15));
    border-left-color: var(--accent-secondary);
    transform: translateX(4px);
}

.featured-gem-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-family: 'Inter', sans-serif;
    max-width: 700px;
    padding-left: 1.5rem;
    position: relative;
}

.featured-gem-description::before {
    content: '//';
    position: absolute;
    left: 0;
    color: var(--code-comment);
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 1rem;
}

.featured-gem-description::after {
    content: '};';
    display: block;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 1.125rem;
}

.featured-gem-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Fira Code', monospace;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.3);
}

.featured-gem-link:hover {
    transform: translateX(4px) translateY(-2px);
    box-shadow: 0 6px 25px rgba(96, 165, 250, 0.4);
}

.featured-gem-link svg {
    transition: transform 0.3s ease;
}

.featured-gem-link:hover svg {
    transform: translateX(4px);
}

/* Timeline Layout */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 60px;
}

/* Timeline vertical line */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
        var(--accent-primary) 0%,
        var(--accent-secondary) 50%,
        var(--accent-primary) 100%);
    opacity: 0.3;
}

/* Timeline Entry Container */
.timeline-entry {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInLeft 0.6s ease forwards;
}

/* Stagger the animations */
.timeline-entry:nth-child(1) { animation-delay: 0.1s; }
.timeline-entry:nth-child(2) { animation-delay: 0.2s; }
.timeline-entry:nth-child(3) { animation-delay: 0.3s; }
.timeline-entry:nth-child(4) { animation-delay: 0.4s; }
.timeline-entry:nth-child(5) { animation-delay: 0.5s; }
.timeline-entry:nth-child(6) { animation-delay: 0.6s; }
.timeline-entry:nth-child(7) { animation-delay: 0.7s; }
.timeline-entry:nth-child(8) { animation-delay: 0.8s; }
.timeline-entry:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Timeline Marker (Dot on the left line) with line number */
.timeline-marker {
    position: absolute;
    left: -40px;
    top: 30px;
    width: 12px;
    height: 12px;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.4);
}

/* Add line numbers to timeline entries */
.timeline-entry {
    counter-increment: timeline-counter;
}

.timeline-container {
    counter-reset: timeline-counter;
}

.timeline-marker::before {
    content: counter(timeline-counter);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--code-comment);
    font-weight: 600;
    width: 30px;
    text-align: right;
    opacity: 0.5;
}

.timeline-entry:hover .timeline-marker {
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(96, 165, 250, 0.2);
    background: var(--accent-primary);
    border-color: var(--accent-secondary);
}

.timeline-entry:hover .timeline-marker::before {
    opacity: 1;
    color: var(--accent-primary);
}

/* Timeline Content (Card) */
.timeline-content {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* Colored accent bar on the left of timeline content */
.timeline-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 12px 0 0 12px;
}

.timeline-entry:hover .timeline-content::before {
    opacity: 1;
}

/* Hover effects for timeline content */
.timeline-entry:hover .timeline-content {
    transform: translateX(8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: rgba(96, 165, 250, 0.3);
    background: var(--bg-tertiary);
}

/* Tags */
.gem-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.gem-tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'Fira Code', monospace;
    text-transform: lowercase;
    letter-spacing: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.gem-tag::before {
    content: '"';
    color: var(--code-string);
    margin-right: 2px;
}

.gem-tag::after {
    content: '"';
    color: var(--code-string);
    margin-left: 2px;
}

/* Shimmer effect removed to avoid conflict with quote marks */

/* Different colors for different tag types */
.gem-tag:first-child {
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-primary);
    border-color: rgba(96, 165, 250, 0.3);
}

.gem-tag:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(96, 165, 250, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.featured-gem .gem-tag:first-child {
    background: rgba(96, 165, 250, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(96, 165, 250, 0.3);
    animation: float 3s ease-in-out infinite;
    font-weight: 700;
}

/* Title - Code Style */
.gem-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    font-family: 'Fira Code', monospace;
    flex-grow: 0;
    position: relative;
    z-index: 1;
}

.gem-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(129, 140, 248, 0.05));
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--accent-primary);
    font-weight: 500;
}

.gem-title a::before {
    content: 'let ';
    color: var(--code-keyword);
    font-weight: 600;
    margin-right: 0.25rem;
}

.gem-title a::after {
    content: ' = {';
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 0.25rem;
}

.timeline-entry:hover .gem-title a {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(129, 140, 248, 0.1));
    border-left-color: var(--accent-secondary);
    transform: translateX(4px);
}

.gem-title a:hover {
    color: var(--accent-primary);
}

/* Description - Code Comment Style */
.gem-description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    flex-grow: 1;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    padding-left: 1.5rem;
}

.gem-description::before {
    content: '//';
    position: absolute;
    left: 0;
    color: var(--code-comment);
    font-family: 'Fira Code', monospace;
    font-weight: 600;
}

.gem-description::after {
    content: '};';
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-weight: 400;
}

.timeline-entry:hover .gem-description {
    color: var(--text-secondary);
}

/* Developer-focused unique timeline styling with distinct patterns */
.timeline-entry:nth-child(3n+1) .timeline-marker {
    border-color: var(--accent-primary);
}

.timeline-entry:nth-child(3n+2) .timeline-marker {
    border-color: var(--accent-secondary);
}

.timeline-entry:nth-child(3n+2):hover .timeline-content {
    border-style: dashed;
}

.timeline-entry:nth-child(3n+3) .timeline-marker {
    border-color: #34d399;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .featured-gem {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .featured-gem:hover {
        border-color: rgba(99, 102, 241, 0.4);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }

    .featured-gem-title a {
        color: #f0f0f0;
    }

    .featured-gem-title a:hover {
        color: #a5b4fc;
    }

    .featured-gem-description {
        color: #bbb;
    }

    .featured-gem-link {
        background: #f0f0f0;
        color: #1a1a1a;
    }

    .featured-gem-link:hover {
        background: #818cf8;
        color: white;
    }

    .gem-entry {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .gem-entry:hover {
        border-color: rgba(99, 102, 241, 0.4);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    }

    .gem-tag {
        background: rgba(255, 255, 255, 0.1);
        color: #bbb;
    }

    .gem-title a {
        color: #f0f0f0;
    }

    .gem-title a:hover {
        color: #a5b4fc;
    }

    .gem-description {
        color: #999;
    }
}

/* Add code-style corner brackets for developer aesthetic */
.timeline-entry:nth-child(odd) .timeline-content::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    border-top: 2px solid rgba(96, 165, 250, 0.3);
    border-right: 2px solid rgba(96, 165, 250, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.timeline-entry:nth-child(odd):hover .timeline-content::after {
    opacity: 1;
    border-color: var(--accent-primary);
}

/* Add version-style numbering to timeline entries */
.timeline-entry:nth-child(even) .gem-title::before {
    content: '# ';
    color: var(--accent-primary);
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-right: 0.25rem;
}

.timeline-entry:nth-child(even):hover .gem-title::before {
    opacity: 1;
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .featured-gem {
        padding: 2rem;
        margin-bottom: 3rem;
    }

    .featured-gem-title {
        font-size: 1.5rem;
    }

    .featured-gem-description {
        font-size: 1rem;
    }

    .timeline-container {
        padding-left: 40px;
    }

    .timeline-container::before {
        left: 12px;
    }

    .timeline-marker {
        left: -28px;
        width: 10px;
        height: 10px;
        border-width: 2px;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .gem-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .timeline-container {
        padding-left: 30px;
    }

    .timeline-container::before {
        left: 8px;
    }

    .timeline-marker {
        left: -22px;
        width: 8px;
        height: 8px;
        top: 20px;
    }

    .timeline-content {
        padding: 1.25rem;
    }

    .timeline-entry {
        margin-bottom: 2rem;
    }
}
