/* ========================================
   GITHUB ACTIVITY SECTION
   ======================================== */

.github-section {
    padding: 6rem 0;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.github-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.section-header-github {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

.section-tag-github {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(157, 78, 221, 0.1);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 50px;
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.github-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* Glass card additions */
.github-stats-card,
.leetcode-stats-card,
.github-calendar-card,
.github-commits-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2.2rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.github-stats-card:hover,
.leetcode-stats-card:hover,
.github-calendar-card:hover,
.github-commits-card:hover {
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: var(--shadow), var(--glow);
}

.github-stats-card .card-glow {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, transparent 75%);
    pointer-events: none;
}

.leetcode-stats-card .card-glow {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.1) 0%, transparent 75%);
    pointer-events: none;
}

/* Github stats card internal items */
.github-profile-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 2rem;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.2rem;
}

.git-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.git-profile-info h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 700;
}

.git-handle {
    font-size: 0.88rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Fira Code', monospace;
}

.git-status-badge {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    font-size: 0.75rem;
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-weight: 600;
}

.github-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.git-metric {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
}

.git-metric:hover {
    border-color: rgba(0, 242, 254, 0.15);
    background: rgba(0, 242, 254, 0.01);
}

.git-metric .metric-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
}

.git-metric .metric-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

.git-languages-breakdown h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.lang-bars {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.lang-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lang-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.lang-name {
    color: var(--text-secondary);
}

.lang-pct {
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
}

.bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
}

.python-fill {
    background: linear-gradient(90deg, #3572A5, #00f2fe);
}

.java-fill {
    background: linear-gradient(90deg, #b07219, #9d4edd);
}

.web-fill {
    background: linear-gradient(90deg, #e34c26, #f06529);
}

/* LeetCode stats card internal items */
.leetcode-header {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.2rem;
    margin-bottom: 2rem;
}

.leetcode-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.leetcode-brand i {
    font-size: 1.4rem;
    color: #ffa116; /* LeetCode orange tint */
}

.leetcode-brand h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    font-weight: 700;
}

.leet-handle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
}

.leetcode-body {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* Circular Progress Ring */
.leet-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.leet-progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.ring-svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: #ffa116;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314.16; /* 2 * PI * r (r=50) */
    stroke-dashoffset: 140;   /* solver progress offset */
    animation: fill-ring 1.5s ease-out forwards;
}

@keyframes fill-ring {
    from { stroke-dashoffset: 314.16; }
}

.ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.leet-solved {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
}

.leet-total {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leet-difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.diff-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.diff-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
}

.diff-title {
    color: var(--text-secondary);
}

.diff-count {
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
}

.diff-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 5px;
    overflow: hidden;
}

.diff-bar .fill {
    height: 100%;
    border-radius: 5px;
}

.easy .diff-title { color: #00b8a3; }
.easy .fill { background: #00b8a3; }

.medium .diff-title { color: #ffc01e; }
.medium .fill { background: #ffc01e; }

.hard .diff-title { color: #ef4743; }
.hard .fill { background: #ef4743; }

.coding-badges {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.2rem;
}

.badge-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 0.45rem 0.85rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.badge-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.badge-item i { font-size: 0.85rem; }
.text-green { color: #00b8a3; }
.text-yellow { color: #ffc01e; }
.text-orange { color: #f97316; }

/* Github Calendar style */
.github-calendar-card {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-header h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.legend-box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.level-0 { background: rgba(255, 255, 255, 0.04); }
.level-1 { background: rgba(0, 242, 254, 0.2); }
.level-2 { background: rgba(0, 242, 254, 0.45); }
.level-3 { background: rgba(0, 242, 254, 0.75); }
.level-4 { background: var(--primary-color); box-shadow: 0 0 8px var(--primary-color); }

.calendar-wrapper {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
}

/* Contribution Calendar Layout grid cells */
.calendar-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, 10px);
    gap: 3px;
    min-width: 720px;
    margin-left: 20px;
}

.calendar-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.calendar-cell:hover {
    transform: scale(1.3);
    z-index: 2;
}

.calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Commits List styling */
.github-commits-card {
    position: relative;
    z-index: 1;
}

.github-commits-card h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.commits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.commit-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.commit-item:hover {
    border-color: rgba(157, 78, 221, 0.25);
    background: rgba(255, 255, 255, 0.02);
    transform: translateX(5px);
}

.commit-icon-wrapper {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(157, 78, 221, 0.15);
    border: 1px solid rgba(157, 78, 221, 0.3);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.commit-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.commit-message {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
}

.commit-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.commit-repo {
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
    text-decoration: none;
    font-weight: 600;
}

.commit-date {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

/* Skeleton animation */
.commit-item-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--glass-border);
}

.pulse-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    animation: pulse-skeleton 1.5s ease-in-out infinite;
}

.pulse-bar.short { width: 30%; }
.pulse-bar.long { width: 75%; }

@keyframes pulse-skeleton {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Responsive */
@media (max-width: 968px) {
    .github-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .leetcode-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: center;
    }
    .github-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
