/* ============================================ */
/* ===== هدر ===== */
/* ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #306998, #4584b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.snake-emoji {
    display: inline-block;
    font-size: 1.7rem;
    line-height: 1;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #4584b6;
    filter: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    transition: background 0.2s;
    line-height: 1;
}

.menu-toggle:hover {
    background: var(--nav-hover);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    transition: background 0.2s;
    color: var(--text-primary);
    line-height: 1;
}

.theme-toggle:hover {
    background: var(--nav-hover);
}

/* ============================================ */
/* ===== منوی ناوبری ===== */
/* ============================================ */
#nav-container {
    margin: 0.5rem 0 1.5rem 0;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.3rem 0.1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.nav a.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: #306998;
}

/* ============================================ */
/* ===== محتوای اصلی ===== */
/* ============================================ */
.content {
    flex: 1;
}

.content h2 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-top: 0.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 1.2rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.content ul,
.content ol {
    margin-right: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.content li {
    margin-bottom: 0.4rem;
}

.content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: border-color 0.2s;
}

.content a:hover {
    border-bottom-color: var(--primary-color);
}

/* ============================================ */
/* ===== کارت‌های لینک سریع ===== */
/* ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.card-grid a {
    display: block;
    background: var(--card-bg);
    padding: 0.9rem 0.6rem;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid var(--card-border);
    transition: all 0.2s;
}

.card-grid a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--primary-color);
    background: var(--bg-container);
}

.card-grid .icon {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 0.2rem;
}

/* ============================================ */
/* ===== فوتر ===== */
/* ============================================ */
.footer {
    margin-top: 2.5rem;
    padding: 0.8rem 0.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
    background: var(--footer-bg);
    border-radius: 0 0 28px 28px;
    margin-left: -1.8rem;
    margin-right: -1.8rem;
    padding-left: 1.8rem;
    padding-right: 1.8rem;
    transition: background 0.3s, border-color 0.3s;
}

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

#runTester {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
}

#runTester:hover {
    background: var(--nav-hover);
    border-color: var(--primary-color);
}

#testerReport {
    margin-top: 0.8rem;
    text-align: right;
}