/* AgregatorNews - Google News Style CSS */

/* Variables Google News Inspired */
:root {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-meta: #70757a;
    --bg-color: #f6f8fc;
    --card-bg: #ffffff;
    --border-color: #dadce0;
    --shadow-light: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-hover: 0 4px 10px rgba(0,0,0,0.15);
    --radius: 12px;
    --transition: all 0.2s cubic-bezier(0.0, 0, 0.2, 1);
    --font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-color);
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - Google Style */
header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-light);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

header h1 {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 14px;
}

nav a:hover, nav a.active {
    background-color: rgba(26, 115, 232, 0.08);
    color: var(--primary-color);
}

/* Main Content */
main {
    padding: 24px 0 40px;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-section h2 {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 600;
}

.controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-update {
    font-size: 12px;
    color: var(--text-meta);
    font-style: normal;
}

/* Google News Style Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.25px;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    text-transform: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

/* Loading State - Google Style */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    text-align: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(26, 115, 232, 0.2);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Google News Categories Layout */
.news-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.category-column {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, #ffffff, #fafafa);
}

.category-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
}

/* Google News Grid Layout */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background-color: var(--border-color);
}

/* Google News Card Style */
.news-card {
    background: var(--card-bg);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background-color: #fafafa;
}

/* Card Content - Left Side */
.news-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.news-source {
    font-size: 12px;
    color: var(--text-meta);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-size: 12px;
    color: var(--text-meta);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Card Image - Right Side */
.news-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #e8eaed;
    align-self: center;
    justify-self: center;
}

.news-card:hover .news-image {
    border-radius: 10px;
}

/* Responsive Design - Google News Style */
@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card {
        grid-template-columns: 2.5fr 1.5fr;
        gap: 20px;
        padding: 20px;
    }
    
    .news-title {
        font-size: 18px;
    }
    
    .news-image {
        height: 140px;
    }
}

/* Messages - Google Style */
.success-message, .error-message, .no-articles {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
    box-shadow: var(--shadow-light);
    text-align: center;
    border: 1px solid var(--border-color);
}

.success-message {
    border-left: 4px solid #34a853;
}

.error-message {
    border-left: 4px solid #ea4335;
}

.no-articles {
    border-left: 4px solid var(--border-color);
}

.success-message h3 {
    color: #34a853;
    margin-bottom: 8px;
    font-size: 18px;
}

.error-message p, .no-articles p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Footer - Google Style */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
}

footer p {
    text-align: center;
    color: var(--text-meta);
    font-size: 12px;
}

/* Accessibility - Google Standards */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
.news-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #e8eaed;
        --text-secondary: #bdc1c6;
        --text-meta: #9aa0a6;
        --bg-color: #1f2328;
        --card-bg: #202124;
        --border-color: #3c4043;
        --shadow-light: 0 1px 2px 0 rgba(0,0,0,0.5), 0 1px 3px 1px rgba(0,0,0,0.4);
        --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-primary);
    }
    
    .news-image {
        background-color: #3c4043;
    }
    
    .category-header {
        background: linear-gradient(180deg, #202124, #2a2d30);
        border-bottom-color: var(--border-color);
    }
}