/* Italian Brainrot Clicker - Main Stylesheet
   Colors inspired by Italian flag and theme:
   - Green: #008C45 (Italian flag green)
   - White: #F4F4F4 (Off-white for readability)
   - Red: #CD212A (Italian flag red)
   - Dark: #1A1A1A (For contrast and readability)
*/

/* Variables */
:root {
    --primary-bg: #0d1117; /* 更深的背景色，类似二次元游戏风格 */
    --secondary-bg: #161b22; /* 稍微亮一点的背景色 */
    --header-bg: #0a0a0a; /* 更深的背景色，增加与主内容区域的对比 */
    --accent-color: #7e57c2; /* 紫色调，更符合二次元风格 */
    --accent-color-hover: #9575cd;
    --secondary-accent: #00b0ff; /* 蓝色调 */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #30363d; /* 稍微亮一点的边框色 */
    --card-bg: #1c2128; /* 卡片背景色 */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --italian-red: #cd212a;
    --italian-green: #008c45;
    --italian-white: #f4f5f0;
    --friendly-blue: #3498db;
    --friendly-purple: #9b59b6;
    --friendly-orange: #FFA500;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-bg);
    overflow-x: hidden;
}

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
    color: var(--accent-color);
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 60px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-accent));
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    display: inline-block;
}

.section-title h2::after {
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
}

/* Container */
.container {
    width: 100%;
    max-width: 900px; /* 减小容器宽度，参考wordle2.io */
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

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

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

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: var(--text-primary);
}

/* Header */
header {
    display: block;
    background-color: var(--header-bg);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

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

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

.logo-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--primary-bg);
    border: 2px solid var(--accent-color); /* 修改边框颜色 */
    box-shadow: 0 0 10px rgba(126, 87, 194, 0.5); /* 修改阴影颜色 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.logo-circle:hover {
    transform: scale(1.1);
    border-color: var(--secondary-accent);
    box-shadow: 0 0 15px rgba(0, 176, 255, 0.6);
}

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

.logo-circle:hover img {
    transform: scale(1.1);
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.language-selector {
    display: flex;
    align-items: center;
}

.language-btn {
    background-color: var(--header-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background-color: var(--secondary-bg);
    border-color: var(--accent-color);
}

.language-btn .lang-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    margin-right: 4px;
    vertical-align: middle;
}

.language-btn svg.lang-icon {
    width: 18px;
    height: 18px;
    stroke: var(--accent-color);
}

.language-btn i {
    font-size: 1rem;
}

/* Main Content Sections */
main {
    padding-top: 0.5rem; /* 减少顶部间距 */
}

section {
    padding: 1.5rem 0; /* 减少section的上下padding */
    position: relative;
}

section h2 {
    margin-top: 1.5rem;
}

/* Hero Section */
.hero {
    background-color: var(--primary-bg);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero h1 span {
    color: var(--accent-color);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Game Section */
#game-section {
    padding-top: 0.5rem; /* 减少游戏区域顶部padding */
    padding-bottom: 2rem;
    background-color: var(--primary-bg);
}

.game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px; /* 减少header的padding */
    background-color: var(--header-bg);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.game-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.8rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-container {
    width: 100%;
    height: 550px;
    margin: 0 auto;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    background-color: var(--primary-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.iframe-wrapper iframe {
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: calc(100% + 120px);
    border: none;
    z-index: 1;
}

.bottom-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: var(--primary-bg);
    z-index: 10;
}

.more-games-overlay {
    position: absolute;
    bottom: 40px;
    right: 0;
    width: 120px;
    height: 50px;
    background-color: var(--primary-bg);
    z-index: 10;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.game-btn {
    background-color: var(--accent-color);
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

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

/* Game footer with tips and share button */
.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.5rem 0;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
}

.game-tips {
    flex: 1;
}

.game-tips p {
    margin: 0;
    color: var(--text-secondary);
}

.game-tips i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.game-share {
    position: relative;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn i {
    margin-right: 0.5rem;
}

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

.share-popup {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
    display: none;
    z-index: 100;
    min-width: 200px;
}

.share-popup.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.share-popup:after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--card-bg) transparent;
}

.share-popup-title {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.share-twitter {
    background-color: #1DA1F2;
}

.share-facebook {
    background-color: #4267B2;
}

.share-reddit {
    background-color: #FF4500;
}

.share-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-whatsapp {
    background-color: #25D366;
}

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

/* How to Play Section */
.how-to-play-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    color: var(--text-primary);
    border-radius: 50%;
    font-weight: bold;
    margin-bottom: 1rem;
}

.step-card h3 {
    margin-bottom: 1rem;
}

.step-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
    flex-grow: 1;
}

/* Video Section */
.video-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.video-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-description h3 {
    margin-bottom: 1rem;
}

.video-description p {
    margin-bottom: 1.5rem;
}

.video-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.video-highlight {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.video-highlight i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* Pro Tips Section */
.pro-tips-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.pro-tips-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.pro-tips-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.pro-tip {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.pro-tip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background-color: rgba(126, 87, 194, 0.1);
    color: var(--accent-color);
    border-radius: 50%;
    font-size: 1.2rem;
}

.pro-tip-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.pro-tip-content p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* FAQ Section */
.faq-container {
    margin-top: 2rem;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: var(--card-bg);
}

.faq-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.faq-question {
    padding: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.faq-question h3 {
    margin: 0;
    font-size: 1.1rem;
    flex: 1;
}

.faq-question::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--accent-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease, opacity 0.3s ease;
    background-color: var(--card-bg);
    padding: 0 1.2rem;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 1000px; /* 足够大的值确保内容可以完全显示 */
    padding: 0 1.2rem 1.2rem 1.2rem;
    opacity: 1;
}

.faq-answer p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-top: 0.5rem;
}

/* Game Introduction Section */
.intro-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    margin-top: 1.5rem;
}

.intro-text {
    flex: 1;
    min-width: 300px;
}

.intro-image {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.intro-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.intro-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .intro-content {
        flex-direction: column;
    }
    
    .intro-image {
        order: -1;
        margin-bottom: 1rem;
    }
}

/* Game Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.feature-icon {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
    flex-grow: 1;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    background-color: var(--header-bg);
    color: var(--text-primary);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    flex: 2;
    min-width: 250px;
}

.footer-logo h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-logo p {
    color: var(--text-secondary);
}

.footer-links, .footer-social {
    flex: 1;
    min-width: 200px;
}

.footer-links h3, .footer-social h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-links h3::after, .footer-social h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 40px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-accent));
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

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

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .video-section {
        grid-template-columns: 1fr;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
    
    .container {
        padding: 0 10px;
    }
}
