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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

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

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 5px 15px;
    font-size: 0.9rem;
}

.btn.active {
    background-color: #e74c3c;
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters h2 {
    margin-bottom: 15px;
}

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

.country-filter select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.news-content {
    padding: 20px;
}

.news-content h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    line-height: 1.4;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.description {
    color: #555;
    margin-bottom: 15px;
}

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

.no-news {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Advertisement Cards */
.ad-card {
    border: 2px solid #f39c12;
    background: linear-gradient(to bottom, #fff 0%, #fffef8 100%);
}

.ad-badge {
    display: inline-block;
    background: #f39c12;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.ad-content h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.ad-content h3 a:hover {
    color: #f39c12;
}

.ad-card:hover {
    border-color: #e67e22;
    transform: translateY(-5px);
}

/* Article Full View */
.article-full {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-full h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
    font-size: 0.9rem;
    color: #666;
}

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

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

.lead {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: #555;
}

.content-text {
    margin-bottom: 30px;
}

.read-original {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.article-actions {
    margin-top: 30px;
}

/* Forms */
.auth-form {
    max-width: 450px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-form h2 {
    margin-bottom: 30px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

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

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

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

/* Dashboard */
.dashboard {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard h2 {
    margin-bottom: 30px;
}

.dashboard h3 {
    margin-top: 30px;
    margin-bottom: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    margin-top: 0;
    opacity: 0.9;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.history-item h4 {
    margin-bottom: 10px;
}

.history-item h4 a {
    color: #2c3e50;
    text-decoration: none;
}

.history-item h4 a:hover {
    color: #3498db;
}

/* Admin Styles */
.admin-info {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.admin-info p {
    margin-bottom: 10px;
}

.admin-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-section h2 {
    margin-bottom: 20px;
}

.admin-form {
    max-width: 600px;
}

.api-config {
    margin-bottom: 30px;
}

.api-config h3 {
    margin-bottom: 15px;
}

.help-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
}

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

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* 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);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* AI Chat Styles */
.ai-chat-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.ai-chat-section h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.ai-chat-description {
    color: #666;
    margin-bottom: 20px;
}

.ai-chat-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    position: relative;
}

.user-message {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.ai-message {
    background: #f1f8e9;
    border-left: 4px solid #8bc34a;
}

.chat-time {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-top: 5px;
}

.ai-chat-form {
    margin-top: 15px;
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

.chat-input-group textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.chat-input-group button {
    align-self: flex-end;
    min-width: 100px;
}

.ai-loading {
    text-align: center;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    margin-top: 10px;
}

.ai-chat-login {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    border: 2px dashed #ddd;
}

.ai-chat-login a {
    color: #3498db;
    font-weight: bold;
}

/* Dashboard Sections */
.dashboard-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.dashboard-section h3 {
    margin-bottom: 20px;
}

/* Dashboard Advertisement */
.dashboard-ad {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dashboard-ad-link {
    display: flex;
    gap: 20px;
    align-items: center;
    color: white;
    text-decoration: none;
}

.dashboard-ad-link img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.dashboard-ad-content {
    flex: 1;
}

.dashboard-ad-content h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.dashboard-ad-content p {
    color: rgba(255,255,255,0.9);
    margin: 0;
}

.dashboard-ad .ad-badge {
    background: rgba(255,255,255,0.2);
    display: inline-block;
    margin-bottom: 10px;
}

/* Investigation List */
.investigation-list {
    display: grid;
    gap: 15px;
}

.investigation-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #9b59b6;
}

.investigation-item h4 {
    margin-bottom: 10px;
}

.investigation-item h4 a {
    color: #2c3e50;
    text-decoration: none;
}

.investigation-item h4 a:hover {
    color: #9b59b6;
}

.inv-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #666;
}

/* Notes List */
.notes-list {
    display: grid;
    gap: 15px;
}

.note-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.note-item h4 {
    margin-bottom: 15px;
}

.note-item h4 a {
    color: #2c3e50;
    text-decoration: none;
}

.note-item h4 a:hover {
    color: #3498db;
}

.note-content {
    background: white;
    padding: 15px;
    border-radius: 6px;
}

.note-question {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.note-answer {
    color: #555;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.note-date {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

/* Signup Popup */
.signup-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.signup-popup {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.signup-popup h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.signup-popup p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.signup-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.popup-close:hover {
    color: #333;
}

/* Investigations Styles */
.investigations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.investigation-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #9b59b6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.investigation-card h3 {
    margin-bottom: 10px;
}

.investigation-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.investigation-card h3 a:hover {
    color: #9b59b6;
}

.inv-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    font-size: 0.85rem;
    color: #666;
}

.inv-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.investigation-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.add-note-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.investigation-items {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.inv-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.inv-item-article h5 {
    margin-bottom: 8px;
}

.inv-item-article h5 a {
    color: #2c3e50;
    text-decoration: none;
}

.inv-item-article h5 a:hover {
    color: #3498db;
}

.inv-item-note p {
    margin-bottom: 8px;
    color: #555;
}

.inv-item-date {
    font-size: 0.8rem;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination .btn {
    min-width: 40px;
}

.pagination .btn.active {
    background: #e74c3c;
}

/* Responsive for Dashboard Ad */
@media (max-width: 768px) {
    .dashboard-ad-link {
        flex-direction: column;
    }
    
    .dashboard-ad-link img {
        width: 100%;
        height: 200px;
    }
}
