/* ArchiveX - Main Stylesheet */
:root {
    --primary-color: #1a237e;
    --secondary-color: #ffd700;
    --accent-color: #283593;
    --text-dark: #212121;
    --text-light: #757575;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
}

* {
    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-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-search {
    order: 2;
    flex: 1;
    min-width: 250px;
    max-width: 500px;
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.nav-search input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .nav-search {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .nav-menu {
        order: 2;
    }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--bg-white);
}

.logo {
    height: 40px;
    width: auto;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--secondary-color);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    list-style: none;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    margin-top: 10px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    display: block;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #ffed4e;
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--bg-white);
    transition: all 0.3s;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: var(--bg-white);
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Featured Stories */
.featured-section {
    padding: 3rem 0;
    background: var(--bg-light);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.article-card {
    background: var(--bg-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;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.article-card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.article-card-content {
    padding: 1rem;
}

.article-card-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.article-card-title {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.article-card-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.article-card-title a:hover {
    color: var(--primary-color);
}

.article-card-excerpt {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Article Page */
.article-header {
    padding: 2rem 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 4px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.article-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.article-featured-image-wrapper {
    margin: 2rem 0;
}

.article-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.article-image-meta {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: rgba(33, 33, 33, 0.7);
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}

.article-image-meta span {
    display: block;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 2rem 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 2rem 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
}

.article-card-title a {
    color: var(--primary-color);
}

.article-content h4 { 
    font-size: 1.25rem; 
    color: var(--accent-color);
}

.article-content h5 { 
    font-size: 1.1rem; 
    color: var(--primary-color);
}

.article-content h6 { 
    font-size: 1rem; 
    color: var(--accent-color);
    font-style: italic;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-content figure {
    margin: 2rem 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.article-content .align-left {
    float: left;
    margin: 0 1rem 1rem 0;
    max-width: 50%;
}

.article-content .align-right {
    float: right;
    margin: 0 0 1rem 1rem;
    max-width: 50%;
}

.article-content .align-center {
    display: block;
    margin: 1rem auto;
    text-align: center;
}

/* Clearfix for floated images */
.article-content::after {
    content: "";
    display: table;
    clear: both;
}

.article-content mark,
article-card-title mark {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.share-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--bg-white);
    font-weight: 500;
    transition: transform 0.3s;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }

/* Recommended Posts */
.recommended-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

/* Forms */
.form-container {
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--accent-color);
}

.btn-success {
    background: var(--success-color);
    color: var(--bg-white);
}

.btn-danger {
    background: var(--error-color);
    color: var(--bg-white);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--bg-white);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.dashboard-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.dashboard-card h3 {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.dashboard-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dashboard-card .sub-value {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--primary-color);
}

table tr:hover {
    background: var(--bg-light);
}

/* Footer */
.main-footer {
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--bg-white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 50%;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Reading Timer */
.reading-timer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--bg-white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 999;
}

.reading-timer .time {
    font-size: 1.5rem;
    font-weight: bold;
}

.reading-timer .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* AdSense Friendly Spacing */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    min-height: 250px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Badge */
.badge {
    display: inline-block;
    background: var(--error-color);
    color: white;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

