/* NeuroGit - Git Graph Visualization Styles */

.git-graph-wrapper {
    background: var(--glass-bg, rgba(17, 24, 39, 0.6));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 0;
    margin-top: 2rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.git-graph-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.git-graph-stats {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    flex: 1;
}

.git-graph-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 8px;
}

.graph-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.2));
    color: var(--text-primary, #e5e7eb);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.graph-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.graph-control-btn:active {
    transform: translateY(0);
}

.zoom-level {
    color: var(--text-primary, #e5e7eb);
    font-size: 0.875rem;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    padding: 0 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-width: 120px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--accent-blue, #3b82f6);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary, #e5e7eb);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.git-graph-container {
    padding: 2rem;
    overflow: hidden;
    max-height: 1200px;  /* Increased from 800px to accommodate larger spacing */
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.git-graph-svg {
    display: block;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Clickable track labels/badges (switch track on click) */
.branch-clickable { cursor: pointer; }
.branch-clickable:hover text { text-decoration: underline; }
.branch-clickable:hover { filter: brightness(1.3); }

/* Commit nodes and connections */
.commit-node {
    transition: all 0.3s ease;
}

.commit-node:hover {
    filter: brightness(1.3);
}

.commit-line {
    transition: stroke 0.3s ease;
}

.commit-node:hover ~ .connections .commit-line {
    stroke-opacity: 0.3;
}

/* Legend */
.git-graph-legend {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.legend-title {
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--text-primary, #e5e7eb);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-items {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary, #9ca3af);
    font-size: 0.875rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #1f2937;
}

.legend-help {
    color: var(--text-secondary, #6b7280);
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.legend-help i {
    margin-right: 0.25rem;
}

/* Empty and Error States */
.git-graph-empty,
.git-graph-error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary, #9ca3af);
}

.git-graph-empty i,
.git-graph-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.git-graph-empty h5,
.git-graph-error h5 {
    color: var(--text-primary, #e5e7eb);
    margin: 1rem 0 0.5rem;
}

.git-graph-error {
    color: #ef4444;
}

.git-graph-error i {
    color: #ef4444;
}

/* Modal for commit details */
.git-graph-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.git-graph-modal-content {
    background: var(--bg-secondary, #1f2937);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

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

.git-graph-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
}

.git-graph-modal .modal-header h5 {
    margin: 0;
    color: var(--text-primary, #e5e7eb);
    font-size: 1.25rem;
}

.git-graph-modal .modal-header h5 i {
    margin-right: 0.5rem;
    color: var(--accent-blue, #3b82f6);
}

.git-graph-modal .btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #9ca3af);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.git-graph-modal .btn-close:hover {
    color: var(--text-primary, #e5e7eb);
    transform: scale(1.1);
}

.git-graph-modal .modal-body {
    padding: 1.5rem;
}

.commit-detail {
    margin-bottom: 1.5rem;
}

.commit-detail label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.commit-detail p {
    margin: 0;
    color: var(--text-primary, #e5e7eb);
    line-height: 1.6;
}

.commit-detail code {
    display: inline-block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: #10b981;
    word-break: break-all;
}

.branch-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.branch-tag {
    display: inline-block;
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-warning i {
    margin-right: 0.25rem;
}

/* Toggle button for Git graph */
.git-graph-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #e5e7eb);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.git-graph-toggle:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: var(--text-primary, #e5e7eb);
}

.git-graph-toggle i {
    font-size: 1.125rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .git-graph-stats {
        gap: 1rem;
    }

    .stat-item {
        min-width: 100px;
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .git-graph-container {
        padding: 1rem;
        max-height: 600px;
    }

    .legend-items {
        gap: 1rem;
    }

    .git-graph-modal-content {
        width: 95%;
        margin: 1rem;
    }

    .commit-detail code {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Loading state */
.git-graph-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary, #9ca3af);
}

.git-graph-loading .spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue, #3b82f6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Scrollbar styling for git graph container */
.git-graph-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.3) rgba(255, 255, 255, 0.05);
}

.git-graph-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.git-graph-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.git-graph-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.4), rgba(168, 85, 247, 0.4));
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.git-graph-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.6), rgba(168, 85, 247, 0.6));
}

/* Animations for branches */
@keyframes branchPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.branch-labels text {
    animation: branchPulse 2s ease-in-out infinite;
}

/* Enhanced visibility for modal display */
#gitGraphModal .git-graph-svg text {
    font-size: 14px !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#gitGraphModal .git-graph-svg circle {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

#gitGraphModal .git-graph-svg line,
#gitGraphModal .git-graph-svg path {
    stroke-width: 3px !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Enhance commit info visibility in modal */
#gitGraphModal .commit-info text {
    fill: #e5e7eb !important;
}

#gitGraphModal .commit-hash {
    fill: #9ca3af !important;
    font-weight: 600;
}

#gitGraphModal .commit-message {
    fill: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600;
}

#gitGraphModal .commit-author {
    fill: #d1d5db !important;
    font-size: 13px !important;
}

/* Branch badge enhancements in modal */
#gitGraphModal .branch-badge rect {
    fill: rgba(59, 130, 246, 0.3) !important;
    stroke: #3b82f6 !important;
    stroke-width: 2px !important;
}

#gitGraphModal .branch-badge text {
    fill: #60a5fa !important;
    font-weight: 600 !important;
    font-size: 12px !important;
}

/* Main branch color enhancement */
#gitGraphModal [data-branch="main"] circle,
#gitGraphModal [data-branch="master"] circle {
    fill: #10b981 !important;
    stroke: #059669 !important;
    stroke-width: 3px !important;
}

/* Increase node sizes in modal for better visibility */
#gitGraphModal .commit-node circle {
    r: 10;
}

