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

body {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    font-family: 'JetBrains Mono', monospace;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff41;
    overflow: hidden;
}

.terminal-container {
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 255, 65, 0.3);
    border: 1px solid #00ff41;
    overflow: hidden;
    position: relative;
}

.terminal-header {
    background: #1a1a1a;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #333;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.button.close { background: #ff5f57; }
.button.minimize { background: #ffbd2e; }
.button.maximize { background: #28ca42; }

.terminal-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #00ff41;
    font-weight: 500;
}

.terminal-body {
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    background: #000;
}

.terminal-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00ff41 #000;
}

.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: #000;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 4px;
}

.ascii-art {
    color: #ff6b35;
    font-size: 12px;
    line-height: 1;
    margin-bottom: 20px;
    white-space: pre;
    font-family: 'JetBrains Mono', monospace;
}

.welcome-message {
    margin-bottom: 20px;
}

.welcome-message p {
    margin-bottom: 8px;
    font-size: 14px;
}

.command-highlight {
    color: #ff6b35;
    font-weight: bold;
    background: rgba(255, 107, 53, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.input-line {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-top: 1px solid #333;
    background: #111;
}

.prompt {
    color: #00ff41;
    margin-right: 10px;
    font-weight: 500;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #00ff41;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    caret-color: transparent;
}

.cursor {
    color: #00ff41;
    animation: blink 0.8s infinite;
    margin-left: 2px;
}

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

.command-output {
    margin: 10px 0;
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
}

.command-line {
    margin-bottom: 10px;
    color: #888;
}

.command-line .prompt {
    color: #00ff41;
}

.command-line .command {
    color: #fff;
}

.error {
    color: #ff4757;
}

.success {
    color: #2ed573;
}

.info {
    color: #3742fa;
}

.warning {
    color: #ffa502;
}

.section-title {
    color: #ff6b35;
    font-size: 16px;
    font-weight: bold;
    margin: 15px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-bar {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.skill-name {
    width: 150px;
    color: #00ff41;
}

.skill-progress {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    /* Il background verrà impostato dinamicamente via JavaScript */
}

.contact-item {
    margin: 5px 0;
    display: flex;
    align-items: center;
}

.contact-icon {
    width: 20px;
    margin-right: 10px;
    color: #ff6b35;
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
}

.capybara-zen {
    color: #ff6b35;
    text-align: center;
    font-style: italic;
    margin: 10px 0;
    animation: zen-glow 2s infinite alternate;
}

@keyframes zen-glow {
    from { text-shadow: 0 0 5px #ff6b35; }
    to { text-shadow: 0 0 15px #ff6b35, 0 0 25px #ff6b35; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #00ff41;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00ff41; }
}

.hacker-effect {
    animation: hack-glitch 0.1s infinite;
}

@keyframes hack-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}

.project-item {
    margin: 15px 0;
    padding: 10px;
    border-left: 3px solid #ff6b35;
    background: rgba(255, 107, 53, 0.05);
    border-radius: 0 5px 5px 0;
}

.project-title {
    color: #ff6b35;
    font-weight: bold;
    margin-bottom: 5px;
}

.project-tech {
    color: #888;
    font-size: 12px;
    margin-bottom: 5px;
}

.project-desc {
    color: #ccc;
    line-height: 1.4;
}

/* Matrix Mode - Pink Transformation */
.matrix-mode {
    --primary-color: #ff1493;
    --glow-color: #ff69b4;
    --secondary-color: #ff00ff;
}

.matrix-mode .terminal-container {
    border-color: var(--primary-color);
    box-shadow: 0 20px 60px rgba(255, 20, 147, 0.4);
}

.matrix-mode .terminal-title,
.matrix-mode .prompt,
.matrix-mode #command-input,
.matrix-mode .cursor {
    color: var(--primary-color) !important;
}

.matrix-mode .terminal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.matrix-mode .matrix-bg {
    opacity: 0.15 !important;
}

.matrix-mode .command-line {
    color: #ffb6c1;
}

.matrix-mode .section-title {
    color: var(--secondary-color);
}

.matrix-mode .command-highlight {
    color: var(--secondary-color);
    background: rgba(255, 20, 147, 0.1);
}

/* Matrix mode skill fills will use dynamic colors from JavaScript */

.matrix-mode .contact-icon {
    color: var(--secondary-color);
}

.matrix-mode .capybara-zen {
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.matrix-mode .project-item {
    border-left-color: var(--primary-color);
    background: rgba(255, 20, 147, 0.05);
}

.matrix-mode .project-title {
    color: var(--primary-color);
}

/* Typewriter effect for command output */
.typing-effect {
    overflow: hidden;
    white-space: pre-wrap;
    animation: typewriter-output 0.02s steps(1, end);
}

@keyframes typewriter-output {
    from { 
        width: 0;
        border-right: 1px solid #00ff41; 
    }
    to { 
        width: 100%;
        border-right: transparent; 
    }
}

.typing-cursor {
    display: inline-block;
    background-color: #00ff41;
    animation: cursor-blink 0.8s infinite;
    margin-left: 1px;
    width: 8px;
    height: 1em;
    vertical-align: text-bottom;
}

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

/* Matrix transition animation */
.matrix-transition {
    transition: all 0.8s ease-in-out;
}

.matrix-pulse {
    animation: matrix-pulse 2s infinite alternate;
}

@keyframes matrix-pulse {
    from { 
        box-shadow: 0 20px 60px rgba(255, 20, 147, 0.3);
    }
    to { 
        box-shadow: 0 20px 80px rgba(255, 20, 147, 0.6);
    }
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        margin: 0;
        padding: 5px;
        font-size: 14px;
    }
    
    .terminal-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 8px;
        min-height: auto;
    }
    
    .terminal-header {
        padding: 8px 15px;
        min-height: 25px;
    }
    
    .terminal-title {
        font-size: 11px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    
    .terminal-buttons .button {
        width: 10px;
        height: 10px;
        margin-right: 4px;
    }
    
    .terminal-body {
        padding: 10px;
    }
    
    .terminal-content {
        font-size: 12px;
        line-height: 1.4;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-right: 10px;
    }
    
    .welcome-message p {
        font-size: 12px;
        margin: 8px 0;
    }
    
    .ascii-art img {
        width: 120px !important;
        height: 120px !important;
        margin-bottom: 15px;
    }
    
    .input-line {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .prompt {
        font-size: 11px;
        margin-right: 5px;
        min-width: fit-content;
    }
    
    #command-input {
        flex: 1;
        min-width: 200px;
        font-size: 14px;
        padding: 8px;
        border: 1px solid #333;
        border-radius: 4px;
    }
    
    .cursor {
        font-size: 14px;
        margin-left: 3px;
    }
    
    /* Skills section mobile optimization */
    .skill-bar {
        margin: 8px 0;
        flex-direction: column;
        gap: 5px;
    }
    
    .skill-name {
        width: 100%;
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .skill-progress {
        width: 100%;
        height: 18px;
        margin: 0;
    }
    
    .skill-fill {
        height: 100%;
    }
    
    /* Command output mobile styles */
    .section-title {
        font-size: 14px;
        margin: 15px 0 10px 0;
    }
    
    .project-item {
        margin: 10px 0;
        padding: 10px;
        font-size: 12px;
    }
    
    .project-title {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .project-tech {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .project-desc {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .contact-item {
        font-size: 12px;
        margin: 5px 0;
    }
    
    .info, .success, .error, .warning {
        font-size: 12px;
        line-height: 1.4;
    }
    
    /* Matrix background optimization for mobile */
    .matrix-bg {
        opacity: 0.3; /* Meno intenso su mobile per non distrarre */
    }
    
    /* Scrollbar mobile */
    .terminal-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .terminal-content::-webkit-scrollbar-thumb {
        background: #00ff41;
        border-radius: 3px;
    }
}

/* Ultra small screens (phones in portrait) */
@media (max-width: 480px) {
    .terminal-container {
        border-radius: 4px;
        height: 100vh;
    }
    
    .terminal-title {
        font-size: 10px;
    }
    
    .terminal-content {
        font-size: 11px;
        max-height: calc(100vh - 110px);
    }
    
    .ascii-art img {
        width: 100px !important;
        height: 100px !important;
    }
    
    #command-input {
        font-size: 13px;
        padding: 6px;
        min-width: 150px;
    }
    
    .prompt {
        font-size: 10px;
    }
    
    .input-line {
        padding: 8px 10px;
    }
    
    .welcome-message p {
        font-size: 11px;
    }
}