/* ========================
   Минимальный Custom CSS для Tailwind
   Только анимации и специфичные эффекты
   ======================== */

/* Кастомные анимации - УСКОРЕНЫ */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes dash {
    to {
        stroke-dashoffset: -20;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(-45deg);
    }
    40% {
        transform: translateY(-8px) rotate(-45deg);
    }
    60% {
        transform: translateY(-4px) rotate(-45deg);
    }
}

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

/* Применение анимаций - БЫСТРЕЕ */
.animate-float {
    animation: float 4s ease-in-out infinite;
    will-change: transform;
}

.animate-dash {
    animation: dash 0.8s linear infinite;
    will-change: stroke-dashoffset;
}

/* Быстрая загрузка страницы */
body {
    animation: fadeIn 0.3s ease forwards;
}

/* Эффект свечения */
.drop-shadow-glow {
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.3));
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Градиент для текста */
.bg-gradient-radial {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 60%);
}

/* Активная ссылка в навигации */
.nav-link.active {
    color: #10b981;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #10b981;
    transition: width 0.2s ease;
    will-change: width;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Мобильное меню - активное состояние */
#navToggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

#navToggle.active span:nth-child(2) {
    opacity: 0;
}

#navToggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Десктопное меню */
@media (min-width: 1024px) {
    #navMenu {
        position: static;
        flex-direction: row;
        height: auto;
        background: transparent;
        padding: 0;
        gap: 2.5rem;
    }
}

/* Мобильное меню */
@media (max-width: 1023px) {
    #navMenu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 3rem 2rem;
        gap: 2rem;
        transition: left 0.25s ease;
        will-change: left;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 999;
        overflow-y: auto;
    }
    
    #navMenu.active {
        left: 0;
    }
    
    /* Мобильные ссылки - больше размер для удобства нажатия */
    #navMenu .nav-link {
        font-size: 1.25rem;
        padding: 0.75rem 0;
        width: 100%;
        color: #e5e5e5;
    }
    
    #navMenu .nav-link::after {
        display: none;
    }
    
    #navMenu .nav-link:hover,
    #navMenu .nav-link.active {
        color: #10b981;
        padding-left: 1rem;
        transition: all 0.2s ease;
    }
    
    #navMenu li {
        width: 100%;
    }
}

/* Hover эффект для иконок - БЫСТРЕЕ */
.service-card:hover .w-16 {
    transform: scale(1.1) rotateY(360deg);
    color: #2dd4a4;
    transition: transform 0.4s ease, color 0.2s ease;
}

/* Hover эффект для изображений - БЫСТРЕЕ */
.case-card:hover svg {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Анимация иконок - БЫСТРЕЕ */
.tech-item:hover .w-14 {
    transform: rotateY(360deg);
    color: #2dd4a4;
    transition: transform 0.4s ease, color 0.2s ease;
}

/* Fade-in анимация - БЫСТРЕЕ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: transform, opacity;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Плейсхолдер для инпутов */
input::placeholder,
textarea::placeholder {
    color: #707070;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0ea570;
}

/* Быстрое появление hero-scroll */
.hero-scroll {
    transition: opacity 0.2s ease, color 0.2s ease;
    will-change: opacity;
}

/* Вертикальный текст */
.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

@keyframes scroll-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.animate-scroll-line {
    animation: scroll-line 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    will-change: transform;
}

/* Поддержка Safari для text-stroke */
@supports (-webkit-text-stroke: 1px #10b981) {
    .stroke-primary {
        -webkit-text-stroke: 1px #10b981;
    }
}

/* ========================
   Стили калькулятора
   ======================== */

/* Иконки калькулятора */
.appliance-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.appliance-item svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
    transition: all 0.3s ease;
}

.appliance-item:hover svg {
    filter: drop-shadow(0 6px 12px rgba(16,185,129,0.4));
}

.appliance-item:hover {
    transform: translateY(-2px);
}

/* Активное состояние прибора */
.appliance-item[style*="border-color: rgb(16, 185, 129)"] svg,
.appliance-item.bg-primary\/5 svg {
    color: #10b981 !important;
}

/* Счетчик при выборе */
.calc-count {
    transition: all 0.2s ease;
}

/* Кнопки +/- */
.calc-btn-plus:active,
.calc-btn-minus:active {
    transform: scale(0.9);
}

/* Пульсация при добавлении */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.appliance-item:active {
    animation: pulse-green 0.4s ease-out;
}

/* ========================
   Ползунок площади
   ======================== */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #10b981, #0ea570);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #10b981, #0ea570);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Поля ввода метража */
.calc-input-meters {
    -moz-appearance: textfield;
    transition: all 0.2s ease;
}

.calc-input-meters::-webkit-outer-spin-button,
.calc-input-meters::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-input-meters:focus {
    background: #1f1f1f;
    border-color: #10b981;
}

/* Select стили */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select option {
    background: #1a1a1a;
    color: white;
    padding: 0.5rem;
}
