:root {
    --bg-color: #050505;
    --fg-color: #CCCCCC;
    --card-bg: rgba(10, 25, 10, 0.8);
    --border-color: #00FF41;
    --accent-color: #00FF41;
    --green-accent: #39FF14;
    --comment-color: #888888;
}

#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

#ssh-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #00FF41;
    font-family: 'Roboto Mono', monospace;
    padding: 20px;
    box-sizing: border-box;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#ssh-intro .prompt {
    color: #39FF14;
}

#ssh-intro .cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--fg-color);
    animation: blink 1s step-end infinite;
    margin-left: -2px; /* Move closer */
    vertical-align: middle; /* Align cursor with text */
}

#ssh-intro .cursor.typing {
    animation: none;
}

body {
    background-color: var(--bg-color);
    color: var(--fg-color);
    font-family: 'Roboto Mono', monospace;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    padding-bottom: 100px; /* Add padding to prevent terminal from overlapping content */
}

.container {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: 0 0 20px var(--accent-color);
    background-color: var(--card-bg);
    position: relative;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    margin-right: 30px;
    object-fit: cover;
}

.header-content {
    text-align: left;
}

header h1 {
    color: var(--accent-color);
    margin: 0;
    font-size: 2.5em;
    letter-spacing: 2px;
}

.contact-info {
    margin-top: 10px;
    font-size: 0.9em;
}

.contact-info a {
    color: var(--green-accent);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.btn-download {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 15px;
    border: 1px solid var(--green-accent);
    color: var(--green-accent);
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
    transition: background-color 0.3s, color 0.3s;
}

.btn-download:hover {
    background-color: var(--green-accent);
    color: var(--bg-color);
}

.card {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    opacity: 0; /* Initially hidden for animation */
    transition: opacity 0.5s ease-in-out;
}

/* New Terminal Styles */
#terminal-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    border-top: 1px solid var(--border-color);
    z-index: 10;
    padding: 10px;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

#terminal-history {
    max-height: 100px; /* Reduced height */
    overflow-y: auto;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#terminal-input-line {
    display: flex;
    align-items: center;
}

.terminal-prompt {
    color: var(--green-accent);
    margin-right: 8px;
}

#terminal-command {
    color: var(--fg-color);
}

#cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--fg-color);
    animation: blink 1s step-end infinite;
    margin-left: 5px;
}

#cursor.typing {
    animation: none;
}

@keyframes blink {
    from, to { background-color: transparent; }
    50% { background-color: var(--fg-color); }
}

.loading {
    color: var(--comment-color);
}

.warning {
    color: #ff5555; /* Red color for warnings */
    white-space: pre-wrap;
}

.warning span {
    font-weight: bold;
}

.card h2 {
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.5em;
}

.prompt {
    color: var(--green-accent);
    margin-right: 10px;
}

.job, .education-item {
    margin-bottom: 20px;
}

.job:last-child, .education-item:last-child {
    margin-bottom: 0;
}

h3 {
    color: var(--fg-color);
    margin-bottom: 5px;
}

.date {
    color: var(--comment-color);
    font-style: italic;
    font-size: 0.9em;
}

.skills {
    white-space: pre-wrap; /* Zachowuje formatowanie tekstu */
}

.tech-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tech-list li {
    background-color: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--green-accent);
    padding: 10px;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--comment-color);
    font-style: italic;
}

/* Glitch Animation */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1; /* Magenta for contrast */
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color), 2px 2px #00fff9; /* Cyan for contrast */
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(10% 0 80% 0); }
    20% { clip-path: inset(50% 0 20% 0); }
    40% { clip-path: inset(25% 0 60% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(40% 0 45% 0); }
    100% { clip-path: inset(70% 0 15% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(75% 0 10% 0); }
    20% { clip-path: inset(15% 0 80% 0); }
    40% { clip-path: inset(60% 0 30% 0); }
    60% { clip-path: inset(20% 0 70% 0); }
    80% { clip-path: inset(55% 0 25% 0); }
    100% { clip-path: inset(30% 0 50% 0); }
}

/* Language Selection Styles */
#lang-selection {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    padding: 40px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 0 30px var(--accent-color);
    box-sizing: border-box; /* Fixes width calculation including padding */
}

#lang-selection h2 {
    color: var(--accent-color);
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.lang-btn {
    background: transparent;
    border: 2px solid var(--green-accent);
    color: var(--green-accent);
    padding: 15px 30px;
    margin: 0 10px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: var(--green-accent);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--green-accent);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 120px;
    }
    
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        text-align: center;
        padding-bottom: 30px;
    }

    .profile-pic {
        margin-right: 0;
        margin-bottom: 20px;
        width: 120px;
        height: 120px;
    }

    .header-content {
        text-align: center;
    }

    header h1 {
        font-size: 1.8em;
    }

    .tech-list {
        grid-template-columns: 1fr;
    }
    
    /* Adjust Lang Selection for Mobile */
    #lang-selection {
        width: 85%;
        padding: 20px;
    }
    
    .lang-btn {
        display: block;
        width: 100%;
        margin: 15px 0;
        box-sizing: border-box;
    }
}

/* Cookie Banner Styles */
#cookie-banner {
    position: fixed;
    bottom: -100%; /* Hidden by default */
    left: 0;
    width: 100%;
    background-color: rgba(5, 5, 5, 0.95);
    border-top: 1px solid var(--accent-color);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 255, 65, 0.2);
    z-index: 200; /* Above terminal */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    transition: bottom 0.5s ease-in-out;
    box-sizing: border-box;
}

#cookie-banner.show {
    bottom: 0;
}

#cookie-banner p {
    margin: 0;
    color: var(--fg-color);
    font-size: 0.9rem;
}

#accept-cookies {
    background: transparent;
    border: 1px solid var(--green-accent);
    color: var(--green-accent);
    padding: 8px 20px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#accept-cookies:hover {
    background-color: var(--green-accent);
    color: var(--bg-color);
    box-shadow: 0 0 10px var(--green-accent);
}

@media (max-width: 768px) {
    #cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}