body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: url(https://x-c.su/mds/pss_style/css_main/446e3b79395a287ca32f7977dd83b290.jpg);
    background-size: auto;
    min-height: 100vh;
    color: #333;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

body.loaded {
  opacity: 1;
}

img.animate-conf {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

img.animate-conf:hover {
    opacity: 1;
}

.white_text {
    text-align: center;
    color: #FFFFFF;
    font-size: 0.9rem;
    cursor: default;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 20px;
    box-sizing: border-box;
    text-align: center;
}

h3, h4 {
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: 1px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

textarea#query {
    padding: 14px 42px 14px 14px;
    font-size: 16px;
    border: 1px solid #cfa8e0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: #2e204d;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
    overflow-wrap: break-word;
}

textarea#query:focus {
    outline: none;
    border-color: #9b7ccb;
    box-shadow: 0 0 0 3px rgba(155, 124, 203, 0.3);
}

button.clear-btn {
    position: absolute;
    top: 26px;
    right: 3px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: rgba(142, 107, 212, 0.15);
    color: #8e6bd4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    z-index: 10;
    padding: 0;
    margin: 0;
    transition: background-color 0.2s, transform 0.1s;
}

button.clear-btn:hover {
    background-color: rgba(142, 107, 212, 0.3);
    transform: scale(1.05);
}

button.clear-btn:active {
    transform: scale(0.95);
}

button[type="submit"] {
    padding: 14px 24px;
    font-size: 16px;
    background: linear-gradient(135deg, #8e6bd4 0%, #6f4ccb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    box-sizing: border-box;
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(111, 76, 203, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button#searchBtn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.8;
}

.error {
    color: #a63d4f;
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border: 1px solid #eec4d2;
}

.result-card-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    margin-top: 18px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(78, 48, 117, 0.15);
}

.result-card-table td {
    border: 1px solid rgba(142, 107, 212, 0.2);
    padding: 20px;
    vertical-align: top;
    text-align: left;
}

.card-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a3575;
    margin-bottom: 12px;
    display: block;
}

.card-similarity {
    font-size: 0.95rem;
    font-weight: 600;
    color: #6f4ccb;
    margin-bottom: 16px;
    display: block;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(111, 76, 203, 0.3);
}

.card-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #3a3a3a;
    text-align: justify;
}

a.card-link {
    color: #5e4085;
    text-decoration: none;
    font-weight: 600;
}

a.card-link:hover {
    color: #8e6bd4;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .container {
        max-width: 100%;
        padding: 20px 15px;
        box-sizing: border-box;
    }
    textarea#query, button[type="submit"] {
        width: 100%;
        box-sizing: border-box;
    }
    .result-card-table td {
        padding: 16px 12px;
    }
    .card-description {
        text-align: justify;
    }
    button.clear-btn {
        top: 26px;
        right: 3px;
    }
}

.top-banner {
    width: 100%;
    margin-bottom: 24px;
}

.banner-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.banner-image {
    display: block;
    width: 100%;
    height: auto;           /* сохраняет пропорции картинки */
    border-radius: 8px;     /* опционально: скругление углов */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); /* опционально: тень */
    transition: transform 0.2s ease;
}

.banner-link:hover .banner-image {
    transform: scale(1.01); /* лёгкий эффект при наведении */
}

@media (max-width: 600px) {
    .banner-image {
        border-radius: 6px;
    }
}