html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

    /* Убираем однотонный фон */
    background: url('/assets/background.gif') no-repeat center center fixed;
    background-size: cover; /* Растягивает гифку */
    
    min-height: 100vh;
    color: #e6e6e6;
}

/* Decorative background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

a {
    color: #64b5f6; /* blue accent */
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #8ecafc;
}

/* Container for content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styles */
.site-header {
    backdrop-filter: blur(10px);
    background: rgba(10, 13, 25, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 600;
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav li {
    margin-right: 20px;
}

.main-nav li:last-child {
    margin-right: 0;
}

.main-nav a {
    color: #e6e6e6;
    padding: 10px 0;
    display: block;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.main-nav li.active a,
 .main-nav a:hover {
    border-color: #64b5f6;
}

.lang-switcher {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.lang-switcher a {
    color: #8fa3cf;
    margin: 0 5px;
}

.lang-switcher a.active {
    color: #64b5f6;
    font-weight: bold;
}

.lang-switcher span {
    color: #666;
}

/* Main content area */
.main-content {
    padding: 40px 0;
}

/* Cards / glass containers */
.card {
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
    margin-bottom: 20px;

    /* subtle entrance animation */
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.card h2 {
    margin-top: 0;
    color: #e6e6e6;
}

.card p {
    color: #b3b3b3;
    line-height: 1.5;
}

/* Grid for tools on the home page */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tool-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    transition: background 0.2s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tool-item h3 {
    margin-top: 0;
    color: #80baf3;
}

.tool-item p {
    color: #a0a0a0;
    margin-bottom: 10px;
}

.tool-item a {
    display: inline-block;
    font-weight: bold;
    font-size: 1.2rem;
    /* Use blue accent for tool links */
    color: #64b5f6;
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
    /* Adjust hover shadow tint to blue */
    box-shadow: 0 6px 20px rgba(100, 181, 246, 0.4);
}

/*
 * AI chat styles
 *
 * These classes style the interactive chat component that is integrated into
 * the home page. Colours and spacing are chosen to harmonise with the
 * existing dark glassmorphism theme. All styles are namespaced under
 * `.ai-chat-wrapper` or dedicated class names to avoid interfering with
 * existing markup. The chat container behaves like a card but contains its
 * own message area, input field and error handling.
 */
.ai-chat-wrapper .chat-description {
    text-align: center;
    color: #b3b3b3;
    margin-bottom: 12px;
}

.ai-chat-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #e6e6e6;
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.ai-chat-container .small {
    font-size: 12px;
    color: #b3b3b3;
}

.chat-messages {
    height: 380px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    padding: 10px 12px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.05);
    text-align: right;
}

.chat-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #64b5f6;
}

.chat-welcome {
    color: #b3b3b3;
    text-align: center;
    padding: 6px;
}

.chat-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e6e6e6;
    border-radius: 8px;
    padding: 10px;
    height: 56px;
}

.chat-input button {
    background: #64b5f6;
    border: none;
    color: black;
    border-radius: 8px;
    padding: 0 18px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}

.chat-input button:hover {
    background: #8ecafc;
}

.error {
    color: #f55;
    font-style: italic;
}

/* Icon styling for each tool card */
.tool-icon {
    font-size: 2.2rem;
    /* Icon colour aligns with the blue palette */
    color: #64b5f6;
    margin-bottom: 10px;
}

/* Form styles for tools */
form {
    margin-top: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #c7d2fe;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #2f2f4f;
    background: rgba(255, 255, 255, 0.05);
    color: #e6e6e6;
    margin-bottom: 10px;
}

button {
    /* Primary accent colour for buttons */
    background-color: #64b5f6;
    color: #050912;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

button:hover {
    /* Lighter blue shade on hover */
    background-color: #8ecafc;
}

/* Results output */
.result {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    color: #e6e6e6;
    overflow-x: auto;
    font-family: monospace;
    white-space: pre-wrap;
}

/* Table styling for results tables (e.g. active services) */
.result table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.result th,
.result td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result th {
    text-align: left;
    color: #c7d2fe;
    font-weight: 600;
}

.result td {
    color: #e6e6e6;
}

/* Footer styles */
.site-footer {
    padding: 20px 0;
    background: rgba(10, 13, 25, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.site-footer p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
}

/* Hero section styles */
.hero {
    position: relative;
    background: linear-gradient(rgba(5, 9, 18, 0.8), rgba(5, 9, 18, 0.8));
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    color: #e6e6e6;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    /* Hero heading uses primary blue accent */
    color: #64b5f6;
}

.hero p {
    font-size: 1.1rem;
    color: #d0d0d0;
    max-width: 700px;
    margin: 0 auto;
}

/* Generic button style */
.button {
    display: inline-block;
    /* Primary accent colour for generic buttons */
    background-color: #64b5f6;
    color: #050912;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    /* Lighter blue shade on hover for generic buttons */
    background-color: #8ecafc;
    transform: translateY(-2px);
}

/* Поиск в тёмной теме */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0 2rem;
}

.search-form input[type="search"] {
    flex: 1;
    max-width: 400px;
    padding: 0.6rem 0.9rem;
    border: 1px solid #444;
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: #1e1e1e;
    color: #eee;
    transition: all 0.2s ease-in-out;
}

.search-form input[type="search"]::placeholder {
    color: #888;
}

.search-form input[type="search"]:focus {
    border-color: #3a8bff;
    outline: none;
    box-shadow: 0 0 6px rgba(58, 139, 255, 0.4);
    background-color: #252525;
}

.search-form button {
    background-color: #3a8bff;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.search-form button:hover {
    background-color: #2f76d0;
    transform: translateY(-1px);
}

.search-form button:active {
    background-color: #255da8;
    transform: translateY(0);
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .search-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-form input[type="search"],
    .search-form button {
        width: 100%;
    }
}

/* ----- Мобильная оптимизация ----- */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
        max-width: 100%;
    }

    .header-container {
        height: 56px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .main-nav li {
        margin-right: 14px;
    }

    .hero {
        padding: 50px 30px;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* Средние и маленькие устройства (до 768px) */
@media (max-width: 768px) {
    /* Отключаем фиксированное/липкое позиционирование */
    .site-header {
        position: static;
        backdrop-filter: none;
        background: rgba(10, 13, 25, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 10px 0;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }

    .main-nav li {
        margin: 8px 0;
    }

    .lang-switcher {
        margin-top: 8px;
        width: 100%;
        justify-content: flex-start;
    }

    .hero {
        padding: 40px 20px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .tool-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .ai-chat-container {
        padding: 12px;
        max-width: 100%;
    }

    .chat-messages {
        height: 300px;
    }

    .chat-input textarea {
        height: 48px;
    }

    .button, button {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}

/* Смартфоны (до 480px) */
@media (max-width: 480px) {
    html, body {
        font-size: 15px;
    }

    .container {
        padding: 0 12px;
    }

    /* 🧭 На телефонах тоже меню не фиксируется */
    .site-header {
        position: static;
        background: rgba(10, 13, 25, 0.95);
        backdrop-filter: none;
    }

    .header-container {
        align-items: center;
    }

    .logo {
        font-size: 1.1rem;
    }

    .main-nav ul {
        align-items: flex-start;
    }

    .main-nav li {
        margin: 6px 0;
    }

    .hero {
        padding: 30px 16px;
        border-radius: 8px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-item {
        padding: 12px;
    }

    .ai-chat-container {
        padding: 10px;
    }

    .chat-messages {
        height: 240px;
        font-size: 0.9rem;
    }

    .chat-input {
        flex-direction: column;
    }

    .chat-input textarea {
        height: 60px;
    }

    .chat-input button {
        width: 100%;
        padding: 10px;
    }

    .site-footer p {
        font-size: 0.75rem;
    }
}
