/**
 * @file: main.css
 * @description: Основные стили для компонентов и анимаций
 * @dependencies: TailwindCSS
 * @created: 2025-01-12
 */

/* Spinner Animation */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Transitions */
.transition-colors {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.transition-shadow {
    transition: box-shadow 0.15s ease-in-out;
}

.transition-transform {
    transition: transform 0.15s ease-in-out;
}

/* Focus Styles */
.focus-ring {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Card Hover Effects */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button Hover Effects */
.btn-hover:hover {
    transform: translateY(-1px);
}

/* Gradient Backgrounds */
.gradient-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.gradient-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading States */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-dots div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #3b82f6;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading-dots3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading-dots2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

/* Responsive Design Helpers */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container-custom {
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .container-custom {
        padding: 0 3rem;
    }
}

/* Form Styles */
.form-input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #374151;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Tool Result Styles */
.result-success {
    background-color: #f0fdf4;
    border-left: 4px solid #22c55e;
    color: #166534;
}

.result-warning {
    background-color: #fefce8;
    border-left: 4px solid #eab308;
    color: #854d0e;
}

.result-error {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.result-info {
    background-color: #f0f9ff;
    border-left: 4px solid #3b82f6;
    color: #1d4ed8;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
}

/* Dark Mode Support (if needed later) */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode-auto .form-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .dark-mode-auto .form-input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }
}

/* 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-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #3b82f6;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
} 

/* Удален неоновый стиль кнопок btn-neon */ 

/* Удалены стили progress-кнопки (.btn, .btn__text, .btn__progress и т.д.) */ 

/* --- Hover-эффект для всех кнопок (стиль сайта + бирюзовый ховер, фикс артефакта) --- */
button, a.button-like, a[class*="btn"], .btn {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  z-index: 1;
  border: 3px solid #2563eb;
  color: #2563eb;
  background: transparent;
}
button span.first,
button span.second,
button span.third,
button span.fourth,
a.button-like span.first,
a.button-like span.second,
a.button-like span.third,
a.button-like span.fourth,
a[class*="btn"] span.first,
a[class*="btn"] span.second,
a[class*="btn"] span.third,
a[class*="btn"] span.fourth,
.btn span.first,
.btn span.second,
.btn span.third,
.btn span.fourth {
  position: absolute;
  transition: all 0.7s;
  z-index: -1;
  background: #2563eb;
  width: 26%;
  border: none;
}
button span.first,
a.button-like span.first,
a[class*="btn"] span.first,
.btn span.first {
  right: 100%;
  top: 0;
  height: 100%;
}
button:hover span.first,
a.button-like:hover span.first,
a[class*="btn"]:hover span.first,
.btn:hover span.first {
  right: 0;
  top: 0;
  background: #2563eb;
}
button span.second,
a.button-like span.second,
a[class*="btn"] span.second,
.btn span.second {
  left: 24.5%;
  top: -100%;
  height: 100%;
}
button:hover span.second,
a.button-like:hover span.second,
a[class*="btn"]:hover span.second,
.btn:hover span.second {
  left: 49.5%;
  top: 0;
  background: #2563eb;
}
button span.third,
a.button-like span.third,
a[class*="btn"] span.third,
.btn span.third {
  left: 49.5%;
  top: 100%;
  height: 100%;
}
button:hover span.third,
a.button-like:hover span.third,
a[class*="btn"]:hover span.third,
.btn:hover span.third {
  left: 24.5%;
  top: 0;
  background: #2563eb;
}
button span.fourth,
a.button-like span.fourth,
a[class*="btn"] span.fourth,
.btn span.fourth {
  left: 100%;
  top: 0;
  height: 100%;
}
button:hover span.fourth,
a.button-like:hover span.fourth,
a[class*="btn"]:hover span.fourth,
.btn:hover span.fourth {
  left: 0;
  top: 0;
  background: #2563eb;
}
button:hover, a.button-like:hover, a[class*="btn"]:hover, .btn:hover {
  color: #fff !important;
  background: #2563eb;
  border-color: #2563eb;
  transition: color 0.7s, background 0.7s, border-color 0.7s;
}
/* Корректировка размера текста и радиуса для совместимости */
button, a.button-like, a[class*="btn"], .btn {
  font-size: 1.125rem;
  border-radius: 0.75rem;
} 

/* --- Современный дизайн карточек инструментов --- */
.tool-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 1.1rem;
  padding: 2rem;
  transition: box-shadow 0.35s cubic-bezier(.4,2,.6,1), border 0.3s, background 0.3s, transform 0.35s cubic-bezier(.4,2,.6,1);
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.04);
  position: relative;
  z-index: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tool-card:hover {
  border: 1.5px solid #3b82f6;
  background: #f4f8ff;
  box-shadow: 0 8px 32px 0 rgba(37,99,235,0.18), 0 0 16px 2px #3b82f633;
  transform: scale(1.045) translateY(-6px) rotateZ(-1deg);
}
.tool-card:hover svg {
  animation: icon-bounce 0.7s cubic-bezier(.4,2,.6,1);
  filter: drop-shadow(0 0 8px #3b82f6aa);
}
@keyframes icon-bounce {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-8px) scale(1.08); }
  60% { transform: translateY(2px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}
.tool-card > * {
  position: relative;
  z-index: 3;
}
.tool-card:after {
  display: none !important;
} 

/* --- Сетка инструментов: одинаковая высота карточек --- */
.tools-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

/* Для совместимости с flex-контейнерами (если где-то используется flex вместо grid) */
.tools-list-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: stretch;
}
.tools-list-flex > .tool-card {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
}

/* Уточнение для .tool-card */
.tool-card {
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
} 

/* --- Glassmorphism Header --- */
.header-glass {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.10);
    border: 1px solid rgba(255,255,255,0.18);
    transition: background 0.3s, box-shadow 0.3s;
}
@media (prefers-color-scheme: dark) {
  .header-glass {
    background: rgba(24, 24, 32, 0.7);
    border: 1px solid rgba(40,40,60,0.18);
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.25);
  }
}

/* --- Анимация появления меню (desktop) --- */
.nav-animate {
  animation: navFadeIn 0.7s cubic-bezier(0.4,0,0.2,1);
}
@keyframes navFadeIn {
  0% { opacity: 0; transform: translateY(-16px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Анимация мобильного меню --- */
.nav-animate-mobile {
  animation: mobileMenuIn 0.5s cubic-bezier(0.4,0,0.2,1);
}
@keyframes mobileMenuIn {
  0% { opacity: 0; transform: translateY(-32px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Для Alpine.js x-transition */
.mobile-menu-enter { transition: all 0.5s cubic-bezier(0.4,0,0.2,1); opacity: 0; transform: translateY(-32px) scale(0.98); }
.mobile-menu-enter-active { opacity: 1; transform: translateY(0) scale(1); }
.mobile-menu-leave { transition: all 0.4s cubic-bezier(0.4,0,0.2,1); opacity: 1; transform: translateY(0) scale(1); }
.mobile-menu-leave-active { opacity: 0; transform: translateY(-32px) scale(0.98); }

/* --- Hover/active эффекты для ссылок --- */
.menu-link {
  position: relative;
  overflow: hidden;
}
.menu-link::after {
  content: '';
  display: block;
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0.2em;
  height: 2px;
  background: linear-gradient(90deg,#2563eb 0%,#60a5fa 100%);
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0.7);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  z-index: 1;
}
.menu-link:hover::after, .menu-link:focus::after, .menu-link.active::after {
  opacity: 1;
  transform: scaleX(1);
}
.menu-link:hover, .menu-link:focus {
  transform: scale(1.06);
  z-index: 2;
}
.menu-link.active {
  font-weight: 700;
  color: #2563eb;
}

@media (prefers-color-scheme: dark) {
  .menu-link::after {
    background: linear-gradient(90deg,#60a5fa 0%,#2563eb 100%);
  }
}

/* --- Sticky header с тенью при скролле --- */
#main-nav {
  background: transparent;
  box-shadow: none;
}
#main-nav.sticky-shadow {
  box-shadow: 0 4px 24px 0 rgba(31,38,135,0.10), 0 1.5px 0 0 rgba(59,130,246,0.04);
  background: rgba(255,255,255,0.85);
  transition: box-shadow 0.3s, background 0.3s;
}
@media (prefers-color-scheme: dark) {
  #main-nav.sticky-shadow {
    background: rgba(24,24,32,0.85);
    box-shadow: 0 4px 24px 0 rgba(0,0,0,0.18);
  }
}

/* --- Кнопки меню (обновлено) --- */
.menu-btn {
    background: #2563eb;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    box-shadow: 0 2px 8px 0 rgba(59,130,246,0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    padding: 0.5rem 1.2rem;
    display: inline-block;
}
.menu-btn:hover, .menu-btn:focus {
    background: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 16px 0 rgba(59,130,246,0.15);
    transform: scale(1.06);
    outline: none;
}
.menu-btn-red {
    background: #dc2626;
    color: #fff;
    border-radius: 0.5rem;
    font-weight: 600;
    box-shadow: 0 2px 8px 0 rgba(220,38,38,0.10);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    padding: 0.5rem 1.2rem;
    display: inline-block;
}
.menu-btn-red:hover, .menu-btn-red:focus {
    background: #b91c1c;
    color: #fff;
    box-shadow: 0 4px 16px 0 rgba(220,38,38,0.18);
    transform: scale(1.06);
    outline: none;
}

/* Mobile menu overlay */
.mobile-menu-glass {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.10);
    transition: background 0.3s, box-shadow 0.3s;
}
@media (prefers-color-scheme: dark) {
  .mobile-menu-glass {
    background: rgba(24, 24, 32, 0.85);
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.25);
  }
} 

/* Glow effect for logo and menu */
.shadow-blue-glow {
  box-shadow: 0 0 0 4px #2563eb33, 0 2px 8px 0 #2563eb22;
}
.menu-link:hover, .menu-link:focus {
  box-shadow: 0 0 0 3px #2563eb33, 0 2px 8px 0 #2563eb22;
  transform: scale(1.09);
}
.header-glass {
  transition: background 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.header-glass:hover {
  opacity: 0.98;
  box-shadow: 0 8px 40px 0 #2563eb22;
}
.menu-link, .menu-btn, .menu-btn-red {
  cursor: pointer;
} 