/* GabriNews Stylesheet */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --dark-bg: #1a1a2e;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--dark-bg);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.title-section {
    flex: 1;
    min-width: 300px;
}

.title-with-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 4px;
    background: white;
}

.share-header .logo {
    width: 40px;
    height: 40px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.calendar-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: white;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.filter-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Top Items Section */
.top-items-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-hover);
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.top-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.top-item-column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 200px;
}

.column-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.top-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-item {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.top-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    min-width: 35px;
}

.top-content {
    flex: 1;
}

.top-title {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.top-title:hover {
    color: var(--secondary-color);
}

.top-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.hotness-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hotness-badge.largest {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

.top-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.no-data {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Hottest of Year Card */
.hottest-year-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.hottest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.hottest-icon {
    font-size: 2.5rem;
}

.hottest-title {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.hottest-title:hover {
    opacity: 0.9;
}

.hottest-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hottest-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.95;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--secondary-color);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-card.vulnerability {
    border-left-color: var(--accent-color);
}

.news-card.news {
    border-left-color: var(--secondary-color);
}

/* Severity Colors */
.news-card.severity-critical {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.news-card.severity-high {
    border-left-color: #e67e22;
    background: #fff9f5;
}

.news-card.severity-medium {
    border-left-color: #f39c12;
    background: #fffbf5;
}

.news-card.severity-low {
    border-left-color: #27ae60;
    background: #f5fff8;
}

/* Card Header */
.card-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-vulnerability {
    background: #ffe0e0;
    color: #c0392b;
}

.badge-news {
    background: #e0f2ff;
    color: #2980b9;
}

.badge-bootloaders {
    background: #fff4e0;
    color: #d68a00;
}

.badge-rtos {
    background: #e8e0ff;
    color: #6c3fb5;
}

.badge-transportation {
    background: #e0ffe8;
    color: #16a34a;
}

.badge-category {
    background: #f0f0f0;
    color: #555;
}

.badge-severity-critical {
    background: #e74c3c;
    color: white;
}

.badge-severity-high {
    background: #e67e22;
    color: white;
}

.badge-severity-medium {
    background: #f39c12;
    color: white;
}

.badge-severity-low {
    background: #27ae60;
    color: white;
}

.badge-severity-info {
    background: #3498db;
    color: white;
}

/* Card Content */
.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: var(--secondary-color);
}

.subcategory {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.key-points {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.key-points strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.key-points ul {
    margin-left: 1.5rem;
}

.key-points li {
    margin-bottom: 0.25rem;
}

.affected-systems {
    background: #fff3cd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.affected-systems strong {
    color: #856404;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-light);
}

.source {
    color: var(--secondary-color);
    font-weight: 500;
}

.date {
    color: var(--text-light);
    display: flex;
    align-items: center;
}

/* Share Button */
.share-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 0.5rem;
    color: #3498db;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    position: relative;
}

.share-btn:focus {
    outline: none;
}

.share-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    transform: scale(1.1);
}

.share-btn:active {
    transform: scale(0.95);
    background: rgba(52, 152, 219, 0.2);
}

.share-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Share button animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 3rem 0;
}

.pagination button {
    padding: 0.75rem 1.5rem;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    color: white;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .calendar-section {
        width: 100%;
        align-items: stretch;
    }
    
    .calendar-widget {
        min-width: 100%;
        max-width: 100%;
    }
    
    .today-btn {
        width: 100%;
    }
    
    .week-days {
        gap: 0.25rem;
    }
    
    .week-day {
        padding: 0.5rem 0.25rem;
        min-width: 40px;
    }
    
    .day-name {
        font-size: 0.65rem;
    }
    
    .day-number {
        font-size: 1.1rem;
    }
    
    .month-year {
        font-size: 0.95rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filters {
        justify-content: center;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Calendar Styles */
.today-btn {
    padding: 0.75rem 1.5rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.today-btn:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.calendar-widget {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1rem;
    min-width: 400px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calendar-empty {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Weekly Calendar View */
.week-calendar {
    width: 100%;
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.month-year {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-align: center;
    flex: 1;
}

.week-nav {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-nav:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.week-nav:active {
    transform: scale(0.95);
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.week-day {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 50px;
}

.week-day:hover:not(.no-news) {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.week-day.active {
    background: var(--success-color);
    border-color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.week-day.no-news {
    background: rgba(100, 100, 100, 0.2);
    opacity: 0.4;
    cursor: not-allowed;
}

.week-day.no-news .day-name,
.week-day.no-news .day-number {
    color: rgba(255, 255, 255, 0.5);
}

.day-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.day-number {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
}

/* Remove old calendar styles */
.calendar-grid,
.calendar-date,
.date-day,
.date-month {
    display: none;
}
