/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    flex: 1;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.back-button:hover {
    color: white;
    transform: translateX(-3px);
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.logo-highlight {
    color: #ffd700;
    position: relative;
}

.logo-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Weather Info Styles */
.weather-info {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    min-width: 300px;
}

.weather-location {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 500;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.temperature {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-condition {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.weather-extra {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.weather-extra span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.weather-refresh button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.weather-refresh button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* News Controls */
.news-controls {
    padding: 20px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #eaeaea;
}

.search-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.clear-btn:hover {
    color: #e74c3c;
}

.category-filter {
    display: flex;
    gap: 15px;
    align-items: center;
}

.category-filter select {
    padding: 12px 20px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.category-filter select:focus {
    outline: none;
    border-color: #3498db;
}

.refresh-btn {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.stats-info {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
}

.stat-item i {
    color: #3498db;
}

/* News Categories */
.news-categories {
    padding: 30px 40px;
    flex: 1;
}

.category-section {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
}

.category-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-count {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.category-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.news-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.news-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    flex: 1;
}

.news-category-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
    white-space: nowrap;
}

/* Category-specific colors */
.category-traffic .news-category-badge { background: #3498db; color: white; }
.category-weather .news-category-badge { background: #f39c12; color: white; }
.category-safety .news-category-badge { background: #e74c3c; color: white; }
.category-crime .news-category-badge { background: #8e44ad; color: white; }
.category-government .news-category-badge { background: #2c3e50; color: white; }
.category-economy .news-category-badge { background: #27ae60; color: white; }
.category-health .news-category-badge { background: #e74c3c; color: white; }
.category-environment .news-category-badge { background: #16a085; color: white; }
.category-social .news-category-badge { background: #9b59b6; color: white; }
.category-community .news-category-badge { background: #34495e; color: white; }

.news-summary {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.hashtag {
    background: #e8f4fc;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #2980b9;
    font-weight: 500;
}

.hashtag i {
    margin-right: 4px;
    font-size: 0.7rem;
}

/* Loading States */
.loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #95a5a6;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-news-message {
    text-align: center;
    padding: 40px;
    color: #95a5a6;
    font-size: 1.1rem;
}

.no-news-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #bdc3c7;
}

/* News Modal */
.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.news-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 30px;
    border-bottom: 1px solid #eaeaea;
}

.modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: #2c3e50;
    line-height: 1.3;
    flex: 1;
    margin-right: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 30px;
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-category {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.modal-date {
    color: #95a5a6;
    font-size: 0.9rem;
}

.modal-summary {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 25px;
}

.modal-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.modal-extra {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.modal-location,
.modal-impact {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
}

.modal-location i,
.modal-impact i {
    color: #3498db;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 20px 40px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.separator {
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .weather-info {
        width: 100%;
        justify-content: center;
    }

    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filter {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }

    .news-controls,
    .news-categories {
        padding: 20px;
    }

    .category-news-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10px;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .stats-info {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2rem;
    }

    .weather-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .category-title {
        font-size: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-status {
        justify-content: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Category Icons */
.category-traffic .category-title i { color: #3498db; }
.category-weather .category-title i { color: #f39c12; }
.category-safety .category-title i { color: #e74c3c; }
.category-crime .category-title i { color: #8e44ad; }
.category-government .category-title i { color: #2c3e50; }
.category-economy .category-title i { color: #27ae60; }
.category-health .category-title i { color: #e74c3c; }
.category-environment .category-title i { color: #16a085; }
.category-social .category-title i { color: #9b59b6; }
.category-community .category-title i { color: #34495e; }