/*
Theme Name: Preneurs Epaper
Theme URI: https://www.preneurs.pk
Author: Preneurs.pk
Author URI: https://www.preneurs.pk
Description: Wordpress E-paper theme for newspapers and magazine with on page admin panel and customization features
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: preneurs-epaper
*/

:root {
    --primary-color: #438231;
    --secondary-color: #3a7030;
    --light-color: #f0fff0;
    --dark-color: #2a5220;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Jameel Noori Nastaleeq', 'Nafees', 'Alvi Lahori', tahoma, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

/* Top bar styling */
.top-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-icons a {
    color: white;
    margin-left: 15px;
    font-size: 20px;
    text-decoration: none;
}

.current-date {
    font-size: 18px;
}

/* Second bar with logo and menu */
.second-bar {
    background-color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo {
    height: 60px;
}

.menu {
    display: flex;
    list-style: none;
}

.menu li {
    position: relative;
    margin-left: 20px;
}

.menu a {
    color: var(--dark-color);
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 15px;
    display: block;
    transition: all 0.3s;
}

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

.submenu {
    display: none;
    position: absolute;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 200px;
    z-index: 100;
    list-style: none;
}

.menu li:hover .submenu {
    display: block;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

/* Divider bar */
.divider-bar {
    background-color: var(--primary-color);
    height: 5px;
    width: 100%;
}

/* Main content area */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
    font-size: 28px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* E-paper display */
.epaper-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.epaper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.epaper-view {
    width: 100%;
    height: 800px;
    border: none;
    border-radius: 5px;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin: 10px 5px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

/* Toggle buttons */
.toggle-buttons {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.toggle-btn {
    background-color: #ddd;
    color: #333;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none; /* for <a> links */
    display: inline-block;
}

.toggle-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.toggle-btn.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* Category links styling - FIXED BUTTON STYLING */
.category-links {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.category-links a.category-link,
.category-links .category-link {
    background-color: #ddd !important;
    color: #333 !important;
    border: none !important;
    padding: 10px 20px !important;
    margin: 0 5px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s !important;
    font-size: 16px !important;
    font-weight: normal !important;
}

.category-links a.category-link:hover,
.category-links .category-link:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.category-links a.category-link.active,
.category-links .category-link.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Admin panel */
.admin-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 30px;
}

.admin-tabs {
    display: flex;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 20px;
}

.admin-tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f5f5f5;
    margin-left: 5px;
    border-radius: 5px 5px 0 0;
}

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

.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.admin-form-content {
    display: none;
}

.admin-form-content.active {
    display: block;
}

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

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

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

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

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

.admin-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Login form */
.login-form {
    max-width: 400px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .menu {
        display: none;
    }
    
    .admin-form {
        grid-template-columns: 1fr;
    }
    
    .epaper-view {
        height: 500px;
    }
    
    .epaper-header {
        flex-direction: column;
    }
    
    .toggle-buttons {
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .toggle-btn {
        margin: 5px;
    }
    
    /* Responsive design for category links */
    .category-links {
        flex-direction: column;
        align-items: center;
    }
    
    .category-links a.category-link,
    .category-links .category-link {
        margin: 5px 0 !important;
        width: 200px;
        text-align: center;
    }
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    position: relative;
}

.footer-admin-link {
    margin-top: 15px;
    font-size: 14px;
}

.footer-admin-link a {
    color: #aaa;
    text-decoration: none;
}

.footer-admin-link a:hover {
    color: white;
    text-decoration: underline;
}

/* Archive page */
.archive-page {
    display: block;
}

.archive-header {
    text-align: center;
    margin-bottom: 20px;
}

/* Edition content */
.edition-content {
    display: none;
}

.edition-content.active {
    display: block;
}

/* Ensure admin panel is visible for admins */
body.user-is-admin .admin-panel {
    display: block !important;
}

/* Hide mobile menu toggle button */
.menu-toggle {
    display: none !important;
}

/* Ensure menu is always visible */
.main-navigation ul {
    display: flex !important;
}

/* Responsive menu for mobile */
@media (max-width: 768px) {
    .second-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .menu {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
    }
    
    .menu li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
    
    .submenu {
        position: static;
        width: 100%;
        box-shadow: none;
    }
}