/*
Theme Name: KnowledgeHub
Theme URI: https://example.com/knowledgehub
Author: Your Name
Author URI: https://example.com
Description: A Q&A WordPress theme based on KnowledgeHub design
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: knowledgehub
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #1e293b;
    --accent: #f97316;
    --light: #f8fafc;
    --dark: #0f172a;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      /* Color palette */
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --card-bg: #334155;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--secondary);
    background-color: #f1f5f9;
    padding-bottom: 60px;
}


a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    gap: 8px;
    box-shadow: var(--shadow);
}

.btn:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

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

.btn-accent {
    background: var(--accent);
}

.btn-accent:hover {
    background: #ea580c;}
    

/* Main Content */
.main-content {
    padding: 40px 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary);
    position: relative;
    display: inline-block;
}

.page-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.questions-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.question-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.question-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

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

.question-card:hover:before {
    opacity: 1;
}

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: flex-start;
}

.question-meta {
    display: flex;
    align-items: center;
    color: var(--gray);
    font-size: 0.9rem;
    gap: 10px;
}

.question-meta img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-date {
    font-size: 0.85rem;
    color: var(--gray);
}

.question-tags {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 10px;
}

.tag {
    background: var(--light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--light-gray);
}

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

.question-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--secondary);
    font-weight: 600;
    line-height: 1.4;
}

.question-excerpt {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

.question-stats {
    display: flex;
    border-top: 1px solid var(--light-gray);
    padding-top: 20px;
    color: var(--gray);
    font-size: 0.9rem;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat i {
    font-size: 1.1rem;
}

.stat.answers {
    color: var(--success);
}

.stat.views {
    color: var(--gray);
}

.stat.votes {
    color: var(--accent);
}

/* Footer */
footer {
    background: var(--secondary);
    color: white;
    padding: 60px 0 30px;
    margin-top: 80px;
    position: relative;
}

footer:before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, var(--secondary) 0%, transparent 100%);
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-about {
    margin-bottom: 30px;
    max-width: 400px;
    color: #cbd5e1;
    line-height: 1.7;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-links h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: white;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-links a i {
    font-size: 0.8rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* Newsletter Subscription */
.newsletter {
    background: var(--primary);
    border-radius: var(--border-radius);
    padding: 40px;
    margin: 60px 0;
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
}

.newsletter h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.newsletter p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    font-size: 1rem;
}

.newsletter-input:focus {
    outline: none;
}

.newsletter-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Responsive Styles - Mobile First */
@media (max-width: 968px) {
    .nav-toggle {
        display: block;
    }
    
    .nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        gap: 30px;
        z-index: 99;
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 20px;
    }
    
    .search-bar {
        margin: 0;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .user-actions {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .newsletter-input, .newsletter-btn {
        border-radius: var(--border-radius-sm);
        width: 100%;
    }
    
    .user-menu {
        top: 70px;
        right: 10px;
        width: 90%;
        max-width: 300px;
    }
}

@media (min-width: 769px) {
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    .questions-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .questions-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animation for elements */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-card {
    animation: fadeIn 0.5s ease-out;
}

/* Overlay for mobile nav */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}
/* Custom Authentication System Styles */
.custom-auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.custom-auth-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 450px;
}

.custom-auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.auth-guide {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.auth-guide h3 {
    margin-top: 0;
    color: #0073aa;
}

.auth-guide ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

.auth-guide li {
    margin-bottom: 0.5rem;
}

.auth-guide li:last-child {
    margin-bottom: 0;
}

.auth-errors {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.auth-errors .error {
    margin: 0 0 0.5rem 0;
    color: #d32f2f;
}

.auth-errors .error:last-child {
    margin-bottom: 0;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.auth-form input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.auth-form small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.auth-form .remember {
    display: flex;
    align-items: center;
}

.auth-form .remember input {
    margin-right: 0.5rem;
}

.auth-form .remember label {
    margin-bottom: 0;
    font-weight: normal;
}

.auth-button {
    width: 100%;
    padding: 0.75rem;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-button:hover {
    background: #005a87;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.auth-links p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-auth-container {
        padding: 1rem;
    }
    
    .custom-auth-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .custom-auth-form {
        padding: 1rem;
        box-shadow: none;
    }
}

/* Extra CSS for Simplified Header Navigation */
.user-profile-menu {
    position: relative;
    margin-left: 0.5rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.user-avatar:hover {
    border-color: #3498db;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    min-width: 200px;
    display: none;
    z-index: 1000;
    margin-top: 0.5rem;
    border: 1px solid #e0e0e0;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s ease;
    font-size: 0.95rem;
}

.user-dropdown a:hover {
    background: #f8f9fa;
    color: #3498db;
}

.user-dropdown a i {
    width: 18px;
    text-align: center;
}

.user-profile-menu:hover .user-dropdown {
    display: block;
}

/* Mobile adjustments for the dropdown */
@media (max-width: 968px) {
    .user-profile-menu {
        width: 100%;
        margin-left: 0;
    }
    
    .user-dropdown {
        position: static;
        box-shadow: none;
        display: block;
        margin-top: 0.5rem;
        width: 100%;
        border: none;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    .user-avatar {
        display: none;
    }
}