/* Custom Styles for Mobule */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animation Classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Section Spacing */
section {
    scroll-margin-top: 80px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Form Validation Styles */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s ease;
}

#backToTop.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Portfolio Item Overlay */
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* Testimonial Cards */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Service Cards */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
}

/* Mobile Menu Animation */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    display: block;
}

#mobileMenu.active {
    max-height: 500px;
}

/* Скрываем меню на десктопе */
@media (min-width: 768px) {
    #mobileMenu {
        display: none !important;
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 1.875rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Улучшаем отступы на мобильных */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Предотвращаем обрезание текста */
    p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Улучшаем кнопки на мобильных */
    button, a[class*="px-"] {
        padding-left: 1rem;
        padding-right: 1rem;
        word-wrap: break-word;
    }
}

/* Image Lazy Loading */
img {
    transition: opacity 0.3s;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    nav,
    footer,
    #backToTop {
        display: none;
    }
}

