:root {
    --primary: #2D5AF0;
    --primary-hover: #1A40C8;
    --bg-color: #F8FAFF;
    --card-bg: #FFFFFF;
    --text-main: #1B1B1F;
    --text-muted: #585E71;
    --blur-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header & Intro */
.hero {
    padding: 100px 20px 40px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero.minimized {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eef0f7;
    background: var(--blur-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 42px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: -1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero.minimized .logo {
    font-size: 24px;
    margin-bottom: 0;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    transition: all 0.4s ease;
}

.hero.minimized .search-container {
    margin: 0;
    max-width: 450px;
}

.search-wrapper {
    background: var(--card-bg);
    padding: 8px 12px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(45, 90, 240, 0.15);
}

.search-icon {
    margin: 0 12px;
    color: var(--text-muted);
}

input#searchInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px;
    font-size: 18px;
    background: transparent;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-hover);
}

/* Results Area */
.results-section {
    max-width: 1000px;
    margin: 40px auto;
    width: 100%;
    padding: 0 20px;
    display: none;
}

.results-meta {
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Article Card */
.article-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f2f8;
    animation: slideUp 0.5s ease backwards;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.card-img {
    height: 180px;
    width: 100%;
    object-fit: center-crop;
    background: #f5f7fb;
}

.card-content {
    padding: 24px;
}

.card-source {
    color: var(--primary);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f8;
    color: var(--text-muted);
    font-size: 13px;
}

/* Modal View */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 30, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
    padding: 50px 20px;
}

.modal-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
}

.modal-header {
    height: 400px;
    background: #f5f7fb;
    position: relative;
}

.modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-size: 24px;
}

.modal-body {
    padding: 50px;
}

.modal-title {
    font-size: 32px;
    margin-bottom: 16px;
}

.modal-meta {
    margin-bottom: 30px;
    color: var(--text-muted);
}

.modal-text {
    font-size: 18px;
    line-height: 1.8;
    white-space: pre-line;
    color: #333;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Loading Shimmer */
.shimmer {
    background: linear-gradient(90deg, #f0f2f8 25%, #f9faff 50%, #f0f2f8 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 600px) {
    .hero.minimized {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .hero.minimized .search-container {
        max-width: 100%;
    }
}
