/* 
 * style.css - Portal de Notícias SEO Pro + Enquetes
 * Layout moderno com CSS Grid e responsivo
 */

:root {
    --primary-color: #1a5f7a;
    --secondary-color: #c0392b;
    --accent-color: #e67e22;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #ecf0f1;
    --white: #ffffff;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
}

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

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

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

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* Header */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    font-size: 0.9em;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
}

.logo {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.logo img {
    max-height: 60px;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

nav ul li a {
    display: block;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.95em;
}

nav ul li a:hover {
    background: var(--primary-color);
    color: var(--white);
}

nav ul li a.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px 250px;
    gap: 30px;
    margin: 30px auto;
}

/* News Grid */
.news-section {
    background: var(--white);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
}

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

.news-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.news-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-card-content {
    padding: 20px;
}

.news-card-category {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.news-card-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    line-height: 1.4;
}

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

.news-card-excerpt {
    color: var(--text-light);
    font-size: 0.95em;
    margin-bottom: 15px;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-light);
}

/* Featured News */
.news-featured {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

.news-featured .news-card {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
}

.news-featured .news-card-image {
    height: 100%;
    min-height: 350px;
}

.news-featured .news-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-featured .news-card-title {
    font-size: 2em;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Poll Widget */
.poll-options {
    list-style: none;
}

.poll-option {
    margin-bottom: 15px;
}

.poll-option label {
    display: block;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.poll-option label:hover {
    background: var(--primary-color);
    color: var(--white);
}

.poll-option input[type="radio"] {
    margin-right: 10px;
}

.poll-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s ease;
}

.poll-submit:hover {
    background: #154d63;
}

.poll-results {
    margin-top: 15px;
}

.poll-result-item {
    margin-bottom: 10px;
}

.poll-result-bar {
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
    height: 25px;
    position: relative;
}

.poll-result-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: var(--white);
    font-size: 0.85em;
    font-weight: 600;
    transition: width 0.5s ease;
}

/* Ads Sidebar */
.ads-sidebar {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.ad-space {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
}

.ad-placeholder {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
}

/* Categories Filter */
.categories-filter {
    margin-bottom: 30px;
}

.categories-filter ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
}

.categories-filter ul li a {
    display: block;
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.categories-filter ul li a:hover,
.categories-filter ul li a.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Single News Page */
.news-single {
    background: var(--white);
    border-radius: 10px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.news-single-header {
    margin-bottom: 30px;
}

.news-single-title {
    font-size: 2.5em;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.news-single-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.95em;
}

.news-single-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 30px;
}

.news-single-content {
    font-size: 1.1em;
    line-height: 1.8;
}

.news-single-content p {
    margin-bottom: 20px;
}

.news-single-content h2,
.news-single-content h3 {
    margin: 30px 0 15px;
    color: var(--primary-color);
}

/* Admin Panel Styles */
.admin-panel {
    background: var(--white);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin: 30px auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.admin-tab {
    padding: 10px 20px;
    background: var(--bg-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.admin-tab:hover,
.admin-tab.active {
    background: var(--primary-color);
    color: var(--white);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #154d63;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--text-light);
}

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

.btn-danger {
    background: var(--secondary-color);
}

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

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219a52;
}

/* Table Styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.admin-table tr:hover {
    background: var(--bg-light);
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-actions .btn {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Messages */
.message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9em;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr 280px;
    }
    
    .ads-sidebar-fixed {
        display: none;
    }
}

@media (max-width: 992px) {
    .header-main .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    nav ul {
        justify-content: center;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .news-featured .news-card {
        grid-template-columns: 1fr;
    }
    
    .news-featured .news-card-image {
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-filter ul {
        flex-direction: column;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-table {
        font-size: 0.9em;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
