@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Green Nature Color Scheme */
    --primary-color: #22c55e;
    --primary-dark: #16a34a;
    --primary-light: #86efac;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #6ee7b7;
    --accent-color: #84cc16;
    --accent-dark: #65a30d;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #06b6d4;
    
    /* Glassmorphism backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: rgba(248, 250, 252, 0.8);
    --bg-tertiary: rgba(241, 245, 249, 0.6);
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.25);
    --bg-card: rgba(255, 255, 255, 0.8);
    
    /* Advanced text colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    --text-accent: #6366f1;
    
    /* Modern borders and shadows */
    --border-color: rgba(203, 213, 225, 0.4);
    --border-light: rgba(241, 245, 249, 0.6);
    --border-glass: rgba(255, 255, 255, 0.3);
    
    /* Enhanced shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-glow: 0 0 25px rgb(34 197 94 / 0.4);
    --shadow-colored: 0 10px 25px -5px rgb(16 185 129 / 0.4);
    --shadow-green-glow: 0 0 30px rgb(34 197 94 / 0.6);
    
    /* Green Nature Gradients */
    --gradient-primary: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    --gradient-secondary: linear-gradient(135deg, #16a34a 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
    --gradient-nature: linear-gradient(135deg, #22c55e 0%, #84cc16 50%, #10b981 100%);
    --gradient-forest: linear-gradient(135deg, #059669 0%, #047857 50%, #065f46 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    
    /* Animation variables */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-back: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-fast: 0.15s var(--ease-out-quart);
    --transition-normal: 0.3s var(--ease-out-quart);
    --transition-slow: 0.5s var(--ease-out-quart);
}

/* Revolutionary Dark Theme */
body.dark-theme {
    --bg-primary: #0f0f23;
    --bg-secondary: rgba(15, 15, 35, 0.8);
    --bg-tertiary: rgba(30, 30, 50, 0.6);
    --bg-elevated: rgba(20, 20, 40, 0.9);
    --bg-glass: rgba(20, 20, 40, 0.3);
    --bg-card: rgba(30, 30, 50, 0.8);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #0f0f23;
    --text-accent: #a5b4fc;
    
    --border-color: rgba(71, 85, 105, 0.4);
    --border-light: rgba(100, 116, 139, 0.3);
    --border-glass: rgba(255, 255, 255, 0.1);
    
    --shadow-glow: 0 0 35px rgb(34 197 94 / 0.6);
    --shadow-colored: 0 10px 25px -5px rgb(16 185 129 / 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: 
        radial-gradient(circle at 20% 50%, rgba(34, 197, 94, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(132, 204, 22, 0.1) 0%, transparent 50%),
        var(--bg-primary);
    background-attachment: fixed;
    transition: all var(--transition-slow);
    overflow-x: hidden;
    position: relative;
    animation: backgroundShift 15s ease-in-out infinite;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(0,0,0,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

/* Revolutionary Navigation with Hide on Scroll */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-glass);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    transform: translateY(0);
}

nav.nav-hidden {
    transform: translateY(-100%);
}

nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-glass);
    pointer-events: none;
}

body.dark-theme nav {
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-glass);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo-icon {
    font-size: 2rem;
    filter: none;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #22c55e;
    animation: logoSpin 4s ease-in-out infinite;
}

/* Fixed Theme Toggle */
.theme-toggle-fixed {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 60px;
    height: 30px;
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 5px;
    transition: all var(--transition-normal);
    border: 2px solid var(--border-glass);
    z-index: 10000;
    box-shadow: var(--shadow-lg);
}

.theme-toggle-fixed:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Old theme toggle (hidden) */
.theme-toggle {
    display: none;
}

.theme-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 12px;
    color: var(--text-tertiary);
}

.toggle-switch {
    position: absolute;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
}

body.dark-theme .toggle-switch {
    transform: translateX(30px);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.nav-link i {
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left var(--transition-normal);
    z-index: -1;
    border-radius: 16px;
}

.nav-link:hover {
    color: var(--text-inverse);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background: rgba(255, 255, 255, 0.1);
    animation: none !important; /* Отключаем анимации входа при hover */
}

.nav-link:hover::before {
    left: 0;
}

.nav-link:hover i {
    transform: scale(1.2);
}

/* Предотвращаем конфликт с анимациями входа */
.nav-link.animated {
    animation-fill-mode: forwards;
}

.nav-link.animated:hover {
    animation: none !important;
}

.nav-link-special {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border: 2px solid var(--border-glass);
    box-shadow: var(--shadow-md);
}

.nav-link-special:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Revolutionary Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 12px;
    border-radius: 16px;
    transition: all var(--transition-normal);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    position: relative;
    z-index: 1001;
}

.hamburger:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: all var(--transition-normal);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.hamburger.active {
    background: var(--gradient-primary);
}

.hamburger.active span {
    background: white;
}

/* Main Content */
main {
    margin-top: 100px;
    min-height: calc(100vh - 100px);
    padding-top: 2rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 4rem 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-inverse);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Revolutionary Cards with Glassmorphism */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-glass);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl), var(--shadow-glow);
    border-color: var(--primary-light);
}

.card:hover::before {
    opacity: 1;
}

/* Glass Effect Card */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(30px) saturate(200%);
    border: 2px solid var(--border-glass);
    border-radius: 32px;
    padding: 3rem;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mobile-menu-overlay,
.mobile-menu-content {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        position: relative;
    }
    
    .hamburger {
        display: flex !important;
        z-index: 1002;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        z-index: 1001;
        pointer-events: none;
        display: block;
    }
    
    .nav-links.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    .mobile-menu-overlay {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        z-index: 1;
    }

    .mobile-menu-content {
        display: flex;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80%;
        max-width: 400px;
        background: var(--bg-card);
        backdrop-filter: blur(30px) saturate(200%);
        border-left: 1px solid var(--border-glass);
        flex-direction: column;
        gap: 1rem;
        padding: 6rem 2rem 2rem;
        justify-content: flex-start;
        align-items: center;
        z-index: 2;
        box-shadow: var(--shadow-2xl);
    }
    
    .nav-link {
        width: 100%;
        max-width: 300px;
        text-align: center;
        padding: 1.5rem 2rem;
        border-radius: 20px;
        background: var(--bg-glass);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border-glass);
        font-size: 1.1rem;
        animation: slideInFromRight 0.3s ease-out forwards;
    }
    
    .mobile-menu-content .nav-link:nth-child(1) { animation-delay: 0.1s; }
    .mobile-menu-content .nav-link:nth-child(2) { animation-delay: 0.2s; }
    .mobile-menu-content .nav-link:nth-child(3) { animation-delay: 0.3s; }
    .mobile-menu-content .nav-link:nth-child(4) { animation-delay: 0.4s; }
    .mobile-menu-content .nav-link:nth-child(5) { animation-delay: 0.5s; }
    .mobile-menu-content .nav-link:nth-child(6) { animation-delay: 0.6s; }
    .mobile-menu-content .nav-link:nth-child(7) { animation-delay: 0.7s; }
    
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-container {
        height: 70px;
    }
    
    main {
        margin-top: 90px;
    }
}

/* Amazing Green Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(10deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.1) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInStagger {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes backgroundShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes logoSpin {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(10deg);
    }
    75% {
        transform: rotate(-10deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -7px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.8), 0 0 30px rgba(34, 197, 94, 0.4);
    }
}

/* КРИТИЧЕСКАЯ ЗАЩИТА - мобильное меню СКРЫТО пока не активно */
.mobile-menu:not(.active) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.mobile-menu:not(.active) .mobile-menu-overlay,
.mobile-menu:not(.active) .mobile-menu-content {
    display: none !important;
    visibility: hidden !important;
}

/* Enhanced Entrance Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slideInFromLeft {
    animation: slideInFromLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-zoomIn {
    animation: zoomIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-wave {
    animation: wave 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.shimmer-effect {
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Staggered Entrance Animation */
.animate-stagger {
    animation: slideInStagger 0.6s ease-out forwards;
}

.animate-stagger:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger:nth-child(5) { animation-delay: 0.5s; }

/* Initial hidden state for entrance animations */
.animate-fadeInUp,
.animate-fadeInDown,
.animate-slideInFromLeft,
.animate-zoomIn,
.animate-bounceIn,
.animate-stagger {
    opacity: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Focus Styles */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
