/* Shared CSS for global styles and components */

/* Basic Resets */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
}

a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

ul {
    list-style: none;
}

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

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-accent {
    background-color: #28a745; /* Example accent color */
    color: #fff;
    border-color: #28a745;
}

.btn-accent:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-lg {
    padding: 12px 25px;
    font-size: 1.1rem;
}

/* Header Styles */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.header-top-bar {
    background-color: #007bff;
    color: #fff;
    padding: 8px 0;
    font-size: 0.9em;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-content .contact-info span {
    margin-right: 20px;
}

.top-bar-content .social-links a {
    color: #fff;
    margin-left: 15px;
    font-size: 1.1em;
}

.header-main-nav {
    padding: 15px 0;
}

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

.logo img {
    height: 40px; /* Adjust as needed */
}

.main-nav .nav-list {
    display: flex;
    gap: 25px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #333;
    font-weight: bold;
    padding: 10px 0;
    display: block;
}

.nav-link:hover {
    color: #007bff;
}

.has-dropdown > .nav-link {
    display: flex;
    align-items: center;
}

.has-dropdown > .nav-link i {
    margin-left: 5px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.has-dropdown:hover > .nav-link i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 200px;
    border-radius: 5px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    color: #333;
    padding: 10px 20px;
    display: block;
}

.dropdown-menu li a:hover {
    background-color: #f0f0f0;
    color: #007bff;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

.icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 8px 12px;
    outline: none;
    width: 150px;
}

.search-box button {
    background-color: #f0f0f0;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #e0e0e0;
}

.user-auth .btn {
    padding: 8px 15px;
    font-size: 0.9em;
}

.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/assets/images/hero-bg.jpg') no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 100px 0;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    font-weight: bold;
}

.hero-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer Styles */
.main-footer {
    background-color: #222;
    color: #f0f0f0;
    padding: 60px 0 20px;
    font-size: 0.95em;
}

.footer-container {
    padding-bottom: 30px;
}

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

.footer-col h4 {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 20px;
    position: relative;
}

.footer-col h4::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #007bff;
    margin-top: 10px;
}

.footer-col p {
    margin-bottom: 15px;
}

.footer-col .social-links a {
    color: #f0f0f0;
    margin-right: 15px;
    font-size: 1.3em;
    transition: color 0.3s ease;
}

.footer-col .social-links a:hover {
    color: #007bff;
}

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

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

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

.footer-col ul li a:hover {
    color: #007bff;
    padding-left: 5px;
}

.footer-col address p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.footer-col address p i {
    margin-right: 10px;
    color: #007bff;
    font-size: 1.1em;
    line-height: 1.6; /* Align icon with text */
}

.newsletter-signup input[type="email"] {
    width: calc(100% - 110px);
    padding: 10px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
    font-size: 1em;
}

.newsletter-signup button {
    width: 100px;
    padding: 10px;
    border: none;
    background-color: #007bff;
    color: #fff;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
    vertical-align: top; /* Align with input */
}

.newsletter-signup button:hover {
    background-color: #0056b3;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85em;
}

.footer-bottom a {
    color: #007bff;
    margin: 0 10px;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: calc(100% + 15px); /* Below header-main-nav */
        left: 0;
        background-color: #fff;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        padding: 15px 0;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: center;
    }

    .nav-item a {
        padding: 12px 20px;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 10px;
    }

    .menu-toggle {
        display: block;
    }

    .header-actions {
        order: 1; /* Move actions before logo on smaller screens */
    }

    .logo {
        order: 2;
    }

    .main-nav {
        order: 3;
        flex-grow: 1;
        text-align: right;
    }

    .search-box input {
        width: 100px; /* Smaller search box */
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1.1em;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-col {
        text-align: center;
    }

    .footer-col h4::after {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-col .social-links {
        justify-content: center;
        display: flex;
    }

    .newsletter-signup {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .newsletter-signup input[type="email"] {
        width: 80%;
        border-radius: 5px;
        margin-bottom: 10px;
        text-align: center;
    }

    .newsletter-signup button {
        width: 80%;
        border-radius: 5px;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }

    .top-bar-content .contact-info span {
        margin-right: 0;
        display: block;
        margin-bottom: 5px;
    }

    .top-bar-content .social-links {
        margin-top: 10px;
    }

    .nav-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-actions, .logo, .main-nav {
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 15px;
    }

    .search-box {
        justify-content: center;
    }

    .user-auth {
        justify-content: center;
        display: flex;
        gap: 10px;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .hero-content p {
        font-size: 1em;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
