/* ========================================
   RUNFALSE Personal Portfolio v2.0
   Modern Dark Theme with Animations
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary-black: #0a0a0a;
    --primary-white: #ffffff;
    --gray-light: #f5f5f5;
    --gray-medium: #888888;
    --gray-dark: #333333;
    --accent: #ffffff;
    --accent-hover: #cccccc;
    --accent-glow: rgba(255, 255, 255, 0.3);
    --accent-dark: #888888;
    
    /* Backgrounds */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(255, 255, 255, 0.2);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 15px 50px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--primary-black);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--bg-secondary) 50%, var(--primary-black) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.preloader:hover {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--bg-secondary) 50%, var(--primary-black) 100%);
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    animation: preloaderGlow 2s ease-in-out infinite;
}

.preloader-logo {
    margin-bottom: 2rem;
}

.preloader-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-white);
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 40px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(255, 255, 255, 0.1);
    animation: letterGlow 2s ease-in-out infinite;
}

.preloader-subtitle {
    font-size: 1.2rem;
    color: var(--gray-medium);
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 2px;
    opacity: 0.8;
}

.preloader-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 2rem auto;
    overflow: hidden;
}

.preloader-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-white), var(--gray-medium), var(--primary-white));
    border-radius: 2px;
    width: 0%;
}

.preloader-status {
    font-size: 0.9rem;
    color: var(--gray-medium);
    font-family: 'Roboto Mono', monospace;
    margin-top: 1rem;
    opacity: 0.8;
    transition: var(--transition);
    text-align: center;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.preloader:hover .preloader-status {
    opacity: 1;
    color: var(--primary-white);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

/* Видеофон */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.3) contrast(1.2) grayscale(100%);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

/* Основной контент */
.main-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.profile-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    width: 100%;
    backdrop-filter: none;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.profile-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.8s ease;
}

.profile-section:hover::before {
    left: 100%;
}

.profile-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--border-accent);
}

.profile-container {
    position: relative;
    z-index: 2;
}

/* Аватар */
.avatar-container {
    margin-bottom: 2rem;
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--primary-white);
    transition: var(--transition);
    cursor: pointer;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    border-radius: 50%;
}

.avatar:hover .avatar-overlay {
    opacity: 1;
}

.avatar-status {
    color: var(--primary-white);
    font-weight: 600;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
}

/* Информация профиля */
.profile-info h1.name {
    font-family: 'Roboto Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    animation: nameGlow 4s ease-in-out infinite, fadeInUp 1s ease-out 0.5s both;
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.3),
        0 0 10px rgba(255, 255, 255, 0.2),
        0 0 15px rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.profile-info h1.name:hover {
    transform: scale(1.05);
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 255, 255, 0.6),
        0 0 60px rgba(255, 255, 255, 0.4);
    animation-play-state: paused;
}

.profile-info h1.name::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.profile-info h1.name .letter {
    display: inline-block;
    animation: letterBounce 2s ease-in-out infinite;
    transition: var(--transition);
}

.profile-info h1.name .letter:hover {
    transform: translateY(-5px) scale(1.1);
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.8),
        0 0 25px rgba(255, 255, 255, 0.6),
        0 0 35px rgba(255, 255, 255, 0.4);
}

@keyframes letterBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(1.05);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-info .status {
    font-size: 1.2rem;
    color: var(--gray-medium);
    margin-bottom: 0.5rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1s forwards;
    transition: var(--transition);
    cursor: pointer;
}

.profile-info .status:hover {
    color: var(--primary-white);
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.profile-info .location {
    font-size: 1rem;
    color: var(--gray-medium);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
    transition: var(--transition);
    cursor: pointer;
}

.profile-info .location:hover {
    color: var(--primary-white);
    transform: translateX(5px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.profile-info .quote {
    font-size: 1rem;
    color: var(--gray-medium);
    font-style: italic;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.3s forwards;
    position: relative;
    padding: 0 2rem;
    transition: var(--transition);
    cursor: pointer;
}

.profile-info .quote:hover {
    color: var(--primary-white);
    transform: scale(1.02);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.profile-info .quote::before,
.profile-info .quote::after {
    content: '"';
    font-size: 1.5rem;
    color: var(--primary-white);
    position: absolute;
    top: -5px;
}

.profile-info .quote::before {
    left: 0;
}

.profile-info .quote::after {
    right: 0;
}

/* Управление музыкой */
.music-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 15px;
    transition: var(--transition);
}

.music-controls:hover {
    background: var(--bg-secondary);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.music-toggle {
    display: flex;
    align-items: center;
}

.music-toggle-btn {
    background: transparent;
    border: 2px solid var(--primary-white);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary-white);
}

.music-toggle-btn:hover {
    background: var(--primary-white);
    color: var(--primary-black);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.music-toggle-btn.muted {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff4444;
    color: #ff4444;
}

.music-toggle-btn.muted:hover {
    background: #ff4444;
    color: var(--primary-white);
}

.music-icon {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.music-toggle-btn:hover .music-icon {
    transform: scale(1.1);
}

/* Регулятор звука в профиле */
.volume-control-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.volume-icon-profile {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: var(--transition);
}

.volume-slider-container-profile {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider-profile {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.volume-slider-profile::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-white);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.volume-slider-profile::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.volume-slider-profile::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-white);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.volume-value-profile {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Roboto Mono', monospace;
    min-width: 35px;
    text-align: right;
}

/* Социальные ссылки */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.4s forwards;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid var(--primary-white);
    border-radius: 50%;
    color: var(--primary-white);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: socialLinkAppear 0.6s ease-out forwards;
    opacity: 0;
    transform: scale(0);
}

.social-link:hover {
    transform: scale(1.2) translateY(-5px);
    background: var(--primary-white);
    color: var(--primary-black);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.3);
}

.social-link:nth-child(1) { animation-delay: 1.6s; }
.social-link:nth-child(2) { animation-delay: 1.8s; }
.social-link:nth-child(3) { animation-delay: 2.0s; }
.social-link:nth-child(4) { animation-delay: 2.2s; }

.social-link svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
    fill: currentColor;
}

.social-link:hover svg {
    transform: scale(1.1);
}

/* Специальные стили для разных социальных сетей - только подсветка */
.social-link.github:hover {
    border-color: #333;
    box-shadow: 0 8px 16px rgba(51, 51, 51, 0.4);
}

.social-link.telegram:hover {
    border-color: #0088cc;
    box-shadow: 0 8px 16px rgba(0, 136, 204, 0.4);
}

.social-link.discord:hover {
    border-color: #5865f2;
    box-shadow: 0 8px 16px rgba(88, 101, 242, 0.4);
}

/* Убраны дополнительные эффекты псевдоэлементов для стабильного отображения */

/* Пульсация для активных иконок */
.social-link:active {
    transform: scale(0.95);
}

/* Улучшенная анимация появления */
@keyframes socialIconBounce {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2) rotate(90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.social-link {
    animation: socialIconBounce 0.8s ease-out forwards;
}

/* Улучшенная доступность */
.social-link:focus {
    outline: 2px solid var(--primary-white);
    outline-offset: 2px;
}

.social-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Дополнительные эффекты при наведении */
.social-link:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 16px rgba(255, 255, 255, 0.2);
}

/* Эффект свечения для активных иконок */
.social-link:active {
    transform: scale(0.95);
    box-shadow: 0 5px 10px rgba(255, 255, 255, 0.2);
}

/* Убрана анимация пульсации для более стабильного отображения */

/* Уведомления */
#notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    box-shadow: var(--shadow-medium);
    backdrop-filter: none;
    transform: translateX(100%);
    transition: var(--transition);
    pointer-events: auto;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.notification.error {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.notification.info {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

/* Анимации */
@keyframes preloaderGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes nameGlow {
    0% {
        text-shadow: 
            0 0 5px rgba(255, 255, 255, 0.3),
            0 0 10px rgba(255, 255, 255, 0.2),
            0 0 15px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    25% {
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 0.6),
            0 0 25px rgba(255, 255, 255, 0.4),
            0 0 35px rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
    50% {
        text-shadow: 
            0 0 25px rgba(255, 255, 255, 0.9),
            0 0 40px rgba(255, 255, 255, 0.7),
            0 0 55px rgba(255, 255, 255, 0.5),
            0 0 70px rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }
    75% {
        text-shadow: 
            0 0 15px rgba(255, 255, 255, 0.6),
            0 0 25px rgba(255, 255, 255, 0.4),
            0 0 35px rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
    100% {
        text-shadow: 
            0 0 5px rgba(255, 255, 255, 0.3),
            0 0 10px rgba(255, 255, 255, 0.2),
            0 0 15px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
}

@keyframes letterGlow {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.5),
            0 0 40px rgba(255, 255, 255, 0.3),
            0 0 60px rgba(255, 255, 255, 0.1);
    }
    50% {
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 0.8),
            0 0 60px rgba(255, 255, 255, 0.6),
            0 0 90px rgba(255, 255, 255, 0.4);
    }
}

@keyframes progressLoad {
    0% {
        width: 0%;
        transform: translateX(-100%);
    }
    50% {
        width: 100%;
        transform: translateX(0%);
    }
    100% {
        width: 0%;
        transform: translateX(100%);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes socialLinkAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .profile-section {
        padding: 2rem;
    }
    
    .profile-info h1.name {
        font-size: 2rem;
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    .preloader-title {
        font-size: 2rem;
    }
    
    .preloader-progress {
        width: 250px;
    }
    
    .social-links {
        gap: 1rem;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
    
    .social-link svg {
        width: 20px;
        height: 20px;
    }
    
    .music-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .volume-control-profile {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-info h1.name {
        font-size: 1.8rem;
    }
    
    .preloader-title {
        font-size: 1.5rem;
    }
    
    .preloader-progress {
        width: 200px;
    }
    
    .profile-section {
        padding: 1.5rem;
    }
    
    .social-links {
        gap: 0.8rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
    }
    
    .social-link svg {
        width: 20px;
        height: 20px;
    }
}

/* Дополнительные эффекты */
.profile-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Улучшенные hover эффекты */
.music-controls:hover .volume-icon-profile {
    color: var(--accent);
    transform: scale(1.1);
}

.volume-slider-profile:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Плавные переходы для всех интерактивных элементов */
* {
    transition: var(--transition);
}

/* Улучшенная типографика */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

p {
    line-height: 1.6;
}

/* Скрытие скроллбара для webkit браузеров */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-white);
}