/* Global Styles */
:root {
    --primary-color: #0096d6; /* HP blue */
    --secondary-color: #00b388; /* HP green */
    --dark-blue: #0f3057;
    --light-gray: #f4f4f4;
    --medium-gray: #e0e0e0;
    --dark-gray: #333;
    --white: #ffffff;
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-secondary: 'Arial', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: #fafafa;
}

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

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

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

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

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

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

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Header Styles */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    color: var(--dark-gray);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

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

nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Add this to the existing header navigation styles */

.nav-signin {
    margin-left: 15px;
}

.signin-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0096d6;
    color: white;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.signin-button:hover {
    background-color: #007cb6;
}

.signin-button i {
    margin-right: 6px;
}

/* Auth Buttons Styling */
.auth-buttons {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-signin {
    background-color: transparent;
    color: #0096d6;
    border: 1px solid #0096d6;
}

.btn-signin:hover {
    background-color: #0096d6;
    color: white;
}

.btn-signup {
    background-color: #0096d6;
    color: white;
    border: 1px solid #0096d6;
}

.btn-signup:hover {
    background-color: #0078a8;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(15, 48, 87, 0.8), rgba(15, 48, 87, 0.9)), url('https://images.unsplash.com/photo-1517430816045-df4b7de11d1d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Featured Posts Section */
.featured-posts {
    padding: 80px 0;
    background-color: var(--white);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.post-image {
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

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

.category {
    color: var(--primary-color);
    font-weight: 600;
}

.post-content h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.post-content p {
    margin-bottom: 15px;
    color: #666;
}

.read-more {
    display: inline-block;
    font-weight: 600;
    position: relative;
    padding-bottom: 2px;
}

.read-more::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.read-more:hover::after {
    width: 100%;
}

.view-all {
    text-align: center;
}

/* Categories Section */
.categories {
    padding: 80px 0;
    background-color: var(--light-gray);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.category-card p {
    margin-bottom: 15px;
    color: #666;
}

.category-card a {
    font-weight: 600;
}

/* Newsletter Section */
.newsletter {
    padding: 60px 0;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

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

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

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

.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.newsletter-form button {
    border-radius: 0 4px 4px 0;
    padding: 0 20px;
    font-size: 1rem;
    background-color: var(--dark-blue);
}

.newsletter-form button:hover {
    background-color: #0b2341;
}

/* Footer */
footer {
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 60px 0 20px;
}

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

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

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

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

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #bbb;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
}

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

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

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
}

.footer-links a {
    color: #bbb;
    margin-left: 20px;
    font-size: 0.9rem;
}

.footer-bottom p {
    font-size: 0.9rem;
    color: #bbb;
}

/* Back to top button - Add these styles */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* Language selector styles for global users */
.language-selector {
    margin-left: 20px;
    position: relative;
}

.language-selector select {
    padding: 5px 30px 5px 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    background-color: transparent;
    color: var(--dark-gray);
    cursor: pointer;
    font-size: 0.9rem;
    appearance: none;
}

.language-selector::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Additional styles for the printer guides page */
.guide-tag {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.category-filters {
    background-color: var(--white);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

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

.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-btn {
    padding: 10px 20px;
    white-space: nowrap;
}

.featured-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.featured-guide-image {
    overflow: hidden;
    height: 100%;
    min-height: 300px;
}

.featured-guide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-guide:hover .featured-guide-image img {
    transform: scale(1.05);
}

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

.featured-guide-content h2 {
    margin: 10px 0;
    font-size: 1.8rem;
    color: var(--dark-blue);
}

.guide-meta {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    color: #777;
    font-size: 0.9rem;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.guide-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-5px);
}

.guide-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.guide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.guide-card:hover .guide-image img {
    transform: scale(1.05);
}

.guide-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.guide-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: var(--dark-blue);
}

.guide-content p {
    color: #666;
    margin-bottom: 15px;
}

.read-more {
    margin-top: auto;
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .featured-guide, .guides-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-guide-image {
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .guides-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-container {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .posts-grid,
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-signin {
        margin-top: 15px;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        background-color: var(--white);
        height: 100vh;
        width: 80%;
        max-width: 320px;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin-left: 0;
        margin-bottom: 20px;
    }

    .mobile-menu {
        display: block;
        z-index: 1001;
    }

    .posts-grid,
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .newsletter-form button {
        border-radius: 4px;
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        margin-top: 15px;
        justify-content: center;
    }

    .footer-links a:first-child {
        margin-left: 0;
    }

    /* Show auth buttons in mobile menu when expanded */
    .mobile-menu-expanded .auth-buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 10px 0;
    }
}

/* Responsive adjustments for auth buttons */
@media (max-width: 768px) {
    .auth-buttons {
        display: none;
    }
    
    /* Show auth buttons in mobile menu when expanded */
    .mobile-menu-expanded .auth-buttons {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 10px 0;
    }
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(45deg, var(--primary-color), #0088cc);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 0;
}

.cta-content h2 {
    font-size: 2.2rem;
    margin-top: 0;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.cta-content .btn {
    background-color: var(--white);
    color: var(--primary-color);
    padding: 14px 30px;
    font-size: 1.1rem;
}

.cta-content .btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.align-items-center {
    align-items: center;
}

.page-header{
    padding: 30px 0;
}

/* User Menu and Dropdown Styles - Fixed Version */
.user-menu {
    position: relative;
    z-index: 1050; /* Ensure dropdown appears above other elements */
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    background-color: rgba(0, 150, 214, 0.1);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.user-menu-trigger:hover {
    background-color: rgba(0, 150, 214, 0.2);
}

.user-menu-trigger i {
    margin-right: 8px;
}

.user-menu-trigger span {
    font-weight: 500;
    margin: 0 8px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 200px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    display: none; /* Initially hidden */
    transition: all 0.2s ease;
}

.user-dropdown.active {
    display: block; /* Show when active */
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

.user-dropdown a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.user-dropdown a#logout-btn {
    border-top: 1px solid #eee;
}

.user-dropdown a#logout-btn:hover {
    background-color: #fdecea;
    color: #d32f2f;
}

/* Status Messages */
.status-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

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

.status-message.success {
    background-color: #e6f7e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.status-message.error {
    background-color: #fdecea;
    color: #d32f2f;
    border-left: 4px solid #d32f2f;
}

/* Button loading state */
.btn .fa-spinner {
    margin-right: 5px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for user menu */
@media (max-width: 768px) {
    .user-menu-trigger span {
        display: none;
    }
    
    .user-menu-trigger i.fa-chevron-down {
        margin-left: 0;
    }
}