/* =========================================
   1. Global Reset & Animated Background
   ========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Анимированный градиентный фон */
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #2d3748;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* =========================================
   2. Glassmorphism Container
   ========================================= */

.container {
    max-width: 800px;
    margin: 40px auto;
    /* Эффект матового стекла */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}


/* =========================================
   3. Typography
   ========================================= */

h1 {
    text-align: center;
    color: #1a202c;
    font-size: 2.8rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    color: #4a5568;
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}


/* =========================================
   4. Search Section
   ========================================= */

#searchInput {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.9);
}

#searchInput:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

#searchBtn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

#searchBtn:active {
    transform: translateY(1px);
}


/* =========================================
   5. Article Cards (3D Hover Effect)
   ========================================= */

.article {
    background: rgba(255, 255, 255, 0.9);
    padding: 24px;
    margin: 20px 0;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.article:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.article h3 {
    color: #1a202c;
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.article p {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.7;
}


/* =========================================
   6. Action Buttons with Ripple Effect
   ========================================= */

.article button {
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.article button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(56, 239, 125, 0.4);
}

.article button:active {
    transform: scale(0.95);
}


/* =========================================
   7. Custom Scrollbar
   ========================================= */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}


/* =========================================
   8. Dark Mode Support (Автоматическая темная тема)
   ========================================= */

@media (prefers-color-scheme: dark) {
    body {
        color: #e2e8f0;
    }
    .container {
        background: rgba(30, 41, 59, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    h1 {
        background: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
        webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    h2 {
        color: #cbd5e1;
    }
    #searchInput {
        background: rgba(15, 23, 42, 0.6);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    #searchInput:focus {
        background: rgba(15, 23, 42, 0.9);
        border-color: #a78bfa;
        box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
    }
    .article {
        background: rgba(30, 41, 59, 0.9);
        border-color: rgba(255, 255, 255, 0.05);
    }
    .article h3 {
        color: #f1f5f9;
    }
    .article p {
        color: #94a3b8;
    }
     ::-webkit-scrollbar-track {
        background: rgba(30, 41, 59, 0.5);
    }
}


/* =========================================
   9. Responsive Design
   ========================================= */

@media (min-width: 600px) {
    .container {
        padding: 50px;
    }
    #searchInput {
        width: calc(100% - 160px);
        display: inline-block;
        vertical-align: middle;
        margin-bottom: 0;
        margin-right: 15px;
    }
    #searchBtn {
        width: 150px;
        display: inline-block;
        vertical-align: middle;
    }
}