/* === ZMIENNE GLOBALNE I KONFIGURACJA MOTYWÓW === */
:root {
    /*bash linux*/
    --bg-color: #0c0c0c;
    --terminal-bg: #1a1a1a;
    --text-color: #33ff00;
    --accent-color: #33ff00; /* Kolor ramek, przycisków */
    --prompt-color: #ff0055;
    --font-stack: 'Courier New', Courier, monospace;
    --mesh-color: rgba(51, 255, 0, 0.25);
    --glow: 0 0 15px rgba(51, 255, 0, 0.2);
}

/*motyw powershell*/
body.theme-powershell {
    --bg-color: #012456;
    --terminal-bg: #012456;
    --text-color: #eeedf0;
    --accent-color: #fce94f; /* Żółty */
    --prompt-color: #fce94f;
    --font-stack: 'Consolas', 'Courier New', monospace;
    --mesh-color: rgba(252, 233, 79, 0.25);
    --glow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* motyw windows cmd*/
body.theme-windows-cmd {
    --bg-color: #0c0c0c;
    --terminal-bg: #0c0c0c;
    --text-color: #cccccc;
    --accent-color: #cccccc;
    --prompt-color: #cccccc;
    --font-stack: 'Consolas', 'Courier New', monospace;
    --mesh-color: rgba(255, 255, 255, 0.25);
    --glow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/*motyw secops*/
body.theme-secops {
    --bg-color: #2b2b2b;
    --terminal-bg: #1e1e1e;
    --text-color: #dddddd;
    --accent-color: #e45959;
    --prompt-color: #e45959;
    --font-stack: 'Courier New', Courier, monospace;
    --mesh-color: rgba(228, 89, 89, 0.25);
    --glow: 0 0 15px rgba(228, 89, 89, 0.3);
}

/*RESET*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-stack);
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s; /* Płynna zmiana motywu */
}

/*LINKI I PRZYCISKI*/
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

button {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--accent-color);
    color: var(--bg-color); 
    box-shadow: var(--glow);
}

/*UKŁAD STRONY*/
header, footer {
    padding: 1rem;
    border-bottom: 1px solid #333;
    z-index: 10;
}

.main-header {
    background-color: rgba(12, 12, 12, 0.6); 
    backdrop-filter: blur(5px);
    position: relative;
}

.top-nav ul, .skill-nav {
    display: flex;
    list-style: none;
    gap: 1rem;
    justify-content: left;
    flex-wrap: wrap;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

/*SEKCJA SKILLS*/
#skills-bar-nav {
    width: 100%;
    max-width: 1200px;
}

.skills-container {
    background-color: transparent;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    
    transition: all 0.5s ease-in-out;
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.skills-bar-label {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: bold;
}

/*TERMINAL*/
#terminal {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    border: 2px solid var(--accent-color);
    background-color: var(--terminal-bg);
    box-shadow: var(--glow);
    transition: all 0.3s ease;
}

.container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/*INTERAKTYWNY TERMINAL*/
#interactive-terminal-container {
    position: relative;
    width: 100%;
    margin-top: 10px;
    cursor: text;
    white-space: pre; 
    overflow-x: auto; 
    padding-bottom: 5px;
}

#interactive-terminal-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

#visual-prompt-layer {
    width: 100%;
    pointer-events: none;
}

#visual-typed-text {
    white-space: pre;
}

.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 1.1em;
    background-color: #00ffff;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 0px;
}

#cmd-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: transparent;
    caret-color: transparent;
    font-family: inherit;
    font-size: inherit;
    z-index: 2;
}

/*TERMINAL PROJECTS*/
#terminal.terminal-projects {
    width: 100%;
    max-width: 2400px;
    min-height: 75vh;
}

#terminal.terminal-projects #console-output {
    white-space: pre; 
    word-break: normal;
    overflow-wrap: normal;
    overflow-x: auto; 
    padding-bottom: 15px;
}

/*pasek poziomy*/
#terminal.terminal-projects #console-output::-webkit-scrollbar:horizontal,
#interactive-terminal-container::-webkit-scrollbar:horizontal {
    height: 8px; 
}

/*scrollowanie samego tekstu, input zostaje na dole */
#console-output {
    max-height: 55vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    scroll-behavior: smooth;
}

/*terminalowy pasek scrolla*/
#console-output::-webkit-scrollbar {
    width: 8px;
}
#console-output::-webkit-scrollbar-track {
    background: transparent;
}
#console-output::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

/*TREŚĆ I FORMATOWANIE*/
.left {
    min-width: 0;
    word-wrap: break-word;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-family: inherit;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 6px;
    display: inline-block;
}

.typing-cursor::after {
    content: '_';
    animation: blink 1s step-end infinite;
    margin-left: 5px;
    color: inherit;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/*ASCII PHOTO*/
.ascii-photo {
    font-size: 8px;
    line-height: 10px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    white-space: pre;
}

/*wyrównanie ASCII do prawej terminala projekty*/
.ascii-photo.align-right {
    justify-content: flex-end;
}

/*MATRIX FOOTER*/
.main-footer {
    position: relative;
    padding: 0;
    background-color: #0c0c0c;
    border-top: 1px solid #333;
    border-bottom: none;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 1;
    padding: 1rem;
    background: rgba(12, 12, 12, 0.7);
    text-align: center;
}

.footer-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    margin-bottom: 0.5rem;
}

.footer-info a:hover {
    color: var(--text-color);
    text-shadow: 0 0 5px var(--text-color);
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.7;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/*RESPONSYWNOŚĆ*/
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    .ascii-photo {
        font-size: 6px;
        line-height: 6px;
    }
    main {
        padding: 0.5rem;
    }
}