/* GitHub Dark Theme Colors */
:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --text-secondary: #8b949e;
    --text-accent: #58a6ff;
    --text-success: #238636;
    --border-color: #30363d;
    --hover-bg: #161b22;
    --cursor-color: #f85149;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Terminal Header */
.terminal-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: min(50vh, 400px);
    overflow-y: auto;
}

.terminal-content {
    padding: clamp(0.75rem, 3vw, 1rem) clamp(1rem, 4vw, 2rem);
}

.terminal-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.terminal-path {
    color: var(--text-color);
    font-size: 1rem;
}

.cursor {
    color: var(--cursor-color);
    animation: blink 1s infinite;
}

.terminal-output {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 1rem;
    white-space: pre-wrap;
    max-height: 50vh;
    overflow-y: auto;
}

.terminal-output .clickable-email {
    color: var(--text-accent);
    transition: color 0.3s ease;
}

.terminal-output .clickable-email:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.terminal-output .contact-link {
    color: var(--text-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.terminal-output .contact-link:hover {
    color: var(--text-color);
    text-decoration: underline;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Main Git Graph */
.git-graph {
    flex: 1;
    padding: calc(min(50vh, 400px) + 2rem) 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - min(50vh, 400px) - 80px);
}

.commit {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    cursor: pointer;
}

.commit.visible {
    opacity: 1;
    transform: translateY(0);
}

.commit:hover .commit-hash {
    color: var(--text-accent);
}

/* Git Graph Branch Line */
.branch-line {
    position: relative;
    width: 40px;
    margin-right: 1rem;
    display: flex;
    justify-content: center;
}

.branch-line::before {
    content: '';
    position: absolute;
    top: -2rem;
    bottom: -2rem;
    left: 50%;
    width: 2px;
    background-color: var(--border-color);
    transform: translateX(-50%);
}

.commit-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-success);
    border: 2px solid var(--bg-color);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Commit Content */
.commit-content {
    flex: 1;
    min-width: 0;
}

.commit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.commit-hash {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.commit-message {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.commit-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Expandable Details */
.commit-details {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--hover-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.commit.expanded .commit-details {
    max-height: 500px;
}

.commit-description {
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--text-accent);
    color: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.commit-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.commit-link {
    color: var(--text-accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.commit-link:hover {
    color: var(--text-color);
}

/* CLI Footer */
.cli-footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 4vw, 2rem);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
}

.cli-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cli-prompt {
    color: var(--text-color);
    font-size: 0.9rem;
}

.cli-input {
    background-color: transparent;
    border: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
    padding: 0.25rem 0;
}

.cli-input::placeholder {
    color: var(--text-secondary);
}

.cli-output {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 40vh;
    overflow-y: auto;
    padding: 0.5rem 0;
    white-space: pre-wrap;
}

.input-cursor {
    color: var(--cursor-color);
    animation: blink 1s infinite;
    opacity: 0;
}

.cli-input:focus + .input-cursor {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-header {
        max-height: min(45vh, 350px);
    }

    .terminal-content {
        padding: clamp(0.5rem, 2vw, 0.75rem) clamp(0.75rem, 3vw, 1rem);
    }

    .terminal-output {
        font-size: 0.8rem;
        max-height: min(35vh, 300px);
    }

    .git-graph {
        padding: calc(min(45vh, 350px) + 1rem) 1rem 3rem;
        min-height: calc(100vh - min(45vh, 350px) - 100px);
    }

    .commit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .commit-message {
        font-size: 1rem;
    }

    .cli-footer {
        padding: clamp(0.5rem, 2vw, 0.75rem) clamp(0.75rem, 3vw, 1rem);
        max-height: 45vh;
    }

    .cli-output {
        max-height: 30vh;
    }

    .branch-line {
        width: 30px;
        margin-right: 0.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}