/* Дополнительные кастомные стили для MFO лендинг портфолио */

/* Параллакс эффекты */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Отступ для фиксированной шапки на всех устройствах */
#hero {
    padding-top: 80px;
    margin-top: -80px;
}

section[id] {
    scroll-margin-top: 80px;
}

/* Градиенты и эффекты */
.gradient-overlay {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(59, 130, 246, 0.9) 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Анимации */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.float {
    animation: float 6s ease-in-out infinite;
}

/* Hover эффекты */
.hover-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-scale:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
}

/* Кастомные стили для карусели */
.swiper-pagination-bullet {
    background: #10b981;
}

.swiper-button-next,
.swiper-button-prev {
    color: #10b981;
}

/* Фоновые узоры */
.bg-pattern {
    background-image: 
        radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.05) 2%, transparent 0%),
        radial-gradient(circle at 75px 75px, rgba(255, 255, 255, 0.05) 2%, transparent 0%);
    background-size: 100px 100px;
}

/* Стили для карточек проектов */
.project-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Эффект печатной машинки */
.typewriter {
    overflow: hidden;
    white-space: normal;
    animation: typing 3.5s steps(40, end);
}

@keyframes typing {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивная типографика */
@media (max-width: 640px) {
    .typewriter {
        white-space: normal;
        line-height: 1.2;
    }
}

/* Улучшенная адаптивность для мобильных */
@media (max-width: 480px) {
    .text-4xl {
        font-size: 2rem !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }
}

/* Мобильное меню */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding-top: 80px;
}

.mobile-menu.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.mobile-menu a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1rem 2rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 80%;
    text-align: center;
}

.mobile-menu a:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.menu-toggle {
    transition: transform 0.3s ease;
}

.menu-toggle.active {
    transform: rotate(90deg);
}

/* Предотвращение скролла при открытом меню */
body.menu-open {
    overflow: hidden;
}

/* Улучшения для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .hover-scale:hover {
        transform: none;
        box-shadow: none;
    }
    
    .hover-scale:active {
        transform: scale(0.95);
    }
}

/* Предотвращение случайного зума и масштабирования */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

html, body {
    touch-action: pan-y;
    -webkit-text-size-adjust: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    overscroll-behavior: none;
}

input, textarea, select {
    font-size: 16px !important;
    touch-action: manipulation;
    user-select: text;
    -webkit-user-select: text;
}

nav, header {
    touch-action: none !important;
    pointer-events: none;
}

nav *, header * {
    pointer-events: auto;
}

/* Фиксация высоты viewport на мобильных */
@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
}

/* Кастомные CSS переменные для темы МФО */
:root {
    --primary-green: #10b981;
    --primary-blue: #3b82f6;
    --dark-bg: #111827;
    --darker-bg: #030712;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
}

/* Улучшенные градиенты для МФО тематики */
.mfo-gradient {
    background: linear-gradient(135deg, 
        var(--primary-green) 0%, 
        var(--primary-blue) 50%, 
        #8b5cf6 100%);
}

.mfo-text-gradient {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Анимированные кнопки с эффектами для МФО */
.mfo-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(45deg, var(--primary-green), var(--primary-blue));
    transition: all 0.3s ease;
}

.mfo-button::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: left 0.5s;
}

.mfo-button:hover::before {
    left: 100%;
}

/* Карточки проектов с улучшенным дизайном */
.project-card-enhanced {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.project-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(16, 185, 129, 0.1) 0%, 
        rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card-enhanced:hover::before {
    opacity: 1;
}

.project-card-enhanced:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(16, 185, 129, 0.2),
        0 0 60px rgba(59, 130, 246, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Секция статистики с анимированными счетчиками */
.stats-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.stats-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.stats-card:hover::after {
    transform: scaleX(1);
}

/* Навыки и технологии */
.skill-tag {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary-green);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-green);
    transition: left 0.3s ease;
    z-index: -1;
}

.skill-tag:hover {
    color: white;
    border-color: var(--primary-green);
}

.skill-tag:hover::before {
    left: 0;
}

/* Улучшенная типографика для МФО контента */
.mfo-heading {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.mfo-subheading {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-secondary);
}

.mfo-body {
    line-height: 1.7;
    color: var(--text-muted);
}

/* Кастомные скроллбары */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-green), var(--primary-blue));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--primary-blue), var(--primary-green));
}

/* Форма обратной связи с улучшенными стилями */
.contact-form-field {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.contact-form-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
}

/* Социальные иконки с улучшенными эффектами */
.social-icon {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.social-icon:hover::before {
    width: 100%;
    height: 100%;
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Мобильные улучшения */
@media (max-width: 768px) {
    .project-card-enhanced:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .mfo-heading {
        font-size: clamp(2rem, 8vw, 4rem);
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    .float{
        margin-top: 69px;
        animation: none;
    }
    h1 {
        transform: none !important;
        animation: none !important;
    }
}

/* Печатная машинка эффект улучшенный */
@keyframes typewriter {
    from {
        width: 0;
        border-right: 2px solid var(--primary-green);
    }
    to {
        width: 100%;
        border-right: 2px solid transparent;
    }
}

.enhanced-typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 4s steps(40, end) forwards;
}

/* Пульсирующий эффект для важных элементов */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Эффект появления элементов */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Улучшенный parallax эффект */
.parallax-enhanced {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.parallax-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.parallax-enhanced > * {
    position: relative;
    z-index: 2;
}

/* Кастомный курсор для интерактивных элементов */
.interactive-cursor {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-cursor:hover {
    cursor: grab;
}

.interactive-cursor:active {
    cursor: grabbing;
}

/* Загрузочная анимация */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(16, 185, 129, 0.1);
    border-top: 3px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Улучшения для accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus стили для лучшей доступности */
.focus-outline:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Smooth transitions для всех интерактивных элементов */
button, a, input, textarea, select {
    transition: all 0.3s ease;
}

/* Медиа запросы для больших экранов */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

/* Темная тема улучшения */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(255, 255, 255, 0.02);
        --border-color: rgba(255, 255, 255, 0.05);
    }
}
