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

:root {
    --primary: #d32f2f;
    --secondary: #c62828;
    --bg-dark: #1a1a1a;
    --bg-light: #2d2d2d;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --border: #404040;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Navigation */
nav {
    background: var(--bg-light);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

nav .container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-btn, .refresh-btn {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 1em;
}

.filter-btn:hover, .refresh-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

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

.refresh-btn {
    margin-left: auto;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.article-card {
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #333, #555);
}

.article-content {
    padding: 20px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--text-gray);
}

.article-source {
    background: var(--primary);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
}

.article-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--text-light);
    line-height: 1.4;
}

.article-description {
    color: var(--text-gray);
    margin-bottom: 15px;
    font-size: 0.95em;
}

.read-more {
    display: inline-block;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--secondary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.no-articles {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.no-articles button {
    margin-top: 20px;
    padding: 10px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

/* Schedule button */
.schedule-btn {
    margin-left: 10px;
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.schedule-btn:hover {
    background: #ee5a52;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: var(--bg-light);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideDown 0.3s;
}

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

.close {
    color: var(--text-gray);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: var(--text-light);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

/* Schedule Info */
.schedule-info {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-item .label {
    color: var(--text-gray);
    font-weight: 500;
}

.info-item .value {
    color: var(--text-light);
    font-weight: bold;
}

.status-enabled {
    color: #51cf66;
}

.status-disabled {
    color: #ff6b6b;
}

/* Schedule Controls */
.schedule-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.control-group label {
    color: var(--text-light);
    font-weight: 500;
    min-width: 120px;
}

.control-group select {
    flex: 1;
    padding: 10px;
    background: var(--bg-dark);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 1em;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--secondary);
}

.btn-success {
    background: #51cf66;
    color: white;
}

.btn-success:hover {
    background: #40c057;
}

.btn-warning {
    background: #ffd43b;
    color: #333;
}

.btn-warning:hover {
    background: #fab005;
}

.btn-info {
    background: #339af0;
    color: white;
}

.btn-info:hover {
    background: #228be6;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    nav .container {
        justify-content: center;
    }
    
    .refresh-btn {
        margin-left: 0;
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group label {
        min-width: auto;
    }

    .schedule-btn {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}