@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    position: relative;
}

#matrixBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(2px) contrast(1.2);
    opacity: 0.25;
}

.terminal-container {
    position: relative;
    width: 85%;
    max-width: 950px;
    height: 75%;
}

.terminal-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 400% 400%;
    border-radius: 15px;
    filter: blur(20px);
    opacity: 0.3;
    animation: glow-pulse 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

.terminal {
    width: 100%;
    height: 100%;
    background: rgba(20, 5, 15, 0.92);
    border-radius: 8px;
    box-shadow: 
        0 0 30px rgba(0, 255, 0, 0.1),
        0 0 60px rgba(255, 0, 255, 0.05),
        inset 0 0 20px rgba(0, 255, 0, 0.05);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 0, 0.1);
    animation: terminal-enter 1s ease-out;
}

@keyframes terminal-enter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.terminal-header {
    background: linear-gradient(90deg, rgba(54, 54, 54, 0.9), rgba(40, 40, 40, 0.9));
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.header-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.header-btn.close {
    background: #ff5f56;
}

.header-btn.close:hover {
    background: #ff3b30;
    transform: scale(1.2);
}

.header-btn.minimize {
    background: #ffbd2e;
}

.header-btn.minimize:hover {
    background: #ffaa00;
    transform: scale(1.2);
}

.header-btn.maximize {
    background: #27c93f;
}

.header-btn.maximize:hover {
    background: #1aad2e;
    transform: scale(1.2);
}

.header-title {
    color: #fff;
    font-size: 14px;
    margin-left: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.terminal-body {
    padding: 20px;
    height: calc(100% - 44px);
    overflow-y: auto;
    color: #00ff00;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 0, 80, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 120, 120, 0.1) 0%, transparent 50%);
}

.command {
    margin-bottom: 10px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prompt {
    color: #00ff00;
    margin-right: 8px;
    text-shadow: 0 0 8px currentColor;
}

.typing-animation {
    overflow: hidden;
    border-right: 2px solid #00ff00;
    white-space: nowrap;
    animation: 
        typing 1.5s steps(30, end), 
        blink-caret 0.75s step-end infinite,
        text-glow 2s ease-in-out infinite alternate;
    font-size: 24px;
    margin-bottom: 20px;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #00ff00 }
}

@keyframes text-glow {
    from { text-shadow: 0 0 5px #00ff00; }
    to { text-shadow: 0 0 15px #00ff00, 0 0 20px #00ff00; }
}

.console-loading {
    margin: 20px 0;
    font-size: 18px;
    animation: pulse 1.5s infinite;
}

.loading-dots {
    display: inline-block;
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: "___"; }
    40% { content: "▄__"; }
    60% { content: "▄▄_"; }
    80%, 100% { content: "▄▄▄"; }
}

.loading-dots::after {
    content: "___";
    animation: loading-dots 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hidden {
    display: none;
}

.bio-section {
    margin: 20px 0;
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.name {
    color: #00ff00;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 
        0 0 10px #00ff00,
        0 0 20px #00ff00,
        0 0 30px #00ff00;
    animation: name-glow 3s ease-in-out infinite alternate;
}

@keyframes name-glow {
    from {
        text-shadow: 
            0 0 10px #00ff00,
            0 0 20px #00ff00;
    }
    to {
        text-shadow: 
            0 0 15px #00ff00,
            0 0 30px #00ff00,
            0 0 40px #00ff00;
    }
}

.bio {
    color: #cccccc;
    line-height: 1.6;
    margin-top: 10px;
    font-size: 16px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.project-card {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: project-card-appear 0.6s ease-out;
}

@keyframes project-card-appear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.project-card:hover {
    background: rgba(0, 255, 0, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
}

.project-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.project-title {
    color: #00ff00;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.project-tech {
    color: #ffa500;
    font-size: 14px;
}

.skill-bar {
    margin: 15px 0;
    animation: skill-load 1.5s ease-out;
}

.skill-name {
    color: #00ff00;
    margin-bottom: 5px;
}

.skill-progress {
    height: 8px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-level {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    border-radius: 4px;
    animation: skill-fill 2s ease-out;
}

@keyframes skill-fill {
    from { width: 0%; }
}

@keyframes skill-load {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.contacts {
    margin: 15px 0;
}

.contact-item {
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}

.contact-label {
    color: #00ff00;
    font-weight: bold;
    margin-right: 10px;
}

.contact-value {
    color: #cccccc;
}

.hint {
    color: #666;
    font-style: italic;
}

.back-arrow {
    color: #00ff00;
    cursor: pointer;
    margin: 15px 0;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.back-arrow:hover {
    color: #ffffff;
    background: rgba(0, 255, 0, 0.1);
    padding-left: 15px;
    transform: translateX(-5px);
}

.project-details {
    margin: 20px 0;
    line-height: 1.6;
    animation: project-appear 0.8s ease-out;
}

@keyframes project-appear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.project-title {
    color: #00ff00;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #00ff00;
    padding-bottom: 10px;
}

.project-description {
    color: #cccccc;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 16px;
}

.project-features {
    color: #cccccc;
    margin-bottom: 20px;
    padding-left: 20px;
}

.project-features li {
    margin: 8px 0;
}

.project-tech {
    color: #ffa500;
    font-style: italic;
    background: rgba(255, 165, 0, 0.1);
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #ffa500;
}

/* Стили для скроллбара */
.terminal-body::-webkit-scrollbar {
    width: 12px;
}

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00ff00, #00cc00);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ff00, #009900);
}

/* Адаптивность */
@media (max-width: 768px) {
    .terminal-container {
        width: 95%;
        height: 85%;
    }
    
    .terminal-body {
        padding: 15px;
    }
    
    .name {
        font-size: 24px;
    }
    
    .bio, .project-description {
        font-size: 14px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.link a {
    color: #00ff00;
    margin-right: 8px;
    text-shadow: 0 0 8px currentColor;
    text-decoration: underline;
}

.friends-section {
    margin: 15px 0;
}

.friends-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.friend-card {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    min-width: 150px;
    transition: all 0.3s ease;
    animation: friend-card-appear 0.6s ease-out;
}

.friend-card:hover {
    background: rgba(0, 255, 0, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

.friend-card.best-friend {
    border-color: #ffa500;
    background: rgba(255, 165, 0, 0.05);
}

.friend-card.best-friend:hover {
    background: rgba(255, 165, 0, 0.1);
    box-shadow: 0 5px 15px rgba(255, 165, 0, 0.2);
}

.friend-name {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 5px;
}

.friend-card.best-friend .friend-name {
    color: #ffa500;
}

.friend-role {
    color: #cccccc;
    font-size: 14px;
}

@keyframes friend-card-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}