/* ==========================================================================
   PROJECT WORKSPACE CARD & MODAL ARCHITECTURE
   ========================================================================== */

/* Cards Layout */
.project-card {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-banner-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    background: #0d0d10;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
}

.card-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .card-banner-img {
    transform: scale(1.05);
}

.new-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--secondary);
    color: #000;
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 0 10px var(--secondary-glow);
    z-index: 10;
}

.card-main-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-repo-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.card-repo-title:hover {
    color: var(--primary);
}

.card-repo-desc {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Dynamic Language Percentage Bar */
.language-track-bar {
    display: flex;
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    cursor: help;
}

.lang-segment {
    height: 100%;
}

/* Desktop Only visibility limiters */
@media (max-width: 1023px) {
    .btn-source {
        display: none !important;
    }
}

/* Modals & Layout overlay panels */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    width: 90%;
    max-width: 850px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: drawer-slide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes drawer-slide {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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

.drawer-header {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.drawer-close {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.drawer-close:hover {
    color: var(--primary);
}

.drawer-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Rendered markdown body modifications */
.markdown-body {
    font-family: var(--font-sans);
    color: var(--text-main);
    line-height: 1.6;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-weight: 700;
}

.markdown-body h1 {
    font-size: 1.75rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.35rem;
}

.markdown-body h2 {
    font-size: 1.4rem;
}

.markdown-body p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.markdown-body pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Inline IFrame display structural wrappers */
.iframe-container-layout {
    width: 95% !important;
    max-width: 1200px !important;
}

#preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    /* Neutral container backing color */
}

.iframe-fallback {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: var(--bg-surface);
}

/* Hover-based Tooltip popup pie-chart optimized */
.lang-tooltip-card {
    position: fixed;
    /* Changed from absolute for smoother layout tracking */
    z-index: 9999;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-color: var(--primary-glow);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.95) translate(50%, 50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: 300px;
}

.lang-tooltip-card.active {
    opacity: 1;
    transform: scale(1);
}

.pie-chart {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-main);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}