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

:root {
    --primary-color: #8e44ad;
    --secondary-color: #9b59b6;
    --text-color: #f5f5f5;
    --bg-color: #121212;
    --card-bg: rgba(25, 25, 25, 0.9);
    --shadow-color: rgba(142, 68, 173, 0.3);
    --transition: all 0.3s ease;
}

#openModal {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px var(--shadow-color);
}

#openModal:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.modal-open {
    opacity: 1;
}

.modal.modal-open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 15px;
    padding: 25px;
    max-width: 700px;
    width: 90%;
    text-align: left;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

/* Кнопка закрытия */
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
}

.close:hover {
    color: var(--primary-color);
    background: rgba(142, 68, 173, 0.2);
    transform: rotate(90deg);
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

a.skill {
    color: white;
    text-decoration: none;
    display: inline-block;
}

.link {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

canvas.glslCanvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Стили для body и html */
body, html {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 100px 0;
    position: relative;
    background-color: transparent;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 15, 0.4);
    z-index: -1;
    pointer-events: none;
}

/* Стили для контейнера */
.container {
    background: rgba(25, 25, 25, 0.8); /* Делаем фон более прозрачным */
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    width: 95%;
    max-width: 800px;
    text-align: center;
    z-index: 1;
    animation: fadeIn 1.5s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    margin: 0 auto;
    position: relative;
}

h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.profile-photo {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.profile-photo::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), transparent, var(--secondary-color));
    z-index: -1;
    animation: rotate 10s linear infinite;
    opacity: 0.7;
}

.profile-photo img,
.profile-photo video {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: cover;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.profile-photo img:hover,
.profile-photo video:hover {
    transform: scale(1.08);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.bio, .skills {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.bio:hover, .skills:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

h2 {
    font-size: 1.7rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -5px;
    left: 25%;
    border-radius: 2px;
}

p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e0e0e0;
    max-width: 700px;
    margin: 0 auto 10px;
}

.skills-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.skill {
    background-color: var(--primary-color);
    padding: 9px 18px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 10px var(--shadow-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.skill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.skill:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

.skill:hover::before {
    left: 100%;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #f0f0f0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    background: rgba(20, 20, 20, 0.5);
    width: 100%;
    backdrop-filter: blur(3px);
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(142, 68, 173, 0.4);
    z-index: 1;
    position: relative;
}

.footer p {
    margin: 5px auto;
    line-height: 1.6;
    text-align: center;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Аудио плеер */
.audio-player {
    background: rgba(20, 20, 20, 0.7);
    padding: 18px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    margin: 20px auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-btn {
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.control-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.progress-wrapper {
    flex: 1;
    margin: 0 15px;
    display: flex;
    align-items: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px var(--primary-color);
}

.time-display {
    color: #ccc;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.volume-wrapper {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.volume-control {
    width: 80px;
    height: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    margin-left: 10px;
}

.volume-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

#volumeIcon {
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

#volumeIcon:hover {
    color: var(--primary-color);
}

/* Медиа запросы */
@media (max-width: 768px) {
    body, html {
        padding: 30px 0;
    }
    
    .container {
        padding: 30px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .skill {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .profile-photo img,
    .profile-photo video {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 480px) {
    body, html {
        padding: 20px 0;
    }
    
    .container {
        padding: 25px 15px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .skill {
        padding: 7px 14px;
        font-size: 0.85rem;
    }
    
    .profile-photo img,
    .profile-photo video {
        width: 130px;
        height: 130px;
    }
    
    .profile-photo::after {
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
    }
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.project-card {
    background: rgba(30, 30, 30, 0.7);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--primary-color);
}

.project-card h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.project-card p {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #cccccc;
}

.project-card strong {
    color: var(--secondary-color);
    font-weight: 600;
}

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

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.view-counter {
    position: absolute;
    top: 15px;
    right: 20px;
    background-color: rgba(20, 20, 20, 0.7);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: var(--transition);
}

.view-counter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.view-counter i {
    color: var(--primary-color);
}

/* Фоллбэк для браузеров без поддержки WebGL */
.no-webgl body {
    background: linear-gradient(135deg, #121212, #2c2c2c, #121212);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
    100% { background-position: 0% 50% }
}

.typewriter {
    min-height: 1.6em;
    border-right: 2px solid var(--primary-color);
    animation: blink-cursor 0.7s step-end infinite;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

@keyframes blink-cursor {
    from, to { border-right-color: transparent; }
    50% { border-right-color: var(--primary-color); }
}

/* Когда тайпинг закончен, убираем мигающий курсор */
.typewriter.typing-complete {
    border-right: none;
    animation: none;
}

/* Loading Animation Styles */
.loading-state {
    min-height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading-text {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

.dot-pulse {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--primary-color);
    animation: dot-pulse 1.5s ease-in-out infinite;
    animation-delay: .2s;
}

.dot-pulse::before,
.dot-pulse::after {
    content: '';
    position: absolute;
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--primary-color);
}

.dot-pulse::before {
    left: -15px;
    animation: dot-pulse 1.5s ease-in-out infinite;
    animation-delay: 0s;
}

.dot-pulse::after {
    left: 15px;
    animation: dot-pulse 1.5s ease-in-out infinite;
    animation-delay: .4s;
}

@keyframes dot-pulse {
    0% {
        transform: scale(0.3);
        opacity: 0.2;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.3);
        opacity: 0.2;
    }
}

.discord-presence.loading-state {
    background: rgba(47, 49, 54, 0.4);
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

/* Discord Status Styles */
.discord-presence {
    background: rgba(47, 49, 54, 0.6);
    border-radius: 10px;
    padding: 10px;
    margin: 6px auto;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    max-width: 75%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-size: 12px;
}

.discord-presence:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.discord-status {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.discord-status.online .status-indicator {
    background-color: #43b581;
    box-shadow: 0 0 6px rgba(67, 181, 129, 0.5);
}

.discord-status.idle .status-indicator {
    background-color: #faa61a;
    box-shadow: 0 0 6px rgba(250, 166, 26, 0.5);
}

.discord-status.dnd .status-indicator {
    background-color: #f04747;
    box-shadow: 0 0 6px rgba(240, 71, 71, 0.5);
}

.discord-status.offline .status-indicator {
    background-color: #747f8d;
    box-shadow: 0 0 6px rgba(116, 127, 141, 0.5);
}

.discord-activity {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
    margin-top: 6px;
}

.activity-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.activity-image-container {
    position: relative;
    flex-shrink: 0;
}

.activity-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease;
}

.activity-image:hover {
    transform: scale(1.05);
}

.activity-status-image {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(47, 49, 54, 0.9);
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.activity-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.activity-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.activity-details {
    color: #ffffff;
    font-size: 12px;
    opacity: 0.9;
}

.activity-state {
    color: #dcddde;
    font-size: 11px;
    opacity: 0.8;
}

.activity-time {
    margin-top: 2px;
    color: var(--secondary-color);
    font-size: 10px;
    opacity: 0.9;
    font-weight: 500;
}

@media (max-width: 480px) {
    .activity-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .activity-image {
        width: 70px;
        height: 70px;
        margin-bottom: 8px;
    }

    .activity-info {
        align-items: center;
    }
}

/* Улучшение мобильного отображения музыкального плеера */
@media (max-width: 640px) {
    .audio-player {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .control-btn {
        margin: 0 auto;
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
    
    .progress-wrapper {
        width: 100%;
        margin: 5px auto;
    }
    
    .progress-bar {
        height: 12px;
    }
    
    .progress-bar::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    .volume-wrapper {
        margin: 0 auto;
        width: 100%;
        justify-content: center;
    }
    
    .volume-control {
        width: 80%;
        height: 10px;
    }
    
    .volume-control::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    
    .time-display {
        font-size: 1rem;
        min-width: 50px;
    }
}

/* Spotify активность */
.spotify-activity {
    background: rgba(30, 215, 96, 0.1);
    border-left: 2px solid rgba(30, 215, 96, 0.6);
}

.spotify-activity .activity-name {
    color: #1ED760;
}

.spotify-activity .activity-details {
    font-weight: 600;
}

/* Стили для кнопки Проекты */
button.skill {
    border: none;
    font-family: 'Montserrat', sans-serif;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

button.skill:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.4);
}

button.skill:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
