:root {
    --bg-color: #11151e; /* The deep, dark navy from the left sidebar */
    --card-bg: #22283a; /* The elevated, soft slate-blue of the chat/history cards */
    --text-color: #C5D5F9; /* Crisp, bright off-white for main text (like "Nice to see you") */
    --prompt-color: #A4B9EA; /* A soft, bright sky-blue for the user prompt (matches modern AI UIs) */
    --agent-prompt-color: #c4b5fd; /* A soft pastel purple/lavender for the AI to stand out beautifully */
    --sys-color: #8c96a8; /* The muted grayish-blue used for the dates (e.g., "Yesterday") */
    --border-color: #3a4359; /* The subtle border color outlining the input boxes */
    --sub-titles-color: #FFE88C;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Fira Code', 'Courier New', monospace;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
}

.cli-title {
    color: var(--text-color); /* Uses the crisp white we set earlier */
    margin: 0;

    /* Animation setup */
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: fit-content;
    max-width: 0; /* Starts hidden */

    /* 16 steps for 16 characters in "almog_ben_baruch" */
    animation: typing 1.5s steps(16, end) forwards;
}

.cli-cursor {
    color: var(--prompt-color); /* Keeps the cursor blue/accent colored */
    font-weight: bold;
    animation: blink 1s step-end infinite;
}

/* The typing effect expanding the width */
@keyframes typing {
    from {
        max-width: 0;
    }
    to {
        max-width: 100%;
    }
}

/* The blinking underscore effect */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Main Portfolio Content */
.portfolio-content {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.tab-content h2 {
    color: var(--prompt-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: normal;

    /* Prepares the typing effect */
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: fit-content;
    max-width: 0; /* Hidden by default */
}

/* --- Hide all content below the h2 initially --- */
.tab-content h2 ~ * {
    opacity: 0;
}

/* --- Trigger animations ONLY when the tab is active --- */

/* --- ABOUT TAB --- */
/* "> ./whoami" is 10 characters */
#about.active-tab h2 {
    animation: typing-cmd 0.8s steps(10, end) forwards;
}
#about.active-tab h2 ~ * {
    animation: reveal-content 0.2s forwards;
    animation-delay: 0.7s;
}

/* --- PROJECTS TAB --- */
/* "> ls -l ./projects" is 18 characters */
#projects.active-tab h2 {
    animation: typing-cmd 1s steps(18, end) forwards;
}
#projects.active-tab h2 ~ * {
    animation: reveal-content 0.2s forwards;
    animation-delay: 0.8s;
}

/* --- CONTACT TAB --- */
/* "> ./ping_contact" is 16 characters */
#contact.active-tab h2 {
    animation: typing-cmd 0.9s steps(16, end) forwards;
}
#contact.active-tab h2 ~ * {
    animation: reveal-content 0.2s forwards;
    animation-delay: 0.7s;
}


/* --- The Keyframes --- */
@keyframes typing-cmd {
    from {
        max-width: 0;
    }
    to {
        max-width: 100%;
    }
}

@keyframes reveal-content {
    to {
        opacity: 1;
    }
}


h1, h2, h3 {
    font-weight: 500;
    margin-top: 0;
}


h1 {
    color: var(--text-color);
}

h2 {
    color: var(--agent-prompt-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Yellow for directories/projects */

h3 {
    margin-bottom: 5px;
    color: var(--sub-titles-color)
}

.card-header {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.card-header h3 {
    display: flex;
    align-items: flex-start; /* Keeps the icon at the top if the text wraps to 2 lines */
    gap: 10px;
    margin: 0;
    color: var(--sub-titles-color);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
}

.card-icon {
    color: var(--sub-titles-color);
    flex-shrink: 0; /* Prevents the icon from shrinking when the title is long */
    margin-top: 3px;
}

a {
    color: var(--agent-prompt-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation Tabs */
.cli-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--sys-color);
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
}

.nav-btn:hover {
    color: var(--text-color);
}

.nav-btn.active {
    color: var(--agent-prompt-color);
    background-color: var(--card-bg);
    border-radius: 4px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active-tab {
    display: block;
}

.project-item {
    margin-bottom: 25px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 12px;

    /* Creates a very faint orange transparent background */
    background-color: rgba(255, 204, 0, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.2);

    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.95rem;

    /* Smooth animation for the hover effect */
    transition: all 0.2s ease;
}

.contact-btn svg {
    color: var(--sub-titles-color);
    flex-shrink: 0;
}

.contact-btn:hover {
    background-color: rgba(255, 204, 0, 0.15); /* Brightens on hover */
    border-color: var(--sub-titles-color);
    transform: translateX(6px);
}

/* Floating Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.chat-header {
    background-color: var(--card-bg);
    padding: 8px 15px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    color: var(--agent-prompt-color);
}

.chat-header:hover {
    background-color: #181C28;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 350px;
}

#chatBox {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-size: 14px;
}

.line {
    margin-bottom: 10px;
    word-wrap: break-word;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 8px;
}

.agent-prompt {
    color: var(--agent-prompt-color);
    margin-right: 8px;
}

.system-msg {
    color: var(--sys-color);
}

.agent-msg {
    color: var(--text-color);
}

.input-line {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.input-line input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    outline: none;
    caret-color: var(--text-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .cli-nav {
        flex-wrap: nowrap;           /* Prevents buttons from wrapping to a new line */
        overflow-x: auto;            /* Allows horizontal scrolling */
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
        scrollbar-width: none;       /* Hides scrollbar (Firefox) */
    }

    .cli-nav::-webkit-scrollbar {
        display: none;               /* Hides scrollbar (Chrome/Safari) */
    }

    .nav-btn {
        flex-shrink: 0;              /* Prevents buttons from squishing */
    }
}

