/* ============================================
   bragbg - Unified Style System
   Google SEO Optimized Template for Brazil
   ============================================ */

/* Global Variables - Unified Color Scheme */
:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2d2d2d;
    --accent-gold: #d4af37;
    --accent-gold-light: #f4d03f;
    --accent-brazil-green: #009739;
    --accent-brazil-blue: #012169;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #444444;
    --hover-bg: #3a3a3a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-bg) 0%, #0f0f0f 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-attachment: fixed;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Fixed Top Header - 重新设计 */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(26, 26, 26, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 12px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212, 175, 55, 0.1);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-gold);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo:hover {
    color: var(--accent-gold-light);
    transition: var(--transition);
}

.header-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8941f 100%);
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-brazil-green) 0%, #007a2e 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #00b347 0%, var(--accent-brazil-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 151, 57, 0.4);
}

/* Fixed Navigation Menu - 全新设计 */
nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(20, 20, 20, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999 !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: visible !important;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    overflow: visible !important;
    position: relative !important;
    display: flex;
    align-items: center;
}

.nav-top-row {
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    overflow-x: auto;
    overflow-y: visible !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
    position: relative;
    flex: 1;
    padding: 0 10px;
    align-items: stretch;
}

/* 桌面端导航栏渐变遮罩效果 */
@media (min-width: 769px) {
    .nav-container::before,
    .nav-container::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 30px;
        z-index: 10;
        pointer-events: none;
    }
    
    .nav-container::before {
        left: 0;
        background: linear-gradient(90deg, rgba(15, 15, 15, 0.98) 0%, transparent 100%);
    }
    
    .nav-container::after {
        right: 0;
        background: linear-gradient(270deg, rgba(15, 15, 15, 0.98) 0%, transparent 100%);
    }
}

.nav-menu::-webkit-scrollbar {
    height: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 2px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

.nav-item {
    position: relative !important;
    overflow: visible !important;
    z-index: 1;
    flex-shrink: 0;
}

.nav-link {
    display: block;
    padding: 16px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    background: transparent;
    border-radius: 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px 2px 0 0;
}

.nav-link:hover {
    color: var(--accent-gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.03) 100%);
    transform: translateY(-1px);
}

.nav-link:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-link.active {
    color: var(--accent-gold);
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.05) 100%);
    font-weight: 600;
    border-bottom-color: var(--accent-gold);
}

.nav-link.active::before {
    transform: translateX(-50%) scaleX(1);
    background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-gold-light), var(--accent-gold), transparent);
}

.nav-item:hover > .nav-link,
.nav-item .nav-link:hover {
    color: var(--accent-gold);
}

/* Mobile Menu Toggle Button - 重新设计 */
.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    color: var(--accent-gold);
    font-size: 20px;
    cursor: pointer;
    padding: 12px 16px;
    transition: all 0.3s ease;
    font-weight: 600;
    margin: 10px 20px;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.15) 100%);
    border-color: var(--accent-gold);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.mobile-menu-toggle:active {
    transform: scale(0.98);
}

/* Hide Mobile Buttons on Desktop */
@media (min-width: 769px) {
    .mobile-nav-buttons {
        display: none !important;
    }
}

/* Main Content Area */
main {
    margin-top: 130px;
    padding: 40px 0;
    min-height: calc(100vh - 130px);
    position: relative;
    z-index: 1;
}

/* 桌面端导航栏优化 - 确保13个栏目都能正常显示 */
@media (min-width: 769px) and (max-width: 1200px) {
    .nav-link {
        padding: 16px 12px;
        font-size: 13px;
    }
}

@media (min-width: 1201px) {
    .nav-link {
        padding: 16px 16px;
        font-size: 14px;
    }
}

/* Card Styles */
.card {
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.split-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 30px;
    align-items: center;
}

.split-grid > * {
    min-width: 0;
}

.split-grid.align-top {
    align-items: flex-start;
}

.split-grid.wide {
    gap: 40px;
}

.split-grid.tight {
    gap: 20px;
}

.pad-xl {
    padding: 50px !important;
}

/* Heading Styles */
h1 {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 20px;
    line-height: 1.2;
}

h2 {
    font-size: 32px;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 20px;
    line-height: 1.3;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

h4 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Paragraph Styles */
p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Link Styles */
a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-gold-light);
    text-decoration: underline;
}

/* Image Styles */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.img-fluid {
    width: 100%;
    height: auto;
}

/* List Styles */
ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8941f 100%);
    color: #000;
    font-weight: 600;
}

tr:hover {
    background: var(--hover-bg);
}

/* Responsive Design - 移动端优化 */
@media (max-width: 768px) {
    header {
        padding: 10px 0;
        border-bottom-width: 1px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    nav {
        top: 60px;
        background: linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(15, 15, 15, 0.98) 100%);
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        position: fixed;
        left: 0;
        right: 0;
        z-index: 999;
    }
    
    .nav-container {
        flex-direction: column;
        padding: 0;
        display: flex;
        position: relative;
        background: transparent;
    }
    
    .nav-top-row {
        display: flex;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        padding: 12px 20px;
    }
    
    .nav-top-row .mobile-menu-toggle,
    .nav-top-row .mobile-nav-buttons .mobile-btn {
        flex: 1;
        text-align: center;
        font-size: 15px !important;
        padding: 12px 0 !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .nav-top-row .mobile-menu-toggle {
        margin: 0;
        align-self: stretch;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .nav-top-row .mobile-menu-toggle:active {
        transform: scale(0.96);
    }
    
    .mobile-nav-buttons {
        display: flex !important;
        gap: 12px;
        flex: 2;
    }
    
    .nav-menu {
        order: 2;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
        padding: 0;
        margin: 0;
        background: rgba(10, 10, 10, 0.98);
        list-style: none;
    }
    
    .nav-menu.active {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
        overflow-x: hidden;
        border-top: 1px solid rgba(212, 175, 55, 0.2);
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }
    
    /* 移动端菜单滚动条样式 - 更明显，确保可见 */
    .nav-menu.active::-webkit-scrollbar {
        width: 8px;
        display: block !important;
    }
    
    .nav-menu.active::-webkit-scrollbar-track {
        background: rgba(68, 68, 68, 0.4);
        border-radius: 4px;
        margin: 5px 0;
    }
    
    .nav-menu.active::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, var(--accent-gold) 0%, #b8941f 100%);
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(212, 175, 55, 0.4);
        min-height: 30px;
    }
    
    .nav-menu.active::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, var(--accent-gold-light) 0%, var(--accent-gold) 100%);
    }
    
    /* Firefox 滚动条 - 确保可见 */
    .nav-menu.active {
        scrollbar-width: auto;
        scrollbar-color: var(--accent-gold) rgba(68, 68, 68, 0.4);
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(68, 68, 68, 0.3);
        flex-shrink: 0;
        margin: 0;
        padding: 0;
        /* 确保每个项目都占用空间 */
        display: block;
    }
    
    /* 确保最后一个项目有足够的底部间距 */
    .nav-item:last-child {
        border-bottom: none;
        margin-bottom: 10px;
    }
    
    .nav-link {
        padding: 16px 24px;
        border-bottom: none;
        font-size: 15px;
        border-left: 4px solid transparent;
        background: transparent !important;
        min-height: 52px;
        display: flex;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    .nav-link::before {
        display: none;
    }
    
    .nav-link:hover {
        background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
        border-left-color: var(--accent-gold);
        transform: translateX(4px);
        padding-left: 28px;
    }
    
    .nav-link.active {
        background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.08) 100%) !important;
        border-left-color: var(--accent-gold);
        border-bottom: none;
        padding-left: 28px;
    }
    
    /* Mobile Button Styles - 顶部行中始终显示 */
    .mobile-nav-buttons {
        display: flex !important;
        gap: 12px;
    }
    
    .mobile-nav-buttons .mobile-btn {
        flex: 1;
        text-align: center;
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        display: block !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }
    
    .mobile-nav-buttons .mobile-btn:active {
        transform: scale(0.98) !important;
    }
    
    main {
        margin-top: 60px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logoimg {
        max-width: 120px;
    }
    
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 26px;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-buttons {
        width: 100%;
        margin-top: 10px;
        justify-content: space-between;
    }
    
    .btn {
        flex: 1;
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Masonry Grid Layout */
.masonry-grid {
    column-count: 3;
    column-gap: 25px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 25px;
}

.feature-span-2 {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* Responsive overrides for inline grids */
@media (max-width: 768px) {
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat(2, 1fr)"],
    [style*="grid-template-columns: repeat(3, 1fr)"],
    [style*="grid-template-columns: 250px 1fr"],
    [style*="grid-template-columns: 100px 1fr"],
    [style*="grid-template-columns: 100px 1fr auto"],
    [style*="grid-template-columns: 80px 1fr"],
    [style*="minmax(280px"],
    [style*="minmax(300px"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: 100px 1fr auto"],
    [style*="grid-template-columns: 80px 1fr"],
    [style*="grid-template-columns: 250px 1fr"] {
        text-align: left;
        gap: 15px !important;
    }

    [style*="grid-template-columns: 1fr 1fr"] img,
    [style*="grid-template-columns: repeat(2, 1fr)"] img,
    [style*="grid-template-columns: repeat(3, 1fr)"] img {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .live-sidebar {
        display: none !important;
    }

    .feature-span-2 {
        grid-column: span 1 !important;
    }
}

.logoimg {
    height: 58px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.2));
}

.logoimg:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.4));
}

@media (max-width: 768px) {
    .logoimg {
        height: 48px;
        margin: 0 auto;
    }
}

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

.header-buttons .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.header-buttons .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.header-buttons .btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 手机端隐藏 */
@media (max-width: 768px) {
    .header-buttons {
        display: none;
    }
}

@media (max-width: 768px) {
    main {
        margin-top: 80px; /* 根据导航+按钮高度调整 */
    }
    
    /* 确保移动端导航栏完全展开时的样式 */
    .nav-menu.active + .mobile-nav-buttons {
        display: flex !important;
    }
}

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

    .split-grid > * {
        width: 100%;
    }
}

.form-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.stack-on-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

@media (max-width: 768px) {
    .pad-xl {
        padding: 30px !important;
    }

    .form-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    [style*="grid-template-columns: 300px"],
    [style*="grid-template-columns: 320px"],
    [style*="grid-template-columns: 280px 1fr"],
    [style*="grid-template-columns: minmax(280px, 1fr) 320px"] {
        grid-template-columns: 1fr !important;
    }

    [style*="padding: 80px 0"] {
        padding: 40px 0 !important;
    }

    [style*="padding: 50px"] {
        padding: 30px !important;
    }
}

@media (max-width: 640px) {
    .stack-on-mobile {
        flex-direction: column;
        align-items: stretch;
    }

    .stack-on-mobile .btn {
        width: 100%;
    }
}