:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #38b000;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
}

body.dark-mode {
    --primary-color: #4cc9f0;
    --secondary-color: #4361ee;
    --accent-color: #3f37c9;
    --light-color: #121212;
    --dark-color: #e0e0e0;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #121212 0%, #2d3436 100%);
    color: var(--dark-color);
}

body.dark-mode .app-header,
body.dark-mode .loading-section,
body.dark-mode .settings-card,
body.dark-mode .article-card,
body.dark-mode .modal-content {
    background: #1e1e1e;
    color: var(--dark-color);
}

body.dark-mode .setting-item {
    background: #2d2d2d;
}

body.dark-mode .article-img {
    opacity: 0.8;
}

body.dark-mode .article-meta {
    border-top: 1px solid #333;
    color: #aaa;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
}

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

/* Header */
.app-header {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

.install-btn {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* Painel de Controle */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .control-panel {
        grid-template-columns: 1fr;
    }
}

.loading-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.settings-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.settings-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-top: 1rem;
}

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

/* Grid de Artigos */
.articles-container {
    margin-top: 2rem;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.article-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.article-image {
    height: 180px;
    background: linear-gradient(to right, #4361ee, #4cc9f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.article-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--dark-color);
    line-height: 1.4;
}

.article-content p {
    color: #666;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #888;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 800px;
    position: relative;
    animation: modalFade 0.3s;
}

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

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.btn-secondary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #3ab0d8;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.pwa-status {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}