@import "tailwind.css";

/* Общие базовые стили */
body {
    background-color: #020617;
    color: #f8fafc;
    overflow-x: hidden;
}

/* Фон с сеткой */
.bg-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Эффекты карточек (glassmorphism) */
.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.15);
    transform: translateY(-5px);
}

.glass-panel {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* Неоновые кнопки */
.btn-neon {
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
    transition: all 0.3s ease;
}

.btn-neon:hover {
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.6);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Градиентный текст */
.text-glow-gradient {
    background: linear-gradient(to right, #0ea5e9, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

/* Анимации появления (fade-in) */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Стилизация placeholder-ов для инпутов */
input:not(:placeholder-shown):not(:focus),
textarea:not(:placeholder-shown):not(:focus) {
    border-color: rgba(14, 165, 233, 0.5) !important;
    background: rgba(14, 165, 233, 0.05) !important;
}

/* Специфичный стиль для карточки "Компьютерные услуги" */
.terminal-card {
    background: #0f172a;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-left: 4px solid #10b981;
}

/* Стили для summary / details */
details summary::-webkit-details-marker {
    display: none;
}

summary {
    list-style: none;
}

/* Специфичный стиль для карточки электромонтажа */
.glow-electro {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Стили для статей */
.prose-invert {
    --tw-prose-body: #cbd5e1;
    --tw-prose-headings: #f8fafc;
    --tw-prose-strong: #f8fafc;
    --tw-prose-links: #0ea5e9;
}

/* Бегущая строка (Marquee) */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

.tech-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    margin: 0 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 0.5rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tech-logo:hover {
    color: #f8fafc;
    border-color: rgba(14, 165, 233, 0.6);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

/* WhatsApp Floating Button */
.whatsapp-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-widget:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    animation: none;
}

.whatsapp-widget svg {
    width: 35px;
    height: 35px;
    fill: currentColor;
}

@keyframes pulse-whatsapp {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Tooltip for WhatsApp */
.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateX(10px);
}

.whatsapp-widget:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* =========================================
   THEMATIC ANIMATIONS (Super-Mega Cool)
   ========================================= */

/* 1. Cyber Grid (index.html) */
.cyber-grid-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    perspective: 1000px;
    opacity: 0.15;
    pointer-events: none;
}
.cyber-grid-plane {
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(to right, #0ea5e9 1px, transparent 1px),
        linear-gradient(to bottom, #0ea5e9 1px, transparent 1px);
    background-size: 50px 50px;
    transform: rotateX(75deg);
    animation: cyber-grid-move 10s linear infinite;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 50%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 50%);
}
@keyframes cyber-grid-move {
    0% { transform: rotateX(75deg) translateY(0); }
    100% { transform: rotateX(75deg) translateY(50px); }
}

/* 2. Morphing Orbs (about.html, contacts.html) */
.orb-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.2;
}
.orb {
    position: absolute;
    border-radius: 50%;
    animation: morph-orb 15s ease-in-out infinite alternate;
}
.orb-1 {
    width: 400px;
    height: 400px;
    background: #0ea5e9;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: #10b981;
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}
@keyframes morph-orb {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { transform: translate(5%, 10%) scale(1.1) rotate(180deg); border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { transform: translate(-5%, -10%) scale(0.9) rotate(360deg); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* 3. Electric Circuits (electro.html) */
.circuit-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}
.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
    background-size: 200% 100%;
    animation: circuit-flow 3s linear infinite;
}
.circuit-v { width: 2px; height: 100%; background: linear-gradient(180deg, transparent, #f59e0b, transparent); background-size: 100% 200%; }
.circuit-h { width: 100%; height: 2px; }
@keyframes circuit-flow {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* 4. Binary Rain (it.html) */
.binary-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    opacity: 0.08;
    color: #10b981;
    font-family: monospace;
    font-size: 14px;
    line-height: 1;
}
.binary-col {
    position: absolute;
    top: -100%;
    width: 20px;
    text-align: center;
    text-shadow: 0 0 5px #10b981;
    animation: binary-fall linear infinite;
}
@keyframes binary-fall {
    0% { transform: translateY(0); }
    100% { transform: translateY(200vh); }
}

/* 5. Network Nodes (lan.html) */
.nodes-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}
.node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0ea5e9;
    border-radius: 50%;
    box-shadow: 0 0 10px #0ea5e9;
    animation: node-pulse 2s infinite alternate;
}
.node-line {
    position: absolute;
    background: #0ea5e9;
    opacity: 0.3;
    transform-origin: left center;
}
.data-packet {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff;
    animation: packet-move 3s linear infinite;
}
@keyframes node-pulse {
    0% { transform: scale(1); box-shadow: 0 0 10px #0ea5e9; }
    100% { transform: scale(1.5); box-shadow: 0 0 20px #0ea5e9, 0 0 40px #0ea5e9; }
}
@keyframes packet-move {
    0% { left: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* =========================================
   ARTICLE CARDS — профессиональные карточки
   ========================================= */

/* Обрезка текста до 2 строк (WebKit + стандарт) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Карточка статьи в базе знаний */
.article-card {
    text-decoration: none;
    will-change: transform, box-shadow;
}

.article-card:hover {
    transform: translateX(3px);
}

/* Плавный переход для группы hover */
.article-card .w-8 {
    transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* Кнопки категорий (фильтры) вверху страницы базы знаний */
.cat-filter-btn {
    transition: all 0.2s ease;
}

.cat-filter-btn:hover {
    transform: translateY(-1px);
}
