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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 700;
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Controls Styles */
.controls {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.control-group {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.controls label {
    font-weight: 600;
    margin-right: 10px;
    color: #2c3e50;
    font-size: 14px;
}

.controls select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    min-width: 150px;
    transition: border-color 0.3s ease;
}

.controls select:focus {
    outline: none;
    border-color: #667eea;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
    font-size: 12px;
    padding: 5px 10px;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* News Container Styles */
.news-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.news-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.news-count {
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.news-list {
    padding: 30px;
}

/* News Item Styles */
.news-item {
    border-bottom: 1px solid #eee;
    padding: 25px 0;
    transition: all 0.3s ease;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background: #f8f9fa;
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
    border-radius: 8px;
}

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

.news-source {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-time {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

.news-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    line-height: 1.4;
}

.news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: #667eea;
}

.news-summary {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 15px;
}

.news-link {
    display: inline-flex;
    align-items: center;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.news-link:hover {
    color: #764ba2;
    transform: translateX(5px);
}

/* No News Styles */
.no-news {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.no-news-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-news h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.no-news p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Form Styles */
.add-source-form {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.add-source-form h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Source List Styles */
.source-list h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.3em;
}

.source-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
}

.source-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.source-info h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.source-info p {
    margin: 0 0 5px 0;
    color: #6c757d;
    font-size: 14px;
    word-break: break-all;
}

.source-info small {
    color: #8e8e93;
    font-size: 13px;
}

.source-actions {
    flex-shrink: 0;
}

/* Footer Styles */
footer {
    margin-top: 50px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

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

.footer-info p {
    margin-bottom: 5px;
    color: white;
    opacity: 0.9;
    font-size: 14px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .news-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .source-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .source-actions {
       align-self: flex-end;
   }
   
   .footer-content {
       flex-direction: column;
       text-align: center;
   }
}

@media (max-width: 480px) {
   header h1 {
       font-size: 1.8em;
   }
   
   .news-item:hover {
       margin: 0 -10px;
       padding-left: 10px;
       padding-right: 10px;
   }
   
   .news-list {
       padding: 20px;
   }
   
   .modal-header {
       padding: 15px 20px;
   }
   
   .modal-body {
       padding: 15px;
   }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
   .news-item:hover {
       background: #f1f3f4;
   }
}

/* Print styles */
@media print {
   body {
       background: white;
   }
   
   .controls,
   .modal,
   footer {
       display: none;
   }
   
   .container {
       max-width: none;
       padding: 0;
   }
   
   .news-item {
       break-inside: avoid;
   }
}

/* Animation for loading */
@keyframes fadeIn {
   from {
       opacity: 0;
       transform: translateY(20px);
   }
   to {
       opacity: 1;
       transform: translateY(0);
   }
}

.news-item {
   animation: fadeIn 0.5s ease-out;
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
   width: 6px;
}

.modal-body::-webkit-scrollbar-track {
   background: #f1f1f1;
   border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
   background: #c1c1c1;
   border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
   background: #a8a8a8;
}
